예제 #1
0
 protected void GuardarButton_Click(object sender, EventArgs e)
 {
     MsgErrorLabel.Text = String.Empty;
     CedWebEntidades.Cuenta cuenta = new CedWebEntidades.Cuenta();
     cuenta.Id = ((CedWebEntidades.Sesion)Session["Sesion"]).Cuenta.Id;
     cuenta.Nombre = NombreTextBox.Text;
     cuenta.Telefono = TelefonoTextBox.Text;
     cuenta.EmailSMS = EmailSMSTextBox.Text;
     cuenta.UltimoNroLote = Convert.ToInt64(UltimoNroLoteTextBox.Text);
     cuenta.PaginaDefault.Id = Convert.ToString(PaginaDefaultDropDownList.SelectedValue);
     try
     {
         CedWebRN.Cuenta.Configurar(cuenta, (CedEntidades.Sesion)Session["Sesion"]);
         GuardarButton.Visible = false;
         CancelarButton.Visible = false;
         NombreTextBox.Enabled = false;
         TelefonoTextBox.Enabled = false;
         EmailTextBox.Enabled = false;
         EmailSMSTextBox.Enabled = false;
         UltimoNroLoteTextBox.Enabled = false;
         PaginaDefaultDropDownList.Enabled = false;
         MsgErrorLabel.Text = "Se ha registrado la nueva configuración satisfactoriamente.";
     }
     catch (Exception ex)
     {
         string a = CedeiraUIWebForms.Excepciones.Detalle(ex);
         MsgErrorLabel.Text = a;
     }
 }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         CedWebEntidades.Cuenta cuenta = new CedWebEntidades.Cuenta();
         cuenta.Id = Session["CuentaPremiumActivar-Id"].ToString();
         CedWebRN.Cuenta.Leer(cuenta, (CedEntidades.Sesion)Session["Sesion"]);
         IdUsuarioTextBox.Text = cuenta.Id;
         NombreTextBox.Text = cuenta.Nombre;
         EmailTextBox.Text = cuenta.Email;
         FechaVtoPremiumDatePickerWebUserControl.Focus();
     }
 }
예제 #3
0
 protected void SolicitarPreguntaButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (IdUsuarioTextBox.Text == String.Empty)
         {
             MsgErrorLabel.Text = "Id.Usuario no informado.";
         }
         else
         {
             if (EmailTextBox.Text == String.Empty)
             {
                 MsgErrorLabel.Text = "Email no informado.";
             }
             else
             {
                 CedWebEntidades.Cuenta cuenta = new CedWebEntidades.Cuenta();
                 cuenta.Id = IdUsuarioTextBox.Text;
                 CedWebRN.Cuenta.Leer(cuenta, (CedEntidades.Sesion)Session["Sesion"]);
                 if (cuenta.Email.ToLower() != EmailTextBox.Text.ToLower())
                 {
                     MsgErrorLabel.Text = "No hay ninguna cuenta en la que el Id.Usuario y el Email ingresados estén relacionados.";
                 }
                 else
                 {
                     MsgErrorLabel.Text = "";
                     IdUsuarioTextBox.Enabled = false;
                     EmailTextBox.Enabled = false;
                     SolicitarPreguntaButton.Enabled = false;
                     PreguntaLabel.Text = "¿" + cuenta.Pregunta + "?";
                     ViewState["respuesta"] = cuenta.Respuesta;
                     RespuestaTextBox.Enabled = true;
                     SolicitarNuevaPasswordButton.Enabled = true;
                     RespuestaTextBox.Focus();
                 }
             }
         }
     }
     catch (System.Threading.ThreadAbortException)
     {
         Trace.Warn("Thread abortado");
     }
     catch (Microsoft.ApplicationBlocks.ExceptionManagement.Validaciones.ElementoInexistente)
     {
         MsgErrorLabel.Text = "No hay ninguna cuenta con el Id.Usuario solicitado.";
     }
     catch (Exception ex)
     {
         MsgErrorLabel.Text = CedeiraUIWebForms.Excepciones.Detalle(ex);
     }
 }
