Subida de envio por e-mail (sin terminar todos los documentos).
git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@317 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
parent
223a67bed2
commit
2d3891452c
108
Source/GUIBase/uDialogElegirEMail.dfm
Normal file
108
Source/GUIBase/uDialogElegirEMail.dfm
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
inherited fDialogElegirEMail: TfDialogElegirEMail
|
||||||
|
Caption = 'Elegir direcci'#243'n de correo electr'#243'nico'
|
||||||
|
ClientHeight = 220
|
||||||
|
ClientWidth = 533
|
||||||
|
OnCloseQuery = FormCloseQuery
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
ExplicitWidth = 539
|
||||||
|
ExplicitHeight = 252
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 13
|
||||||
|
inherited pnlBotones: TFlowPanel
|
||||||
|
Top = 164
|
||||||
|
Width = 533
|
||||||
|
ExplicitTop = 164
|
||||||
|
ExplicitWidth = 533
|
||||||
|
inherited Button1: TButton
|
||||||
|
Left = 437
|
||||||
|
ExplicitLeft = 437
|
||||||
|
end
|
||||||
|
inherited Button2: TButton
|
||||||
|
Left = 347
|
||||||
|
ExplicitLeft = 347
|
||||||
|
end
|
||||||
|
end
|
||||||
|
inherited FlowPanel1: TFlowPanel
|
||||||
|
Width = 533
|
||||||
|
Height = 164
|
||||||
|
ExplicitWidth = 533
|
||||||
|
ExplicitHeight = 164
|
||||||
|
inherited lblInstruccion: TLabel
|
||||||
|
Width = 411
|
||||||
|
Caption = 'Indique la direcci'#243'n de correo electr'#243'nico del destinatario:'
|
||||||
|
ExplicitWidth = 411
|
||||||
|
end
|
||||||
|
inherited Label2: TLabel
|
||||||
|
Height = 3
|
||||||
|
Visible = False
|
||||||
|
ExplicitHeight = 3
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 31
|
||||||
|
Top = 73
|
||||||
|
Width = 482
|
||||||
|
Height = 80
|
||||||
|
Align = alClient
|
||||||
|
BevelOuter = bvNone
|
||||||
|
ParentColor = True
|
||||||
|
TabOrder = 0
|
||||||
|
object rbCombo: TRadioButton
|
||||||
|
Tag = 1
|
||||||
|
Left = 10
|
||||||
|
Top = 6
|
||||||
|
Width = 170
|
||||||
|
Height = 17
|
||||||
|
Caption = 'Usar esta direcci'#243'n de correo:'
|
||||||
|
TabOrder = 0
|
||||||
|
OnClick = rbComboClick
|
||||||
|
end
|
||||||
|
object cbEMail: TComboBox
|
||||||
|
Left = 211
|
||||||
|
Top = 6
|
||||||
|
Width = 262
|
||||||
|
Height = 21
|
||||||
|
Style = csDropDownList
|
||||||
|
ItemHeight = 0
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object rbEdit: TRadioButton
|
||||||
|
Tag = 2
|
||||||
|
Left = 10
|
||||||
|
Top = 41
|
||||||
|
Width = 202
|
||||||
|
Height = 17
|
||||||
|
Caption = 'Usar la siguiente direcci'#243'n de correo:'
|
||||||
|
TabOrder = 2
|
||||||
|
OnClick = rbEditClick
|
||||||
|
end
|
||||||
|
object edtEMail: TcxHyperLinkEdit
|
||||||
|
Left = 211
|
||||||
|
Top = 39
|
||||||
|
Properties.UsePrefix = upNever
|
||||||
|
Properties.ValidateOnEnter = True
|
||||||
|
Properties.Prefix = ''
|
||||||
|
Style.LookAndFeel.Kind = lfStandard
|
||||||
|
Style.LookAndFeel.NativeStyle = True
|
||||||
|
StyleDisabled.LookAndFeel.Kind = lfStandard
|
||||||
|
StyleDisabled.LookAndFeel.NativeStyle = True
|
||||||
|
StyleFocused.LookAndFeel.Kind = lfStandard
|
||||||
|
StyleFocused.LookAndFeel.NativeStyle = True
|
||||||
|
StyleHot.LookAndFeel.Kind = lfStandard
|
||||||
|
StyleHot.LookAndFeel.NativeStyle = True
|
||||||
|
TabOrder = 3
|
||||||
|
Width = 262
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
inherited ActionList1: TActionList
|
||||||
|
Left = 8
|
||||||
|
Top = 8
|
||||||
|
inherited actAceptar: TAction
|
||||||
|
OnExecute = actAceptarExecute
|
||||||
|
end
|
||||||
|
inherited actCancelar: TAction
|
||||||
|
OnExecute = actCancelarExecute
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
171
Source/GUIBase/uDialogElegirEMail.pas
Normal file
171
Source/GUIBase/uDialogElegirEMail.pas
Normal file
@ -0,0 +1,171 @@
|
|||||||
|
unit uDialogElegirEMail;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, uDialogBase, ActnList, StdCtrls, ExtCtrls, cxControls, cxContainer,
|
||||||
|
cxEdit, cxTextEdit, cxHyperLinkEdit;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfDialogElegirEMail = class(TfDialogBase)
|
||||||
|
Panel1: TPanel;
|
||||||
|
rbCombo: TRadioButton;
|
||||||
|
cbEMail: TComboBox;
|
||||||
|
rbEdit: TRadioButton;
|
||||||
|
edtEMail: TcxHyperLinkEdit;
|
||||||
|
procedure rbComboClick(Sender: TObject);
|
||||||
|
procedure rbEditClick(Sender: TObject);
|
||||||
|
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure actAceptarExecute(Sender: TObject);
|
||||||
|
procedure actCancelarExecute(Sender: TObject);
|
||||||
|
private
|
||||||
|
FListaDirecciones: TStringList;
|
||||||
|
function GetEMailElegido: String;
|
||||||
|
procedure ActualizarOpciones;
|
||||||
|
public
|
||||||
|
property EMailElegido: String read GetEMailElegido;
|
||||||
|
property ListaDirecciones : TStringList read FListaDirecciones write FListaDirecciones;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function ElegirEMail(const AListaEMails : TStringList; var AEMailElegido : String): Boolean;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
uses
|
||||||
|
uStringsUtils, uDialogUtils, uEMailUtils;
|
||||||
|
|
||||||
|
function ElegirEMail(const AListaEMails : TStringList; var AEMailElegido : String): Boolean;
|
||||||
|
var
|
||||||
|
AEditor : TfDialogElegirEMail;
|
||||||
|
begin
|
||||||
|
AEditor := TfDialogElegirEMail.Create(NIL);
|
||||||
|
try
|
||||||
|
AEditor.ListaDirecciones := AListaEMails;
|
||||||
|
Result := (AEditor.ShowModal = mrOk);
|
||||||
|
if Result then
|
||||||
|
AEMailElegido := AEditor.EMailElegido;
|
||||||
|
finally
|
||||||
|
AEditor.Release;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ TfDialogElegirEMail }
|
||||||
|
|
||||||
|
procedure TfDialogElegirEMail.actAceptarExecute(Sender: TObject);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
ModalResult := mrOk
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfDialogElegirEMail.actCancelarExecute(Sender: TObject);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
ModalResult := mrCancel;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfDialogElegirEMail.ActualizarOpciones;
|
||||||
|
begin
|
||||||
|
if rbEdit.Checked then
|
||||||
|
begin
|
||||||
|
edtEMail.Enabled := True;
|
||||||
|
rbCombo.Checked := False;
|
||||||
|
cbEMail.Enabled := False;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
if rbCombo.Enabled then
|
||||||
|
begin
|
||||||
|
cbEMail.Enabled := True;
|
||||||
|
edtEMail.Enabled := False;
|
||||||
|
rbEdit.Checked := False;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
rbEdit.Checked := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfDialogElegirEMail.FormCloseQuery(Sender: TObject;
|
||||||
|
var CanClose: Boolean);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
|
||||||
|
if (ModalResult = mrOk) and rbEdit.Checked then
|
||||||
|
begin
|
||||||
|
if not EsCadenaVacia(edtEMail.Text) then
|
||||||
|
begin
|
||||||
|
if not IsValidEmail(edtEMail.Text) then
|
||||||
|
begin
|
||||||
|
ShowErrorMessage('La dirección de correo electrónica no es válida', 'Para poder continuar, compruebe que ha indicado una dirección de correo y que está bien escrita.');
|
||||||
|
edtEMail.SetFocus;
|
||||||
|
CanClose := False;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
ShowErrorMessage('Debe indicar una dirección de correo electrónico.', 'Para poder continuar debe elegir o indicar una dirección de correo electrónico.');
|
||||||
|
edtEMail.SetFocus;
|
||||||
|
CanClose := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfDialogElegirEMail.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
//FListaDirecciones := TStringList.Create; <- La lista se da mediante la propiedad.
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfDialogElegirEMail.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
//FreeAndNIL(FListaDirecciones) <- La lista se da mediante la propiedad.
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfDialogElegirEMail.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
cbEMail.Items.Clear;
|
||||||
|
cbEMail.Items := FListaDirecciones;
|
||||||
|
|
||||||
|
if cbEMail.Items.Count = 0 then
|
||||||
|
begin
|
||||||
|
rbCombo.Enabled := False;
|
||||||
|
rbEdit.Checked;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
cbEMail.ItemIndex := 0;
|
||||||
|
rbCombo.Checked := True;
|
||||||
|
end;
|
||||||
|
|
||||||
|
ActualizarOpciones;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfDialogElegirEMail.GetEMailElegido: String;
|
||||||
|
begin
|
||||||
|
if rbCombo.Checked then
|
||||||
|
Result := cbEMail.Text
|
||||||
|
else
|
||||||
|
Result := edtEMail.Text;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfDialogElegirEMail.rbComboClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
rbEdit.Checked := False;
|
||||||
|
ActualizarOpciones;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfDialogElegirEMail.rbEditClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
rbEdit.Checked := True;
|
||||||
|
ActualizarOpciones;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
Loading…
Reference in New Issue
Block a user