예제 #1
0
    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
                {
                }
            }
        }
    }