예제 #4
0
 protected void CrearCuentaButton_Click(object sender, EventArgs e)
 {
     MsgErrorLabel.Text = String.Empty;
     ResultadoComprobarDisponibilidadLabel.Text = String.Empty;
     CedWebEntidades.Cuenta cuenta = new CedWebEntidades.Cuenta();
     cuenta.Nombre = NombreTextBox.Text;
     cuenta.Telefono = TelefonoTextBox.Text;
     cuenta.Email = EmailTextBox.Text;
     cuenta.Id = IdUsuarioTextBox.Text;
     cuenta.Password = PasswordTextBox.Text;
     cuenta.ConfirmacionPassword = ConfirmacionPasswordTextBox.Text;
     cuenta.Pregunta = PreguntaTextBox.Text;
     cuenta.Respuesta = RespuestaTextBox.Text;
     cuenta.Medio.Id = MedioDropDownList.SelectedValue;
     cuenta.Medio.Descr = MedioDropDownList.SelectedItem.Text;
     try
     {
         CedWebRN.Cuenta.Validar(cuenta, Session["captcha"].ToString(), CaptchaTextBox.Text, (CedEntidades.Sesion)Session["Sesion"]);
         CedWebRN.Cuenta.Registrar(cuenta, (CedEntidades.Sesion)Session["Sesion"]);
         ComprobarDisponibilidadButton.Visible = false;
         NuevaClaveCaptchaButton.Visible = false;
         CrearCuentaButton.Visible = false;
         CancelarButton.Visible = false;
         CrearCuentaLabel.Visible = false;
         CaptchaImage.Visible = false;
         ClaveLabel.Visible = false;
         CaptchaTextBox.Visible = false;
         CaseSensitiveLabel.Visible = false;
         NombreTextBox.Enabled = false;
         TelefonoTextBox.Enabled = false;
         EmailTextBox.Enabled = false;
         IdUsuarioTextBox.Enabled = false;
         PasswordTextBox.Enabled = false;
         ConfirmacionPasswordTextBox.Enabled = false;
         PreguntaTextBox.Enabled = false;
         RespuestaTextBox.Enabled = false;
         MedioDropDownList.Enabled = false;
         MsgErrorLabel.Text = "Gracias por crear su cuenta eFact.  Siga las instrucciones, que se enviaron por email, para confirmar la creación de su cuenta.  La recepción del email puede demorar unos minutos.";
     }
     catch (Exception ex)
     {
         string a = CedeiraUIWebForms.Excepciones.Detalle(ex);
         MsgErrorLabel.Text = a;
     }
 }
예제 #5
0
 protected void GuardarButton_Click(object sender, EventArgs e)
 {
     MsgErrorLabel.Text = String.Empty;
     try
     {
         CedWebEntidades.Cuenta cuenta = new CedWebEntidades.Cuenta();
         cuenta.Id = IdUsuarioTextBox.Text;
         CedWebRN.Cuenta.Leer(cuenta, (CedEntidades.Sesion)Session["Sesion"]);
         CedWebRN.Cuenta.ActivarPremium(cuenta, new DateTime(FechaVtoPremiumDatePickerWebUserControl.CalendarDate.Year, FechaVtoPremiumDatePickerWebUserControl.CalendarDate.Month, FechaVtoPremiumDatePickerWebUserControl.CalendarDate.Day, 23, 59, 59), (CedEntidades.Sesion)Session["Sesion"]);
         FechaVtoPremiumDatePickerWebUserControl.ReadOnly = true;
         GuardarButton.Visible = false;
         CancelarButton.Text = "Continuar";
         MsgErrorLabel.Text = "Se ha registrado satisfactoriamente la activación de esta cuenta en el Servicio Premium";
         CancelarButton.Focus();
     }
     catch (Exception ex)
     {
         string a = CedeiraUIWebForms.Excepciones.Detalle(ex);
         MsgErrorLabel.Text = a;
     }
 }
