AbetoDesign_FactuGES2/Source/Modulos/Presupuestos de cliente/Views/uViewConfiguracionDocVarios.pas

103 lines
3.3 KiB
ObjectPascal

unit uViewConfiguracionDocVarios;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uViewConfiguracionBase, cxControls, cxContainer, cxEdit, cxTextEdit, cxMemo,
cxRichEdit, uViewBase, JvExControls, JvGradientHeaderPanel, StdCtrls, ExtCtrls,
uFormasPagoController, uBizFormasPago, cxGraphics, cxMaskEdit, cxDropDownEdit,
cxLookupEdit, cxDBLookupEdit, cxDBLookupComboBox, DB, uDAInterfaces,
uDADataTable;
type
TfrViewConfiguracionDocVarios = class(TfrViewConfiguracionBase)
eCondiciones: TcxRichEdit;
ePlazosEntrega: TMemo;
eObservaciones: TMemo;
Label2: TLabel;
Label4: TLabel;
Label5: TLabel;
bFormasPago: TButton;
dsFormaPago: TDADataSource;
cbFormaPago: TcxLookupComboBox;
procedure bFormasPagoClick(Sender: TObject);
protected
FFormasPago : IBizFormaPago;
FFormasPagoController : IFormasPagoController;
public
class function GetViewClass : TClass; override;
class function DarEtiqueta : String; override;
procedure CargarValores; override;
procedure GuardarValores; override;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;
var
frViewConfiguracionDocVarios: TfrViewConfiguracionDocVarios;
implementation
{$R *.dfm}
{ TfrViewConfiguracionDocVARIOS }
uses uFactuGES_App, uConfiguracionController, uPresupuestosClienteController;
procedure TfrViewConfiguracionDocVarios.bFormasPagoClick(Sender: TObject);
begin
inherited;
if Assigned(FFormasPago) then
FFormasPagoController.VerTodos(FFormasPago);
end;
procedure TfrViewConfiguracionDocVarios.CargarValores;
begin
inherited;
FFormasPago := FFormasPagoController.BuscarTodos;
dsFormaPago.DataTable := FFormasPago.DataTable;
dsFormaPago.DataTable.Active := True;
cbFormaPago.EditValue := AppFactuGES.Configuracion.GetSettingAsString(teBD,CTE_FORMA_PAGO_VARIOS);
ePlazosEntrega.Lines.Clear;
ePlazosEntrega.Text := AppFactuGES.Configuracion.GetSettingAsString(teBD,CTE_PLAZOS_ENTREGA_VARIOS);
eObservaciones.Lines.Clear;
eObservaciones.Text := AppFactuGES.Configuracion.GetSettingAsString(teBD,CTE_OBSERVACIONES_VARIOS);
eCondiciones.Lines.Clear;
eCondiciones.Text := AppFactuGES.Configuracion.GetSettingAsString(teBD,CTE_CONDICIONES_VARIOS);
end;
constructor TfrViewConfiguracionDocVarios.Create(AOwner: TComponent);
begin
inherited;
FFormasPagoController := TFormasPagoController.Create;
end;
class function TfrViewConfiguracionDocVarios.DarEtiqueta: String;
begin
Result := 'Documentos varios';
end;
destructor TfrViewConfiguracionDocVarios.Destroy;
begin
FFormasPago := Nil;
FFormasPagoController := NIL;
inherited;
end;
class function TfrViewConfiguracionDocVarios.GetViewClass: TClass;
begin
Result := TfrViewConfiguracionDocVARIOS;
end;
procedure TfrViewConfiguracionDocVarios.GuardarValores;
begin
inherited;
AppFactuGES.Configuracion.SetSettingAsString(teBD, CTE_FORMA_PAGO_VARIOS, cbFormaPago.EditValue);
AppFactuGES.Configuracion.SetSettingAsString(teBD, CTE_PLAZOS_ENTREGA_VARIOS, ePlazosEntrega.Text);
AppFactuGES.Configuracion.SetSettingAsString(teBD, CTE_OBSERVACIONES_VARIOS, eObservaciones.Text);
AppFactuGES.Configuracion.SetSettingAsString(teBD, CTE_CONDICIONES_VARIOS, eCondiciones.Text);
end;
end.