Ejemplo n.º 1
0
        public List <VmAttriebute> LoadData()
        {
            inventoryContext    context = new inventoryContext();
            List <VmAttriebute> li      = new List <VmAttriebute>();
            attrebuteEntity     att     = new attrebuteEntity();


            var x = from D in context.Attrebutes
                    join E in context.AttrebuteValues
                    on D.ID equals E.attrebute_ID into G
                    select new
            { D.ID, Attrebute_name = D.Attrebute_name, Status = D.Status, count = G.Count() };



            foreach (var item in x)
            {
                VmAttriebute obj = new VmAttriebute();
                obj.attVM                = new attrebuteEntity();
                obj.attVM.ID             = item.ID;
                obj.attVM.Attrebute_name = item.Attrebute_name;
                obj.attVM.Status         = item.Status;
                obj.count                = item.count;

                li.Add(obj);
            }
            return(li);
        }
Ejemplo n.º 2
0
 public ActionResult Editar(int id)
 {
     try
     {
         using (var db = new inventoryContext())
         {
             degrees deg = db.degrees.Find(id);
             return(View(deg));
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Ejemplo n.º 3
0
 public ActionResult Editar_location(int id)
 {
     try
     {
         using (var db = new inventoryContext())
         {
             locations lo = db.locations.Find(id);
             return(View(lo));
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
 public ActionResult Editar_Proyects(int id)
 {
     try
     {
         using (var db = new inventoryContext())
         {
             proyects pro = db.proyects.Find(id);
             return(View(pro));
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Ejemplo n.º 5
0
 public ActionResult Editar_SO(int id)
 {
     try
     {
         using (var db = new inventoryContext())
         {
             operatingSystems so = db.operatingSystems.Find(id);
             return(View(so));
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Ejemplo n.º 6
0
 public ActionResult Borrar_SO(int id)
 {
     try
     {
         using (var db = new inventoryContext())
         {
             operatingSystems so = db.operatingSystems.Find(id); //al es el alumno encontrado
             db.operatingSystems.Remove(so);
             db.SaveChanges();
             return(RedirectToAction("Index_SO"));
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
 public ActionResult Borrar_Proyects(int id)
 {
     try
     {
         using (var db = new inventoryContext())
         {
             proyects lo = db.proyects.Find(id); //al es el alumno encontrado
             db.proyects.Remove(lo);
             db.SaveChanges();
             return(RedirectToAction("Index_Proyects"));
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Ejemplo n.º 8
0
 public ActionResult Eliminar(int id)
 {
     try
     {
         using (var db = new inventoryContext())
         {
             //para actualizar primero encuentro al alumno
             degrees deg = db.degrees.Find(id); //al es el alumno encontrado
             db.degrees.Remove(deg);
             db.SaveChanges();
             return(RedirectToAction("Index2"));
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Ejemplo n.º 9
0
 public ActionResult Borrar_location(int id)
 {
     try
     {
         using (var db = new inventoryContext())
         {
             //para actualizar primero encuentro al alumno
             locations lo = db.locations.Find(id); //al es el alumno encontrado
             db.locations.Remove(lo);
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Ejemplo n.º 10
0
 // GET: SO
 public ActionResult Index_SO(string buscar)
 {
     try
     {
         using (var db = new inventoryContext())
         {
             IEnumerable <operatingSystems> data = db.operatingSystems.ToList();
             if (!String.IsNullOrEmpty(buscar))
             {
                 data = data.Where(s => s.OperatingSystem.Contains(buscar));
             }
             return(View(data.ToList()));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 11
0
 // GET: DeviceTypes
 public ActionResult Index_DeviceTypes(string buscar)
 {
     try
     {
         using (var db = new inventoryContext())
         {
             IEnumerable <deviceTypes> data = db.deviceTypes.ToList();
             if (!String.IsNullOrEmpty(buscar))
             {
                 data = data.Where(s => s.type.Contains(buscar));
             }
             return(View(data.ToList()));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 12
0
        public List <attrebuteValueEntity> LoadAllv(int Id)
        {
            inventoryContext context = new inventoryContext();
            var z = from t1 in context.Attrebutes
                    join t2 in context.AttrebuteValues
                    on t1.ID equals t2.attrebute_ID
                    where t1.ID == Id
                    select new { t2.Name, t2.ID };

            List <attrebuteValueEntity> li = new List <attrebuteValueEntity>();

            foreach (var item in  z)
            {
                attrebuteValueEntity obj = new attrebuteValueEntity();
                obj.ID   = item.ID;
                obj.Name = item.Name;
                li.Add(obj);
            }
            return(li);
        }
Ejemplo n.º 13
0
        public ActionResult Agregar_DeviceTypes(deviceTypes a) //va a recibir una entidad alumno
        {
            if (!ModelState.IsValid)                           // o sea si los datos estan bien, si numero es numero y asi
            {
                return(View());                                //si el modelo es validor retona la vista
            }
            try
            {
                using (var db = new inventoryContext())            //abrir y cerrar la conexion, es mas recomendado
                {
                    db.deviceTypes.Add(a);                         //si todo esta bien agregame al alumno
                    db.SaveChanges();                              //guardar los cambios
                    return(RedirectToAction("Index_DeviceTypes")); //si todo esta bien lo redireccionamos
                }
            }

            catch (Exception ex)
            {
                ModelState.AddModelError("", "Error");
                return(View());
            }
        }
Ejemplo n.º 14
0
 public ActionResult Editar(degrees a)
 {
     try
     {
         if (!ModelState.IsValid) // o sea si los datos estan bien, si numero es numero y asi
         {
             return(View());      //si el modelo es validor retona la vista
         }
         using (var db = new inventoryContext())
         {
             //para actualizar primero encuentro al alumno
             degrees deg = db.degrees.Find(a.id); //al es el alumno encontrado
             deg.degrees1 = a.degrees1;
             //agregar ultima actualizacion
             db.SaveChanges();
             return(RedirectToAction("Index2"));
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
        public ActionResult Editar_Proyects(proyects a)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View());
                }

                using (var db = new inventoryContext())
                {
                    proyects pro = db.proyects.Find(a.id);
                    pro.proyect = a.proyect;
                    //agregar ultima actualizacion
                    db.SaveChanges();
                    return(RedirectToAction("Index_Proyects"));
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Ejemplo n.º 16
0
        public ActionResult Agregar_SO(operatingSystems a)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            try
            {
                using (var db = new inventoryContext())
                {
                    db.operatingSystems.Add(a);
                    db.SaveChanges();
                    return(RedirectToAction("Index_SO"));
                }
            }

            catch (Exception ex)
            {
                ModelState.AddModelError("", "Error");
                return(View());
            }
        }
Ejemplo n.º 17
0
        public ActionResult Editar_SO(operatingSystems a)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View());
                }

                using (var db = new inventoryContext())
                {
                    operatingSystems so = db.operatingSystems.Find(a.id);
                    so.OperatingSystem = a.OperatingSystem;
                    //agregar ultima actualizacion
                    db.SaveChanges();
                    return(RedirectToAction("Index_SO"));
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Ejemplo n.º 18
0
        public ActionResult Editar_DeviceType(deviceTypes a)
        {
            try
            {
                {
                    if (!ModelState.IsValid)
                    {
                        return(View());
                    }
                    using (var db = new inventoryContext())
                    {
                        deviceTypes dev = db.deviceTypes.Find(a.id);
                        dev.type = a.type;

                        db.SaveChanges();
                        return(RedirectToAction("Index_DeviceTypes"));
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Ejemplo n.º 19
0
 public OrdersController(inventoryContext context)
 {
     _context = context;
 }
Ejemplo n.º 20
0
 public SecondaryCustomerShipToAddressesController(inventoryContext context)
 {
     _context = context;
 }
Ejemplo n.º 21
0
 public StructuresController(inventoryContext context)
 {
     _context = context;
 }
Ejemplo n.º 22
0
 public LocationsController(inventoryContext context)
 {
     _context = context;
 }
Ejemplo n.º 23
0
 public KategorijaController(inventoryContext context)
 {
     _context = context;
 }
Ejemplo n.º 24
0
 public SalesTeamBinsController(inventoryContext context)
 {
     _context = context;
 }
 public DonorAPIRespository(inventoryContext context)
 {
     _context = context;
 }
Ejemplo n.º 26
0
 public TipController(inventoryContext context)
 {
     _context = context;
 }
Ejemplo n.º 27
0
 public ReceiversController(inventoryContext context)
 {
     _context = context;
 }
 public ProductGroupDetailController(inventoryContext context)
 {
     _context = context;
 }
Ejemplo n.º 29
0
 public UOMsController(inventoryContext context)
 {
     _context = context;
 }
Ejemplo n.º 30
0
 public SecondaryCustomersController(inventoryContext context)
 {
     _context = context;
 }