예제 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         string a = HttpContext.Current.Request.Url.Query.ToString();
         if (a == String.Empty)
         {
             throw new Microsoft.ApplicationBlocks.ExceptionManagement.Cuenta.CuentaConfFormatoMsgErroneo();
         }
         else
         {
             if (a.Substring(0, 4) == "?Id=")
             {
                 a = a.Substring(4);
             }
             string idUsuario = a;
             CedWebEntidades.Cuenta cuenta = new CedWebEntidades.Cuenta();
             cuenta.Id = idUsuario;
             CedWebRN.Cuenta.Confirmar(cuenta, (CedWebEntidades.Sesion)Session["Sesion"]);
             MensajeLabel.Text = "Felicitaciones !!!.  Su nueva cuenta '" + cuenta.Id + "' ya está disponible.";
         }
     }
     catch (System.Security.Cryptography.CryptographicException)
     {
         MensajeLabel.Text = CedeiraUIWebForms.Excepciones.Detalle(new Microsoft.ApplicationBlocks.ExceptionManagement.Cuenta.CuentaConfFormatoMsgErroneo());
     }
     catch (System.FormatException)
     {
         MensajeLabel.Text = CedeiraUIWebForms.Excepciones.Detalle(new Microsoft.ApplicationBlocks.ExceptionManagement.Cuenta.CuentaConfFormatoMsgErroneo());
     }
     catch (Microsoft.ApplicationBlocks.ExceptionManagement.Validaciones.ElementoInexistente)
     {
         MensajeLabel.Text = CedeiraUIWebForms.Excepciones.Detalle(new Microsoft.ApplicationBlocks.ExceptionManagement.Cuenta.CuentaConfFormatoMsgErroneo());
     }
     catch (Exception ex)
     {
         MensajeLabel.Text = CedeiraUIWebForms.Excepciones.Detalle(ex);
     }
 }
예제 #7
0
		public List<CedWebEntidades.Cuenta> Lista(int IndicePagina, int TamañoPagina, string OrderBy)
		{
			System.Text.StringBuilder a = new StringBuilder();
			a.Append("select * ");
			a.Append("from (select top {0} ROW_NUMBER() OVER (ORDER BY {1}) as ROW_NUM, ");
			a.Append("Cuenta.IdCuenta, Cuenta.Nombre, Cuenta.NroSerieCertificado ");
			a.Append("from Cuenta ");
			a.Append("ORDER BY ROW_NUM) innerSelect WHERE ROW_NUM > {2} ");
			string commandText = string.Format(a.ToString(), ((IndicePagina + 1) * TamañoPagina), OrderBy, (IndicePagina * TamañoPagina));
			DataTable dt = new DataTable();
			dt = (DataTable)Ejecutar(commandText, TipoRetorno.TB, Transaccion.NoAcepta, sesion.CnnStr);
			List<CedWebEntidades.Cuenta> lista = new List<CedWebEntidades.Cuenta>();
			if (dt.Rows.Count != 0)
			{
				for (int i = 0; i < dt.Rows.Count; i++)
				{
					CedWebEntidades.Cuenta c = new CedWebEntidades.Cuenta();
					Copiar(dt.Rows[i], c);
					lista.Add(c);
				}
			}
			return lista;
		}
