private void Login_Contacto() { eContacto oContacto = lExtranet.Contacto_login(txtEmail.Text); if (oContacto != null) { eCliente oCliente = lExtranet.Cliente_item(oContacto.codigoCliente); eDisclaimer oDisclaimer = lExtranet.Disclaimer_item(oContacto.codigoCliente, oContacto.codigoContacto); oContacto.aceptoTerminos = (oDisclaimer != null && oDisclaimer.confirmado); RegistrarLog.Login(oContacto); Session["oCliente"] = oCliente; Session["oContacto"] = oContacto; //Validar Disclaimer if (!oContacto.aceptoTerminos) { Response.Redirect("Disclaimer.aspx"); } else { Response.Redirect("~/Index.aspx"); } } }
private void FillHomePage() { LoadMetaTags(oSeccionWeb.MetaTag); WebContentUC ucPagina = (WebContentUC)Page.LoadControl("~/uc/panel_home.ascx");; plhContent.Controls.Add(ucPagina); LoadUserControl(ucPagina, IdIdioma); RegistrarLog.VerSeccion(oContacto, oSeccionWeb); }
protected void lbtGuardar_Click(object sender, EventArgs e) { eServicioCAT _oServicioCAT = new eServicioCAT(); _oServicioCAT.servicio = servicio; _oServicioCAT.codigoCliente = oContacto.codigoCliente; _oServicioCAT.codigoContacto = oContacto.codigoContacto; _oServicioCAT.usuarioCAT = txtUsuario.Text; try { string usuario = oContacto.email.Trim(); if (HttpServices.ServicioCAT_Exists(servicio, usuario)) { //Modificar credenciales para un usuario: HttpServices.ServicioCAT_EditResource(servicio, usuario, _oServicioCAT.usuarioCAT, txtClave.Text); } else { //Crear credenciales para un usuario: HttpServices.ServicioCAT_AddResource(servicio, usuario, _oServicioCAT.usuarioCAT, txtClave.Text); } } catch (Exception ex) { lblError.Text = "Ocurrió un error: " + ex.Message; return; } bool success = false; if (lExtranet.ServicioCAT_item(servicio, oContacto.codigoCliente, oContacto.codigoContacto) == null) { success = lExtranet.ServicioCAT_add(_oServicioCAT); } else { success = lExtranet.ServicioCAT_edit(_oServicioCAT); } if (!success) { lblError.Text = lExtranet.getErrorMessage(); return; } RegistrarLog.RegistroUsuarioCAT(oContacto, _oServicioCAT); Response.Redirect(lnkOmitir.NavigateUrl); }
protected void Page_Load(object sender, EventArgs e) { string urlLogoff = ConfigurationManager.AppSettings["UrlLogoff"].ToString(); if (oContacto != null) { RegistrarLog.Logoff(oContacto); Session["oCliente"] = null; Session["oContacto"] = null; Session["UsuarioGrupos"] = null; } Response.Cookies["saludo_ferreynet"].Expires = DateTime.Now.AddDays(-1); Response.Redirect(urlLogoff != "" ? urlLogoff : "Index.aspx"); }
protected void lbtSearchAdv_Click(object sender, EventArgs e) { try { txtNroComprobante.Text = ""; //Reset for changed TAB ServicioEX.FiltrosDocumentoSunat filtros = WSEX.NewFiltrosDocumentoSunat(); ServicioEX.Orden[] OrdenarPor = new ServicioEX.Orden[1]; filtros.Corporacion = 1; filtros.Compania = 2; filtros.ClienteNroDocumento = oCliente.ruc; if (!drpTipoComprobante.SelectedValue.Equals(string.Empty)) { filtros.GrupoDocumentos = drpTipoComprobante.SelectedValue; filtros.SunatTipoDoc = new string[] { drpTipoComprobante.SelectedValue }; } if (!drpTipoServicio.SelectedValue.Equals(string.Empty)) { filtros.CodigoGrupoSistema = new string[] { drpTipoServicio.SelectedValue }; } if (!txtFechaIni.Text.Equals(string.Empty)) { filtros.FechaEmisionInicial = Int32.Parse((Convert.ToDateTime(txtFechaIni.Text)).ToString("yyyyMMdd")); } if (!txtFechaFin.Text.Equals(string.Empty)) { filtros.FechaEmisionFinal = Int32.Parse((Convert.ToDateTime(txtFechaFin.Text)).ToString("yyyyMMdd")); } filtros.EstadosSUNAT = new string[] { "1" }; ServicioEX.Orden orden = new ServicioEX.Orden(); orden.Campo = "COMPROBANTE_FECHA"; orden.Secuencia = rbtOrdenarAsc.Checked ? "ASC" : "DESC"; OrdenarPor[0] = orden; BindResultados(filtros, OrdenarPor); RegistrarLog.BusquedaDocumento(oContacto, "TipoComprobante=" + drpTipoComprobante.SelectedValue + ", TipoServicio=" + drpTipoServicio.SelectedValue + ", Rango=" + txtFechaIni.Text + " : " + txtFechaFin.Text); } catch (Exception ex) { Trace.Warn("WS Facturacion Error", ex.Message); lblError.Text = "Lo sentimos, el servicio no esta disponible en este momento.<br />" + ex.Message; } }
private void FillSeccion() { if (!validarPermisoContacto(oSeccionWeb.IdMenuWeb, 0)) { Response.Redirect("~/Error.aspx?errID=401"); Response.End(); } LoadMetaTags(oSeccionWeb.MetaTag); WebContentUC ucPagina = (WebContentUC)Page.LoadControl("~/uc/panel_seccion.ascx"); plhContent.Controls.Add(ucPagina); LoadUserControl(ucPagina, oSeccionWeb); RegistrarLog.VerSeccion(oContacto, oSeccionWeb); }
protected void lbtSearch_Click(object sender, EventArgs e) { try { ServicioEX.FiltrosDocumentoSunat filtros = WSEX.NewFiltrosDocumentoSunat(); ServicioEX.Orden[] OrdenarPor = new ServicioEX.Orden[] { }; if (txtNroComprobante.Text.Length < 5) { lblError.Text = "(*) Formato de Documento Inválido"; return; } filtros.Corporacion = 1; filtros.Compania = 2; filtros.GrupoDocumentos = string.Empty; //FA, BO ??? filtros.ClienteNroDocumento = oCliente.ruc; switch (drpTipoDocumento.SelectedValue) { case "SUNAT": filtros.Sunpre = txtNroComprobante.Text.Substring(1, 3); filtros.SunatTipoDoc = new string[] { get_SunatTipoDoc(txtNroComprobante.Text.Substring(0, 1)) }; filtros.CorrelativoDesde = txtNroComprobante.Text.Substring(5); break; case "OC": filtros.NumeroReferencia = txtNroComprobante.Text; break; } //ServicioEX.Orden orden = WSEX.NewOrden(); //orden.Campo = "COMPROBANTE_TIPO"; //orden.Secuencia = "ASC"; //OrdenarPor.Add(orden); BindResultados(filtros, OrdenarPor); RegistrarLog.BusquedaDocumento(oContacto, "TipoDocumento=" + drpTipoDocumento.SelectedValue + ", NroComprobante=" + txtNroComprobante.Text); } catch (Exception ex) { Trace.Warn("WS Facturacion Error", ex.Message); lblError.Text = "Lo sentimos, el servicio no esta disponible en este momento.<br />" + ex.Message; } }
protected void lnkAceptar_Click(object sender, EventArgs e) { eDisclaimer oDisclaimer = new eDisclaimer(); oDisclaimer.codigoCliente = oContacto.codigoCliente; oDisclaimer.codigoContacto = oContacto.codigoContacto; oDisclaimer.confirmado = true; oDisclaimer.fechaRegistro = DateTime.Now; if (lExtranet.Disclaimer_add(oDisclaimer)) { RegistrarLog.AceptoTerminos(oContacto); oContacto.aceptoTerminos = true; Session["oContacto"] = oContacto; Response.Redirect("Index.aspx"); } }
protected void lbtSubmit_Click(object sender, EventArgs e) { try { cptCaptcha.ValidateCaptcha(txtCaptcha.Text); if (!cptCaptcha.UserValidated) { return; } } catch { return; } eServicioCAT _oServicioCAT = new eServicioCAT(); _oServicioCAT.servicio = servicio; _oServicioCAT.codigoCliente = oContacto.codigoCliente; _oServicioCAT.codigoContacto = oContacto.codigoContacto; _oServicioCAT.usuarioCAT = txtUsuario.Text; try { string usuario = oContacto.email.Trim(); if (HttpServices.ServicioCAT_Exists(servicio, usuario)) { //Modificar credenciales para un usuario: HttpServices.ServicioCAT_EditResource(servicio, usuario, _oServicioCAT.usuarioCAT, txtClave.Text); } else { //Crear credenciales para un usuario: HttpServices.ServicioCAT_AddResource(servicio, usuario, _oServicioCAT.usuarioCAT, txtClave.Text); } } catch (Exception ex) { ShowError("Ocurrió un error: " + ex.Message); return; } bool success = false; if (oServicioCAT == null) { success = lExtranet.ServicioCAT_add(_oServicioCAT); } else { success = lExtranet.ServicioCAT_edit(_oServicioCAT); } if (!success) { ShowError(lExtranet.getErrorMessage()); return; } RegistrarLog.RegistroUsuarioCAT(oContacto, _oServicioCAT); mvwVendedores.ActiveViewIndex = 2; }