5 using System.Collections.Generic;
6 using System.ComponentModel;
10 using System.Reflection.Emit;
12 using System.Windows.Forms;
22 #region PROPIEDADES PRIVADAS 29 get {
return (_lModoAsistente ? ((
FormAsistentePortal)this.FindForm())._PortalCli : null); }
32 #endregion PROPIEDADES PRIVADAS 35 #region PROPIEDADES PUBLICAS 40 public bool _ModoRestablecer
42 get {
return _lModoRestablecer; }
43 set { _lModoRestablecer = value; }
45 private bool _lModoRestablecer =
false;
50 public bool _ModoAsistente
52 get {
return _lModoAsistente; }
53 set { _lModoAsistente = value; }
55 private bool _lModoAsistente =
false;
60 public string _LabelUsuario
64 lblUsuarioPortal.Text = value;
72 public string _LabelPassword
76 lblPasswordUsuarioPortal.Text = value;
84 public string _UsuarioPortal
86 get {
return txtUsuarioPortal.Text.Trim(); }
92 public string _PasswordUsuarioPortal
94 get {
return txtPasswordUsuarioPortal.Text.Trim(); }
97 #endregion PROPIEDADES PUBLICAS 107 InitializeComponent();
116 private void Constructor()
118 txtPasswordUsuarioPortal.PasswordChar =
'●';
119 SuscripcionEventos();
122 #endregion CONSTRUCTOR 125 #region METODOS PUBLICOS 131 public void _Load(
string tcUsuarioSage50=
"")
135 if (
string.IsNullOrWhiteSpace(tcUsuarioSage50))
136 tcUsuarioSage50 = PORTALCLI.
_Usuario.Trim();
139 _oPortalCli._CfgUser._Load(tcUsuarioSage50);
141 loCfgUser =
new CfgUser(tcUsuarioSage50);
144 txtUsuarioPortal.Text = (_lModoAsistente ? _oPortalCli._CfgUser._UsuarioPortal.Trim() : loCfgUser.
_UsuarioPortal.Trim());
145 txtPasswordUsuarioPortal.Text = (!
string.IsNullOrWhiteSpace(txtUsuarioPortal.Text) && !_lModoRestablecer ?
"XXXXXXXX" :
"");
155 txtUsuarioPortal.ReadOnly = tlReadOnly || _lModoRestablecer;
156 txtPasswordUsuarioPortal.ReadOnly = tlReadOnly;
165 if (
string.IsNullOrWhiteSpace(_UsuarioPortal) ||
string.IsNullOrWhiteSpace(_PasswordUsuarioPortal))
167 FUNCTIONS._MessageBox(
"Para poder seguir con el asistente debe indicar el Usuario del portal del cliente y/o contraseña.",
"Asistente de configuración", MessageBoxButtons.OK, MessageBoxIcon.Information);
174 #endregion METODOS PUBLICOS 177 #region METODOS PRIVADOS 182 private void SuscripcionEventos()
184 if (!_lModoRestablecer)
186 txtUsuarioPortal.GotFocus += TxtUsuarioPortal_GotFocus;
187 txtUsuarioPortal.LostFocus += TxtUsuarioPortal_LostFocus;
194 private void CancelarSuscripcionEventos()
196 if (!_lModoRestablecer)
198 txtUsuarioPortal.GotFocus -= TxtUsuarioPortal_GotFocus;
199 txtUsuarioPortal.LostFocus -= TxtUsuarioPortal_LostFocus;
206 private void RevisarVisual()
208 int lnWidthMax = Math.Max(lblUsuarioPortal.Width, lblPasswordUsuarioPortal.Width);
209 int lnLeft = lblUsuarioPortal.Left + lnWidthMax + 20;
211 txtUsuarioPortal.Left = lnLeft;
212 txtPasswordUsuarioPortal.Left = lnLeft;
220 private void TxtUsuarioPortal_GotFocus(
object sender, EventArgs e)
222 txtUsuarioPortal.Tag = txtUsuarioPortal.Text;
230 private void TxtUsuarioPortal_LostFocus(
object sender, EventArgs e)
232 if (!_lModoAsistente)
235 if (txtUsuarioPortal.ReadOnly || (Convert.ToString(txtUsuarioPortal.Tag).Trim() == txtUsuarioPortal.Text.Trim()))
239 if (!
string.IsNullOrWhiteSpace(txtUsuarioPortal.Text) && _oPortalCli._CfgUser._UsuarioPortalUsado(txtUsuarioPortal.Text))
241 FUNCTIONS._MessageBox(
"El nombre de usuario del portal del cliente que has introducido ya está asignado a otro usuario de Sage 50, introduce otro nombre de usuario o contacta con tu despacho para que te proporcione unas credenciales nuevas para el usuario de Sage 50.",
"Asistente de configuración", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
242 txtUsuarioPortal.Text =
"";
243 txtUsuarioPortal.Focus();
247 #endregion METODOS PRIVADOS Este es el espacio de nombres de su módulo. Puede encontrar más información y ayuda en el fichero rea...
void _Load(string tcUsuarioSage50="")
Load
UserUsuarioPortal()
Constructor
void _ReadOnly(bool tlReadOnly)
Estado readonly de los objetos
string _UsuarioPortal
Usuario portal
Clase principal de configuraciones para el Add-on del Portal del Cliente Contendrá instancias a las c...
bool _Valid()
Validaciones
Usercontrol con el usuario y password para el acceso al Portal del cliente