예제 #8
0
파일: Cuenta.cs 프로젝트: pjeconde/eFact
		public List<CedWebEntidades.Cuenta> Leer(string IdCuenta)
		{
			List<CedWebEntidades.Cuenta> ctas = new List<CedWebEntidades.Cuenta>();
			StringBuilder a = new StringBuilder(string.Empty);
            a.Append("select Cuenta.IdCuenta, Cuenta.Nombre, Cuenta.Telefono, Cuenta.Email, Cuenta.Password, Cuenta.Pregunta, Cuenta.Respuesta, Cuenta.IdTipoCuenta, TipoCuenta.DescrTipoCuenta, Cuenta.IdEstadoCuenta, EstadoCuenta.DescrEstadoCuenta, Cuenta.UltimoNroLote, Cuenta.FechaAlta, Cuenta.CantidadEnviosMail, Cuenta.FechaUltimoReenvioMail, Cuenta.IdMedio, Medio.DescrMedio, Cuenta.EmailSMS, Cuenta.RecibeAvisoAltaCuenta, Cuenta.CantidadComprobantes, Cuenta.FechaUltimoComprobante, Cuenta.FechaVtoPremium, Cuenta.IdPaginaDefault, PaginaDefault.DescrPaginaDefault, PaginaDefault.URL, Cuenta.NroSerieCertificado, Cuenta.CantidadActivacionesCPs ");
			a.Append("from Cuenta, TipoCuenta, EstadoCuenta, Medio, PaginaDefault ");
			a.Append(string.Format("where Cuenta.IdCuenta LIKE '%{0}%' and Cuenta.IdTipoCuenta=TipoCuenta.IdTipoCuenta and Cuenta.IdEstadoCuenta=EstadoCuenta.IdEstadoCuenta and Cuenta.IdMedio=Medio.IdMedio and Cuenta.IdPaginaDefault=PaginaDefault.IdPaginaDefault ",IdCuenta));
			DataTable dt = (DataTable)Ejecutar(a.ToString(), TipoRetorno.TB, Transaccion.NoAcepta, sesion.CnnStr);
			if (!dt.Rows.Count.Equals(0))
			{
				for (int i = 0; i < dt.Rows.Count; i++)
				{
					CedWebEntidades.Cuenta c = new CedWebEntidades.Cuenta();
					Copiar(dt.Rows[i], c);
					ctas.Add(c);
				}
			}
			else
			{
				ctas.Add(new CedWebEntidades.Cuenta());
			}
			return ctas;
		}
예제 #9
0
 protected void ComprobarDisponibilidadButton_Click(object sender, EventArgs e)
 {
     MsgErrorLabel.Text = String.Empty;
     CedWebEntidades.Cuenta cuenta = new CedWebEntidades.Cuenta();
     cuenta.Id = IdUsuarioTextBox.Text;
     try
     {
         bool disponible = CedWebRN.Cuenta.IdCuentaDisponible(cuenta, (CedEntidades.Sesion)Session["Sesion"]);
         if (disponible)
         {
             ResultadoComprobarDisponibilidadLabel.ForeColor = System.Drawing.Color.Green;
             ResultadoComprobarDisponibilidadLabel.Text = "OK";
         }
         else
         {
             ResultadoComprobarDisponibilidadLabel.ForeColor = System.Drawing.Color.Red;
             ResultadoComprobarDisponibilidadLabel.Text = "No disponible";
         }
     }
     catch (Microsoft.ApplicationBlocks.ExceptionManagement.Validaciones.ValorNoInfo)
     {
         ResultadoComprobarDisponibilidadLabel.ForeColor = MsgErrorLabel.ForeColor;
         ResultadoComprobarDisponibilidadLabel.Text = "IdUsuario no informado";
     }
     catch (Exception ex)
     {
         ResultadoComprobarDisponibilidadLabel.ForeColor = MsgErrorLabel.ForeColor;
         ResultadoComprobarDisponibilidadLabel.Text = "ver detalle al pie de página";
         MsgErrorLabel.Text = CedeiraUIWebForms.Excepciones.Detalle(ex);
     }
 }
 protected void CuentaPagingGridView_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         DeshabilitarAcciones();
         System.Collections.Generic.List<CedWebEntidades.Cuenta> lista = (System.Collections.Generic.List<CedWebEntidades.Cuenta>)ViewState["lista"];
         CedWebEntidades.Cuenta cuenta = new CedWebEntidades.Cuenta();
         cuenta = (CedWebEntidades.Cuenta)lista[((CedeiraUIWebForms.PagingGridView)sender).SelectedIndex];
         string auxCache = "Cuenta" + Session.SessionID;
         Cache.Remove(auxCache);
         Cache.Add(auxCache, cuenta, null, DateTime.UtcNow.AddSeconds(300), TimeSpan.Zero, System.Web.Caching.CacheItemPriority.NotRemovable, null);
         HabilitarAcciones(cuenta);
     }
     catch (System.Threading.ThreadAbortException)
     {
         Trace.Warn("Thread abortado");
     }
     catch (Exception ex)
     {
         CedeiraUIWebForms.Excepciones.Redireccionar(ex, "~/Excepcion.aspx");
     }
 }
