unit uEditorColores;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, dxLayoutControl, cxControls, DB, uDAInterfaces, uDADataTable,
  cxContainer, cxEdit, cxTextEdit, cxDBEdit, StdCtrls, cxMemo, cxGraphics,
  cxLookAndFeels, cxLookAndFeelPainters, dxLayoutcxEditAdapters;

type
  TfrEditorColores = class(TForm)
    dxLayoutControl1Group_Root: TdxLayoutGroup;
    dxLayoutControl1: TdxLayoutControl;
    dxLayoutControl1Item1: TdxLayoutItem;
    eColor1: TcxDBTextEdit;
    dsDataTable: TDADataSource;
    dxLayoutControl1Group1: TdxLayoutGroup;
    dxLayoutControl1Item2: TdxLayoutItem;
    eColor2: TcxDBTextEdit;
    dxLayoutControl1Item3: TdxLayoutItem;
    eColor3: TcxDBTextEdit;
    dxLayoutControl1Item4: TdxLayoutItem;
    eColor4: TcxDBTextEdit;
    dxLayoutControl1Item5: TdxLayoutItem;
    eColor5: TcxDBTextEdit;
    dxLayoutControl1Item6: TdxLayoutItem;
    eColor6: TcxDBTextEdit;
    dxLayoutControl1Item7: TdxLayoutItem;
    eColor7: TcxDBTextEdit;
    dxLayoutControl1Item8: TdxLayoutItem;
    eColor8: TcxDBTextEdit;
    dxLayoutControl1Item9: TdxLayoutItem;
    eColor9: TcxDBTextEdit;
    dxLayoutControl1Item10: TdxLayoutItem;
    eColor10: TcxDBTextEdit;
    dxLayoutControl1Item11: TdxLayoutItem;
    eColor11: TcxDBTextEdit;
    dxLayoutControl1Item12: TdxLayoutItem;
    eColor12: TcxDBTextEdit;
    bAceptar: TButton;
    dxLayoutControl1Item13: TdxLayoutItem;
    bCancelar: TButton;
    dxLayoutControl1Item14: TdxLayoutItem;
    dxLayoutControl1Group2: TdxLayoutGroup;
    dxLayoutControl1Item15: TdxLayoutItem;
    edtDescripcion: TcxMemo;
  private
    { Private declarations }
  public
    function GetTotal: Double; 
  end;

var
  frEditorColores: TfrEditorColores;

implementation

{$R *.dfm}

{ TfrEditorColores }

function TfrEditorColores.GetTotal: Double;
var
  Total: Double;
begin
  Total := 0;
  if not VarIsNull(eColor1.EditValue) then
     Total := Total + eColor1.EditValue;

  if not VarIsNull(eColor2.EditValue) then
     Total := Total + eColor2.EditValue;

  if not VarIsNull(eColor3.EditValue) then
     Total := Total + eColor3.EditValue;

  if not VarIsNull(eColor4.EditValue) then
     Total := Total + eColor4.EditValue;

  if not VarIsNull(eColor5.EditValue) then
     Total := Total + eColor5.EditValue;

  if not VarIsNull(eColor6.EditValue) then
     Total := Total + eColor6.EditValue;

  if not VarIsNull(eColor7.EditValue) then
     Total := Total + eColor7.EditValue;

  if not VarIsNull(eColor8.EditValue) then
     Total := Total + eColor8.EditValue;

  if not VarIsNull(eColor9.EditValue) then
     Total := Total + eColor9.EditValue;

  if not VarIsNull(eColor10.EditValue) then
     Total := Total + eColor10.EditValue;

  if not VarIsNull(eColor11.EditValue) then
     Total := Total + eColor11.EditValue;

  if not VarIsNull(eColor12.EditValue) then
     Total := Total + eColor12.EditValue;

  Result := Total;
end;

end.
