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); }
public ActionResult Editar(int id) { try { using (var db = new inventoryContext()) { degrees deg = db.degrees.Find(id); return(View(deg)); } } catch (Exception ex) { throw; } }
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; } }
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; } }
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; } }
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; } }
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; } }
// 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; } }
// 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; } }
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); }
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()); } }
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; } }
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()); } }
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; } }
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; } }
public OrdersController(inventoryContext context) { _context = context; }
public SecondaryCustomerShipToAddressesController(inventoryContext context) { _context = context; }
public StructuresController(inventoryContext context) { _context = context; }
public LocationsController(inventoryContext context) { _context = context; }
public KategorijaController(inventoryContext context) { _context = context; }
public SalesTeamBinsController(inventoryContext context) { _context = context; }
public DonorAPIRespository(inventoryContext context) { _context = context; }
public TipController(inventoryContext context) { _context = context; }
public ReceiversController(inventoryContext context) { _context = context; }
public ProductGroupDetailController(inventoryContext context) { _context = context; }
public UOMsController(inventoryContext context) { _context = context; }
public SecondaryCustomersController(inventoryContext context) { _context = context; }