예제 #11
0
파일: Cuenta.cs 프로젝트: pjeconde/eFact
 public List<CedWebEntidades.Cuenta> DestinatariosAvisoAltaCuenta()
 {
     StringBuilder a = new StringBuilder(string.Empty);
     a.Append("select Cuenta.IdCuenta, Cuenta.Nombre, Cuenta.Telefono, Cuenta.Email, Cuenta.Password, Cuenta.Pregunta, Cuenta.Respuesta, Cuenta.IdTipoCuenta, TipoCuenta.DescrTipoCuenta, Cuenta.IdEstadoCuenta, EstadoCuenta.DescrEstadoCuenta, Cuenta.UltimoNroLote, Cuenta.FechaAlta, Cuenta.CantidadEnviosMail, Cuenta.FechaUltimoReenvioMail, Cuenta.IdMedio, Medio.DescrMedio, Cuenta.EmailSMS, Cuenta.RecibeAvisoAltaCuenta, Cuenta.CantidadComprobantes, Cuenta.FechaUltimoComprobante, Cuenta.FechaVtoPremium, Cuenta.IdPaginaDefault, Cuenta.NroSerieCertificado, PaginaDefault.DescrPaginaDefault, PaginaDefault.URL, Cuenta.CantidadActivacionesCPs ");
     a.Append("from Cuenta, TipoCuenta, EstadoCuenta, Medio, PaginaDefault ");
     a.Append("where RecibeAvisoAltaCuenta=1 and EmailSMS<>'' ");
     a.Append("and Cuenta.IdTipoCuenta=TipoCuenta.IdTipoCuenta and Cuenta.IdEstadoCuenta=EstadoCuenta.IdEstadoCuenta and Cuenta.IdMedio=Medio.IdMedio and Cuenta.IdPaginaDefault=PaginaDefault.IdPaginaDefault ");
     DataTable dt = (DataTable)Ejecutar(a.ToString(), TipoRetorno.TB, Transaccion.NoAcepta, sesion.CnnStr);
     List<CedWebEntidades.Cuenta> lista = new List<CedWebEntidades.Cuenta>();
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         CedWebEntidades.Cuenta cuenta = new CedWebEntidades.Cuenta();
         Copiar(dt.Rows[i], cuenta);
         lista.Add(cuenta);
     }
     return lista;
 }
