Beispiel #1
0
    protected void FillDDlFamilia()
    {
        GetListVariables getList = new GetListVariables(5);

        DDLFamilia.DataSource     = getList.Listavariables;
        DDLFamilia.DataTextField  = "_Name";
        DDLFamilia.DataValueField = "ID";
        DDLFamilia.DataBind();
        DDLFamilia.Items.Insert(0, new ListItem("--Seleccionar Familia--"));
    }
Beispiel #2
0
 protected void DDLFamilia_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!DDLCategoria.Enabled || DDLFamilia.SelectedIndex != 0)
     {
         DDLCategoria.Enabled = true;
         GetListVariables Get = new GetListVariables();
         Get.GetListModelCategory(DDLFamilia.SelectedValue);
         FillDDlCategoria(Get.ListCompCategory);
     }
     else
     {
         DDLCategoria.Enabled = false;
     }
 }
Beispiel #3
0
 protected void DDlFamilia_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (DDlFamilia.SelectedIndex != 0)
     {
         DDLCategoria.Visible = true;
         GetListVariables getList = new GetListVariables();
         getList.GetListModelCategory(DDlFamilia.SelectedValue);
         FillDDL(DDLCategoria, "_Name", "_IDAsign", "--Seleccionar--", getList.ListCompCategory);
         DDLModelos.Visible = false;
     }
     else
     {
         DDLCategoria.Visible   = false;
         DDLModelos.Visible     = false;
         PanelInfoModel.Visible = false;
     }
 }
Beispiel #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string ID = Request.QueryString["ID"];

        TOKEN = Request.QueryString["TOKEN"];

        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(ID) && !string.IsNullOrEmpty(TOKEN))
            {
                Modelos Model   = new Modelos();
                bool    IsModel = Model.IsModel(ID, true, TOKEN);
                HdnIdModel.Value = ID;
                if (IsModel)
                {
                    //Llena el dropdown de las formulas predeterminadas
                    FillDDlFormulasPred(DDLFormulasPred);

                    //fill DDL piezas y copmponentes
                    FillDDLFirstPieceOrComp();

                    Imagen.ImageUrl = Model._modelo.IMAGE;

                    TxtNombre.Text      = Model._modelo.NOMBRE;
                    LblCreateDate.Text  = Model._modelo.F_Created.ToLongDateString();
                    LblEditDate.Text    = Model._modelo.F_Update.ToLongDateString();
                    TxtDescripcion.Text = Model._modelo.DESCRIPCION;

                    FillDDlFamilia();

                    BomModel bomModel = new BomModel(ID, true);
                    FILLtablaBOM(bomModel.Lista);

                    //Fill DDr canales no asignaDOS y tabla



                    CanalDis cdis = new CanalDis();
                    FillTablaCanales(cdis.GetCanalesAsign(ID, true));
                    FillDDL(DDlSelectChanel, "CHANNAME", "ID", "Seleccionar", cdis.GetCanalesNOAsign(ID, true));

                    // Habilita el ddl de la familia
                    if (string.IsNullOrEmpty(Model._modelo.Familia))
                    {
                        DDLFamilia.Enabled   = true;
                        DDLCategoria.Enabled = false;
                        LinkBtnFamCat.Text   = "Actualizar";
                    }
                    else
                    {
                        DDLFamilia.SelectedValue = Model._modelo.IdFamilia;
                    }
                    //habilita el ddl de categoria
                    if (string.IsNullOrEmpty(Model._modelo.Categoria))
                    {
                        DDLCategoria.Enabled = false;
                        LinkBtnFamCat.Text   = "Actualizar";
                        GetListVariables getList = new GetListVariables(6);
                        FillDDlCategoria(getList.Listavariables);
                    }
                    else
                    {
                        GetListVariables Get = new GetListVariables();
                        Get.GetListModelCategory(Model._modelo.IdFamilia);
                        FillDDlCategoria(Get.ListCompCategory);
                        DDLCategoria.SelectedValue = Model._modelo.ID_PASIGFAMCAT.ToString();
                    }
                }
                else
                {
                    Response.Redirect(Error404.Redireccion(MasterPageFile, "El componente no fue encontrado"));
                }
            }
            else
            {
                Response.Redirect(Error404.Redireccion(MasterPageFile, "Hubo un error al tratar de buscar el componente, intentelo nuevamente"));
            }
        }
    }