unit uViewConfiguracionDocObra; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, uViewConfiguracionBase, cxControls, cxContainer, cxEdit, cxTextEdit, cxMemo, cxRichEdit, uViewBase, JvExControls, JvGradientHeaderPanel, StdCtrls, ExtCtrls, ComCtrls, uCustomView, uViewDetallesBase, uViewDetallesDTO, uViewDetallesArticulos, uViewConfiguracionCapitulo, cxGraphics, cxMaskEdit, cxDropDownEdit, cxLookupEdit, cxDBLookupEdit, cxDBLookupComboBox, DB, uDAInterfaces, uDADataTable, uFormasPagoController, uBizFormasPago; type TfrViewConfiguracionDocObra = class(TfrViewConfiguracionBase) paginas: TPageControl; pagNotas: TTabSheet; Label1: TLabel; Label2: TLabel; Label4: TLabel; ePlazosEntrega: TMemo; eFormaPago: TMemo; eObservaciones: TMemo; pagCapitulo: TTabSheet; frViewConfiguracionCapitulo: TfrViewConfiguracionCapitulo; pagCondiciones: TTabSheet; eCondiciones: TcxRichEdit; dsFormaPago: TDADataSource; cbFormaPago: TcxLookupComboBox; protected FFormasPago : IBizFormaPago; FFormasPagoController : IFormasPagoController; public class function GetViewClass : TClass; override; class function DarEtiqueta : String; override; procedure CargarValores; override; procedure GuardarValores; override; end; var frViewConfiguracionDocObra: TfrViewConfiguracionDocObra; implementation {$R *.dfm} { TfrViewConfiguracionDocOBRA } uses uFactuGES_App, uConfiguracionController, uPresupuestosClienteController, uBizDetallesPresupuestoCliente, uDetallesPresupuestoClienteController; procedure TfrViewConfiguracionDocObra.CargarValores; begin inherited; JvGradientHeaderPanel1.LabelCaption := JvGradientHeaderPanel1.LabelCaption + AppFactuGES.EmpresaActiva.NOMBRE; FFormasPago := Nil; FFormasPagoController := TFormasPagoController.Create; FFormasPago := FFormasPagoController.BuscarTodos; dsFormaPago.DataTable := FFormasPago.DataTable; dsFormaPago.DataTable.Active := True; ePlazosEntrega.Lines.Clear; ePlazosEntrega.Text := AppFactuGES.Configuracion.GetSettingAsString(teBD,CTE_PLAZOS_ENTREGA_OBRA, AppFactuGES.EmpresaActiva.ID); eObservaciones.Lines.Clear; eObservaciones.Text := AppFactuGES.Configuracion.GetSettingAsString(teBD,CTE_OBSERVACIONES_OBRA, AppFactuGES.EmpresaActiva.ID); eCondiciones.Lines.Clear; eCondiciones.Text := AppFactuGES.Configuracion.GetSettingAsString(teBD,CTE_CONDICIONES_OBRA, AppFactuGES.EmpresaActiva.ID); cbFormaPago.EditValue := AppFactuGES.Configuracion.GetSettingAsString(teBD,CTE_FORMA_PAGO_OBRA, AppFactuGES.EmpresaActiva.ID); // eFormaPago.Lines.Clear; // eFormaPago.Text := AppFactuGES.Configuracion.GetSettingAsString(teBD,CTE_FORMA_PAGO_OBRA); frViewConfiguracionCapitulo.Controller := TDetallesPresupuestoClienteController.Create; frViewConfiguracionCapitulo.Detalles := (frViewConfiguracionCapitulo.Controller as IDetallesPresupuestoClienteController).BuscarCapitulo(TIPO_CAPITULO_O); end; class function TfrViewConfiguracionDocObra.DarEtiqueta: String; begin Result := 'Documentos obra'; end; class function TfrViewConfiguracionDocObra.GetViewClass: TClass; begin Result := TfrViewConfiguracionDocOBRA; end; procedure TfrViewConfiguracionDocObra.GuardarValores; begin inherited; // AppFactuGES.Configuracion.SetSettingAsString(teBD, CTE_FORMA_PAGO_OBRA, eFormaPago.Text); AppFactuGES.Configuracion.SetSettingAsString(teBD, CTE_FORMA_PAGO_OBRA, AppFactuGES.EmpresaActiva.ID, cbFormaPago.EditValue); AppFactuGES.Configuracion.SetSettingAsString(teBD, CTE_PLAZOS_ENTREGA_OBRA, AppFactuGES.EmpresaActiva.ID, ePlazosEntrega.Text); AppFactuGES.Configuracion.SetSettingAsString(teBD, CTE_OBSERVACIONES_OBRA, AppFactuGES.EmpresaActiva.ID, eObservaciones.Text); AppFactuGES.Configuracion.SetSettingAsString(teBD, CTE_CONDICIONES_OBRA, AppFactuGES.EmpresaActiva.ID, eCondiciones.Text); frViewConfiguracionCapitulo.Detalles.DataTable.ApplyUpdates; end; end.