예제 #12
0
파일: Cuenta.cs 프로젝트: pjeconde/eFact
 public List<CedWebEntidades.Cuenta> DepurarYObtenerListaDePremiumSuspendidas()
 {
     StringBuilder a = new StringBuilder(string.Empty);
     //Depurar bajas
     a.Append("insert CompradorDepurado select * from Comprador where IdCuenta in (select IdCuenta from Cuenta where IdEstadoCuenta='Baja') ");
     a.Append("delete Comprador where IdCuenta in (select IdCuenta from Cuenta where IdEstadoCuenta='Baja') ");
     a.Append("insert PuntoDeVentaDepurado select * from PuntoDeVenta where CUIT in (select CUIT from Vendedor where IdCuenta in (select IdCuenta from Cuenta where IdEstadoCuenta='Baja')) ");
     a.Append("delete PuntoDeVenta where CUIT in (select CUIT from Vendedor where IdCuenta in (select IdCuenta from Cuenta where IdEstadoCuenta='Baja')) ");
     a.Append("insert VendedorDepurado select * from Vendedor where IdCuenta in (select IdCuenta from Cuenta where IdEstadoCuenta='Baja') ");
     a.Append("delete Vendedor where IdCuenta in (select IdCuenta from Cuenta where IdEstadoCuenta='Baja') ");
     a.Append("insert ActivCPDepurado select * from ActivCP where IdCuenta in (select IdCuenta from Cuenta where IdEstadoCuenta='Baja') ");
     a.Append("delete ActivCP where IdCuenta in (select IdCuenta from Cuenta where IdEstadoCuenta='Baja') ");
     a.Append("insert CuentaDepurada select * from Cuenta where IdEstadoCuenta='Baja' ");
     a.Append("delete Cuenta where IdEstadoCuenta='Baja' ");
     //Obtener lista de cuentas Premium suspendidas
     a.Append("select Cuenta.IdCuenta, Cuenta.Nombre, Cuenta.Telefono, Cuenta.Email, Cuenta.Password, Cuenta.Pregunta, Cuenta.Respuesta, Cuenta.IdTipoCuenta, TipoCuenta.DescrTipoCuenta, Cuenta.IdEstadoCuenta, EstadoCuenta.DescrEstadoCuenta, Cuenta.UltimoNroLote, Cuenta.FechaAlta, Cuenta.CantidadEnviosMail, Cuenta.FechaUltimoReenvioMail, Cuenta.IdMedio, Medio.DescrMedio, Cuenta.EmailSMS, Cuenta.RecibeAvisoAltaCuenta, Cuenta.CantidadComprobantes, Cuenta.FechaUltimoComprobante, Cuenta.FechaVtoPremium, Cuenta.IdPaginaDefault, Cuenta.NroSerieCertificado, PaginaDefault.DescrPaginaDefault, PaginaDefault.URL, Cuenta.CantidadActivacionesCPs ");
     a.Append("from Cuenta, TipoCuenta, EstadoCuenta, Medio, PaginaDefault ");
     a.Append("where Cuenta.FechaVtoPremium<getdate() and Cuenta.IdEstadoCuenta<>'Suspend' and Cuenta.IdTipoCuenta='Prem' ");
     a.Append("and Cuenta.IdTipoCuenta=TipoCuenta.IdTipoCuenta and Cuenta.IdEstadoCuenta=EstadoCuenta.IdEstadoCuenta and Cuenta.IdMedio=Medio.IdMedio and Cuenta.IdPaginaDefault=PaginaDefault.IdPaginaDefault ");
     //Suspender cuentas Premium
     a.Append("update Cuenta set ");
     a.Append("IdEstadoCuenta='Suspend' ");
     a.Append("where FechaVtoPremium<getdate() and IdEstadoCuenta<>'Suspend' and IdTipoCuenta='Prem' ");
     DataTable dt = (DataTable)Ejecutar(a.ToString(), TipoRetorno.TB, Transaccion.NoAcepta, sesion.CnnStr);
     List<CedWebEntidades.Cuenta> lista = new List<CedWebEntidades.Cuenta>();
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         CedWebEntidades.Cuenta cuenta = new CedWebEntidades.Cuenta();
         Copiar(dt.Rows[i], cuenta);
         lista.Add(cuenta);
     }
     return lista;
 }
