Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["lgn_id"] == null)
            {
                Session.Clear();
                String lsScript = "parent.document.location.href = '../../default.aspx?acc=SES';";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", lsScript, true);
            }
            else
            {
                Session["lstPerfiles"] = PerfilController.GetAll(new PerfilBean {
                    FlgHabilitado = "T"
                });

                if (!IsPostBack)
                {
                    string json = new System.IO.StreamReader(Request.InputStream).ReadToEnd();
                    Dictionary <string, string> dataJSON = JsonConvert.DeserializeObject <Dictionary <string, string> >(json);

                    if (dataJSON != null)
                    {
                        String Codigo = dataJSON["CodCliente"].ToString();
                        CargaCombos(Codigo);
                        String codInstalacion = dataJSON["codInstalacion"].ToString();
                        if (!String.IsNullOrEmpty(codInstalacion))
                        {
                            MddlIdInstalacion.SelectedValue = codInstalacion.Trim();
                            MddlIdInstalacion.Attributes.Add("disabled", "disabled");
                        }
                    }
                }
            }
        }
Exemple #2
0
    public static List <ListItem> ComboMultPerfil()
    {
        List <ListItem> lstComboBean = PerfilController.GetAll(new PerfilBean {
            FlgHabilitado = "T"
        }).Select(x => new ListItem()
        {
            Text     = x.Nombre,
            Value    = x.Descripcion.ToString(),
            Selected = true,
        }).ToList();

        return(lstComboBean);
    }
Exemple #3
0
 private void CargaCombos()
 {
     try
     {
         var perfil = PerfilController.GetAll(new PerfilBean {
             FlgHabilitado = "T"
         });
         Utility.ComboBuscar(ddlPerfil, perfil, "IdPerfil", "Descripcion");
     }
     catch (Exception ex)
     {
         LogHelper.LogException(ex, "Error :" + this);
         throw new Exception("ERROR: " + ex.Message);
     }
 }
Exemple #4
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
            {
                Session["lstPerfiles"] = PerfilController.GetAll(new PerfilBean { FlgHabilitado = "T" });

                if (!IsPostBack)
                {
                    string json = new System.IO.StreamReader(Request.InputStream).ReadToEnd();

                    Dictionary<string, string> dataJSON = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);

                    if (dataJSON != null )
                    {
                        String Codigo = dataJSON["codigo"].ToString();

                        GrupoBean obj = GrupoController.Get(new GrupoBean { IDGrupo = int.Parse( dataJSON["codigo"].ToString()) });
                        myModalLabel.InnerText = "Editar " + Model.bean.IdiomaCultura.getMensaje(Model.bean.IdiomaCultura.WEB_GRUPO);

                        if (obj != null)
                        {
                            CargaComboPadre(obj.IDGrupo);
                            hdIdGrupo.Value = (obj.IDGrupo).ToString();
                            MtxtCodigo.Value = obj.Codigo;
                            MtxtDescripcion.Value = obj.Nombre;
                            MddlPadre.SelectedValue = obj.CodigoPadreGrupo;
                            MtxtCodigo.Disabled = true;
                        }

                    }
                    else
                    {
                        CargaComboPadre(0);
                        myModalLabel.InnerText = "Crear " + Model.bean.IdiomaCultura.getMensaje(Model.bean.IdiomaCultura.WEB_GRUPO);
                    }
                }
            }
        }
Exemple #5
0
 private void CargaCombos()
 {
     try
     {
         var perfil = PerfilController.GetAll(new PerfilBean {
             FlgHabilitado = "T"
         });
         Utility.ComboNuevo(MddlIdPerfil, perfil, "IdPerfil", "Descripcion");
         var codigo = HttpContext.Current.Session["lgn_id"].ToString();
         var canal  = NegocioController.GetAll(new NegocioBean {
             Nombre = ""
         }, codigo);
         Utility.ComboNuevo(MddlIdCanal, canal, "IdNegocio", "Nombre");
     }
     catch (Exception ex)
     {
         LogHelper.LogException(ex, "Error :" + this);
         throw new Exception("ERROR: " + ex.Message);
     }
 }
Exemple #6
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
        {
            Session["SesTipoControl"]          = null;
            Session["SesGrupo"]                = null;
            Session["DetalleSubTipoActividad"] = null;
            Session["lstPerfiles"]             = null;

            CargaComboTipoControl();
            CargaComboGeneral();

            Session["lstPerfiles"] = PerfilController.GetAll(new PerfilBean {
                FlgHabilitado = "T"
            });

            if (!IsPostBack)
            {
                string json = new System.IO.StreamReader(Request.InputStream).ReadToEnd();

                Dictionary <string, string> dataJSON = JsonConvert.DeserializeObject <Dictionary <string, string> >(json);

                if (dataJSON != null)
                {
                    String Codigo = dataJSON["codigo"].ToString();

                    SubTipoActividadBean obj = SubTipoActividadController.Get(
                        new SubTipoActividadBean
                    {
                        IDSubTipoActividad = dataJSON["codigo"].ToString(),
                        Codigo             = "",
                        Descripcion        = ""
                    });
                    myModalLabel.InnerText = "Editar Sub Tipo Actividad"; //+ Model.bean.IdiomaCultura.getMensaje(Model.bean.IdiomaCultura.WEB_CONFOPORTUNIDADES);

                    if (obj != null)
                    {
                        MtxtIdConfOp.Value              = (obj.IDSubTipoActividad).ToString();
                        MtxtCodigo.Value                = obj.Codigo;
                        MtxtDescripcion.Value           = obj.Descripcion;
                        MddlTipoActividad.SelectedValue = obj.idtipoactividad.ToString();
                        hdIdSubTipoActividad.Value      = obj.IdSubTipoActividadPredecesora.ToString();
                        MtxtTiempoEtapa.Value           = obj.TiempoEtapa.ToString();
                        MtxtCodigo.Disabled             = true;
                    }

                    //MtxtEtapaPredecesora.Value = ObtenerEtapaPredecesora(MddlTipoActividad.SelectedValue).Descripcion;

                    var item = new SubTipoActividadBean
                    {
                        IDSubTipoActividad = Codigo
                    };

                    List <SubTipoActividadDetBean> nopaginate = SubTipoActividadController.GetAllControl(item);

                    foreach (var hijos in nopaginate.Where(x => x.IdSubTipoActividadDetPadre != "" && x.CodigoGeneral != "").ToList())
                    {
                        //hijos.IdConfigOportunidadDetPadre;
                        var idx = nopaginate.FindIndex(x => x.IdSubTipoActividadDetalle == hijos.IdSubTipoActividadDetPadre);
                        hijos.IdSubTipoActividadDetPadre = idx.ToString();
                    }
                    HttpContext.Current.Session["DetallesEtapa"] = nopaginate;

                    litGrillaEtapa.Text = DibujaTabla(nopaginate);



                    //grdMant.DataSource = nopaginate;
                    //grdMant.DataBind();
                    //grdMant.HeaderRow.TableSection = TableRowSection.TableHeader;
                }
                else
                {
                    litGrillaEtapa.Text = DibujaTabla(new List <SubTipoActividadDetBean>());
                    //grdMant.DataSource = new List<EtapaBean> { new EtapaBean()};
                    //grdMant.DataBind();
                    //grdMant.HeaderRow.TableSection = TableRowSection.TableHeader;


                    myModalLabel.InnerText = "Crear Sub Tipo Actividad";//+ Model.bean.IdiomaCultura.getMensaje(Model.bean.IdiomaCultura.WEB_CONFOPORTUNIDADES);
                }
            }
        }
    }