protected void Page_Load(object sender, EventArgs e) { if (Session["lgn_id"] == null) { Session.Clear(); string myScript = ConfigurationManager.AppSettings["URL_LOGIN"]; String lsScript = "parent.document.location.href = '" + myScript + "/default.aspx?acc=SES';"; Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", lsScript, true); } else { if (!IsPostBack) { string json = new System.IO.StreamReader(Request.InputStream).ReadToEnd(); Dictionary <string, string> dataJSON = JsonConvert.DeserializeObject <Dictionary <string, string> >(json); String codigo = "0"; if (dataJSON != null) { myModalLabel.InnerText = "Cambiar Etapa"; codigo = dataJSON["codigo"].ToString(); OportunidadBean lOport = OportunidadController.GetOportunidad( new OportunidadBean { IdOportunidad = codigo }); MtxtCliente.Value = lOport.Cliente; MtxtCodigo.Value = lOport.Codigo; MtxtEtapa.Value = lOport.Etapa; MtxtIdEtapaActual.Value = lOport.IdEtapaActual; MtxtIdEtapaSiguiente.Value = lOport.idEtapaSiguiente; MtxtIdOportunidad.Value = lOport.Codigo; MtxtResponsable.Value = lOport.ResponsableNombre; hddIdUsuario.Value = HttpContext.Current.Session["lgn_id"].ToString(); MtxtFechaInicio.Value = lOport.FechaInicio; MtxtFechaFin.Value = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"); lblCambiarEtapa.InnerText = "Cambiar Etapa: " + lOport.EtapaSiguiente; } else { } hdTamFoto.Value = ConfigurationManager.AppSettings["TAM_MAX_FOTO"].Trim(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["lgn_id"] == null) { Session.Clear(); string myScript = ConfigurationManager.AppSettings["URL_LOGIN"]; String lsScript = "parent.document.location.href = '" + myScript + "/default.aspx?acc=SES';"; Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", lsScript, true); } else { if (!IsPostBack) { string json = new System.IO.StreamReader(Request.InputStream).ReadToEnd(); Dictionary <string, string> dataJSON = JsonConvert.DeserializeObject <Dictionary <string, string> >(json); String codigo = "0"; if (dataJSON != null) { myModalLabel.InnerText = "Historial de Oportunidad"; codigo = dataJSON["codigo"].ToString(); OportunidadBean lOport = OportunidadController.GetOportunidad( new OportunidadBean { IdOportunidad = codigo }); MtxtCliente.Value = lOport.Cliente; MtxtCodigo.Value = lOport.Codigo; MtxtIdOportunidad.Value = lOport.Codigo; List <OportunidadBean> letapa = OportunidadController.GetConfiguracionEtapaLista(codigo); litGrillaHistorial.Text = DibujaTabla(letapa); //List<FotoBean> lFoto = OportunidadController.GetOportunidadEtapaFoto(codigo); //HttpContext.Current.Session["FotosLista"] = lFoto; } else { } } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["lgn_id"] == null) { Session.Clear(); string myScript = ConfigurationManager.AppSettings["URL_LOGIN"]; String lsScript = "parent.document.location.href = '" + myScript + "/default.aspx?acc=SES';"; Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", lsScript, true); } else { CargaCombos(); if (!IsPostBack) { string json = new System.IO.StreamReader(Request.InputStream).ReadToEnd(); Dictionary <string, string> dataJSON = JsonConvert.DeserializeObject <Dictionary <string, string> >(json); String codigo = "0"; if (dataJSON != null) { myModalLabel.InnerText = "Editar Oportunidad"; codigo = dataJSON["codigo"].ToString(); OportunidadBean lOport = OportunidadController.GetOportunidad( new OportunidadBean { IdOportunidad = codigo }); MddlConfOpor.SelectedValue = lOport.IdConfiguracionOportunidad; MddlResponsable.SelectedValue = lOport.Responsable; MtxtCliente.Value = lOport.Cliente; MtxtCliente.Attributes["idval"] = lOport.CodCliente; MtxtIdOportunidad.Value = lOport.Codigo; } else { myModalLabel.InnerText = "Crear Oportunidad"; } } } }