예제 #13
0
파일: Cuenta.cs 프로젝트: pjeconde/eFact
 public List<CedWebEntidades.Cuenta> Lista(int IndicePagina, int TamañoPagina, string OrderBy)
 {
     System.Text.StringBuilder a = new StringBuilder();
     a.Append("select * ");
     a.Append("from (select top {0} ROW_NUMBER() OVER (ORDER BY {1}) as ROW_NUM, ");
     a.Append("Cuenta.IdCuenta, Cuenta.Nombre, Cuenta.Telefono, Cuenta.Email, Cuenta.Password, Cuenta.Pregunta, Cuenta.Respuesta, Cuenta.IdTipoCuenta, TipoCuenta.DescrTipoCuenta, Cuenta.IdEstadoCuenta, EstadoCuenta.DescrEstadoCuenta, Cuenta.UltimoNroLote, Cuenta.FechaAlta, Cuenta.CantidadEnviosMail, Cuenta.FechaUltimoReenvioMail, Cuenta.IdMedio, Medio.DescrMedio, Cuenta.EmailSMS, Cuenta.RecibeAvisoAltaCuenta, Cuenta.CantidadComprobantes, Cuenta.FechaUltimoComprobante, Cuenta.FechaVtoPremium, Cuenta.IdPaginaDefault, PaginaDefault.DescrPaginaDefault, PaginaDefault.URL, Cuenta.NroSerieCertificado, Cuenta.CantidadActivacionesCPs ");
     a.Append("from Cuenta, TipoCuenta, EstadoCuenta, Medio, PaginaDefault ");
     a.Append("where Cuenta.IdTipoCuenta=TipoCuenta.IdTipoCuenta and Cuenta.IdEstadoCuenta=EstadoCuenta.IdEstadoCuenta and Cuenta.IdMedio=Medio.IdMedio and Cuenta.IdPaginaDefault=PaginaDefault.IdPaginaDefault ");
     a.Append("ORDER BY ROW_NUM) innerSelect WHERE ROW_NUM > {2} ");
     string commandText = string.Format(a.ToString(), ((IndicePagina + 1) * TamañoPagina), OrderBy, (IndicePagina * TamañoPagina));
     DataTable dt = new DataTable();
     dt = (DataTable)Ejecutar(commandText, TipoRetorno.TB, Transaccion.NoAcepta, sesion.CnnStr);
     List<CedWebEntidades.Cuenta> lista = new List<CedWebEntidades.Cuenta>();
     if (dt.Rows.Count != 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             CedWebEntidades.Cuenta cuenta = new CedWebEntidades.Cuenta();
             Copiar(dt.Rows[i], cuenta);
             lista.Add(cuenta);
         }
     }
     return lista;
 }
예제 #14
0
파일: Cuenta.cs 프로젝트: pjeconde/eFact
 public List<CedWebEntidades.Cuenta> Lista(string Email)
 {
     StringBuilder a = new StringBuilder(string.Empty);
     a.Append("select Cuenta.IdCuenta, Cuenta.Nombre, Cuenta.Telefono, Cuenta.Email, Cuenta.Password, Cuenta.Pregunta, Cuenta.Respuesta, Cuenta.IdTipoCuenta, TipoCuenta.DescrTipoCuenta, Cuenta.IdEstadoCuenta, EstadoCuenta.DescrEstadoCuenta, Cuenta.UltimoNroLote, Cuenta.FechaAlta, Cuenta.CantidadEnviosMail, Cuenta.FechaUltimoReenvioMail, Cuenta.IdMedio, Medio.DescrMedio, Cuenta.EmailSMS, Cuenta.RecibeAvisoAltaCuenta, Cuenta.CantidadComprobantes, Cuenta.FechaUltimoComprobante, Cuenta.FechaVtoPremium, Cuenta.IdPaginaDefault, Cuenta.NroSerieCertificado, PaginaDefault.DescrPaginaDefault, PaginaDefault.URL, Cuenta.CantidadActivacionesCPs ");
     a.Append("from Cuenta, TipoCuenta, EstadoCuenta, Medio, PaginaDefault ");
     a.Append("where Cuenta.Email='" + Email + "' and Cuenta.IdTipoCuenta=TipoCuenta.IdTipoCuenta and Cuenta.IdEstadoCuenta=EstadoCuenta.IdEstadoCuenta and Cuenta.IdMedio=Medio.IdMedio and Cuenta.IdPaginaDefault=PaginaDefault.IdPaginaDefault ");
     DataTable dt = (DataTable)Ejecutar(a.ToString(), TipoRetorno.TB, Transaccion.NoAcepta, sesion.CnnStr);
     if (dt.Rows.Count == 0)
     {
         throw new Microsoft.ApplicationBlocks.ExceptionManagement.Cuenta.NoHayCuentasAsociadasAEmail();
     }
     else
     {
         List<CedWebEntidades.Cuenta> lista = new List<CedWebEntidades.Cuenta>();
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             CedWebEntidades.Cuenta cuenta = new CedWebEntidades.Cuenta();
             Copiar(dt.Rows[i], cuenta);
             lista.Add(cuenta);
         }
         return lista;
     }
 }
