Пример #1
0
        protected void lnk_change_status_click(object sender, CommandEventArgs args)
        {
            try
            {
                int Id = 0;
                int.TryParse(args.CommandName, out Id);
                bool status = false;
                bool.TryParse(args.CommandArgument.ToString(), out status);

                Cortina oC = new Cortina();
                oC.Id = Id;
                CortinaMng oCMng = new CortinaMng();
                oCMng.O_Cortina = oC;
                if (status)
                {
                    oCMng.dlt();
                }
                else
                {
                    oCMng.reactive();
                }

                ddlBodega_Changed(null, null);
            }
            catch (Exception e)
            {
                ((MstCasc)this.Master).setError = e.Message;
            }
        }
Пример #2
0
        public static Cortina_disponible cortinaVerificarByUsuario()
        {
            Cortina_disponible oC = new Cortina_disponible();

            try
            {
                Cortina_disponibleMng oMng = new Cortina_disponibleMng();
                oMng.fillLst();
                List <Cortina_disponible> lst = oMng.Lst;
                if (lst.Exists(p => p.Inicio != default(DateTime) && p.Fin == default(DateTime)))
                {
                    oC = lst.Find(p => p.Fin == default(DateTime));

                    Cortina o = new Cortina()
                    {
                        Id = oC.Id_cortina
                    };
                    CortinaMng oCMng = new CortinaMng()
                    {
                        O_Cortina = o
                    };
                    oCMng.selById();
                }
            }
            catch
            {
                throw;
            }
            return(oC);
        }
Пример #3
0
        public static void fillCortinaByBodega(DropDownList ddlCortina, int Id_bodega)
        {
            CortinaMng oMng = new CortinaMng();
            Cortina    o    = new Cortina();

            o.Id_bodega    = Id_bodega;
            oMng.O_Cortina = o;
            oMng.selByIdBodega();
            ddlCortina.DataSource     = oMng.Lst;
            ddlCortina.DataTextField  = "nombre";
            ddlCortina.DataValueField = "id";
            ddlCortina.DataBind();
        }
Пример #4
0
 private void istCortina(Cortina oC)
 {
     try
     {
         CortinaMng oCMng = new CortinaMng();
         oCMng.O_Cortina = oC;
         oCMng.add();
     }
     catch
     {
         throw;
     }
 }
Пример #5
0
 private void fillCortina(int IdBodega)
 {
     try
     {
         CortinaMng oCMng = new CortinaMng();
         Cortina    oC    = new Cortina();
         oC.Id_bodega    = IdBodega;
         oCMng.O_Cortina = oC;
         oCMng.selByIdBodegaAll();
         fillCatalog(oCMng.Lst);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #6
0
        private void fillForm()
        {
            int Id = 0;

            int.TryParse(hfId.Value, out Id);

            try
            {
                CortinaMng oCMng = new CortinaMng();
                Cortina    oC    = new Cortina();
                oC.Id           = Id;
                oCMng.O_Cortina = oC;
                oCMng.selById();

                txt_nombre.Text         = oC.Nombre;
                ddlBodega.SelectedValue = oC.Id_bodega.ToString();
            }
            catch
            {
                throw;
            }
        }