예제 #15
0
		protected void CuentaPagingGridView_SelectedIndexChanged(object sender, EventArgs e)
		{
			try
			{
				DeshabilitarAcciones();
				CedWebEntidades.Cuenta cuenta = new CedWebEntidades.Cuenta();
				System.Collections.Generic.List<CedWebEntidades.Cuenta> lista;
				if (ViewState["filtro"] != null && !ViewState["filtro"].Equals(string.Empty))
				{
					lista = (System.Collections.Generic.List<CedWebEntidades.Cuenta>)ViewState["lista"];
					CedWebEntidades.Cuenta[] ctaArray = lista.ToArray();
					CedeiraUIWebForms.PagingGridView pgv = (CedeiraUIWebForms.PagingGridView)sender;
					int indice = pgv.CurrentPageIndex * CuentaPagingGridView.PageSize + pgv.SelectedIndex;
					cuenta = ctaArray[indice];
				}
				else
				{
					lista = (System.Collections.Generic.List<CedWebEntidades.Cuenta>)ViewState["lista"];
					cuenta = (CedWebEntidades.Cuenta)lista[((CedeiraUIWebForms.PagingGridView)sender).SelectedIndex];				
				}
				
				string auxCache = "Cuenta" + Session.SessionID;
				Cache.Remove(auxCache);
				Cache.Add(auxCache, cuenta, null, DateTime.UtcNow.AddSeconds(300), TimeSpan.Zero, System.Web.Caching.CacheItemPriority.NotRemovable, null);
				HabilitarAcciones(cuenta);
			}
			catch (System.Threading.ThreadAbortException)
			{
				Trace.Warn("Thread abortado");
			}
			catch (Exception ex)
			{
				CedeiraUIWebForms.Excepciones.Redireccionar(ex, "~/Excepcion.aspx");
			}
		}
예제 #16
0
파일: Sesion.cs 프로젝트: pjeconde/eFact
 public Sesion()
 {
     cuenta = new CedWebEntidades.Cuenta();
     flag = new CedWebEntidades.Flag();
 }
예제 #17
0
 protected void AceptarButton_Click(object sender, EventArgs e)
 {
     try
     {
         MsgErrorLabel.Text = String.Empty;
         CedWebEntidades.Cuenta cuenta = new CedWebEntidades.Cuenta();
         cuenta.Id = IdUsuarioTextBox.Text;
         CedWebRN.Cuenta.Leer(cuenta, (CedEntidades.Sesion)Session["Sesion"]);
         cuenta.Password = PasswordNuevaTextBox.Text + "X";
         CedWebRN.Cuenta.CambiarPassword(cuenta, cuenta.Password, PasswordNuevaTextBox.Text, ConfirmacionPasswordNuevaTextBox.Text, (CedEntidades.Sesion)Session["Sesion"]);
         PasswordNuevaTextBox.Enabled = false;
         ConfirmacionPasswordNuevaTextBox.Enabled = false;
         AceptarButton.Visible = false;
         CancelarButton.Visible = false;
         MsgErrorLabel.Text = "La Contraseña fue registrada satisfactoriamente.  Para iniciar una sesión de trabajo, deberá identificarse en la página de inicio.";
     }
     catch (System.Threading.ThreadAbortException)
     {
         Trace.Warn("Thread abortado");
     }
     catch (Microsoft.ApplicationBlocks.ExceptionManagement.Login.PasswordNoMatch)
     {
         MsgErrorLabel.Text = "Contraseña actual incorrecta";
     }
     catch (Microsoft.ApplicationBlocks.ExceptionManagement.Cuenta.PasswordYConfirmacionNoCoincidente)
     {
         MsgErrorLabel.Text = "La Contraseña nueva no coincide con su Confirmación";
     }
     catch (Exception ex)
     {
         MsgErrorLabel.Text = CedeiraUIWebForms.Excepciones.Detalle(ex);
     }
 }