public bool Update(Department department) { AssetDBContext db = new AssetDBContext(); db.Departments.Attach(department); db.Entry(department).State = EntityState.Modified; int rowAffected = db.SaveChanges(); return rowAffected > 0; }
public ActionResult Edit([Bind(Include = "Id,Name,Code,Location")] Organization organization) { if (ModelState.IsValid) { db.Entry(organization).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(organization)); }
public ActionResult Edit([Bind(Include = "Id,Name,Code")] GeneralCategory generalcategory) { if (ModelState.IsValid) { db.Entry(generalcategory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(generalcategory)); }
public bool Update(Employee employee) { AssetDBContext db = new AssetDBContext(); db.Employees.Attach(employee); db.Entry(employee).State = EntityState.Modified; int rowAffected = db.SaveChanges(); return(rowAffected > 0); }
public bool Update(Category category) { AssetDBContext db = new AssetDBContext(); db.Categories.Attach(category); db.Entry(category).State = EntityState.Modified; int rowAffacted = db.SaveChanges(); return(rowAffacted > 0); }
public bool Update(Vendor vendor) { AssetDBContext db = new AssetDBContext(); db.Vendors.Attach(vendor); db.Entry(vendor).State = EntityState.Modified; int rowAffacted = db.SaveChanges(); return(rowAffacted > 0); }
public bool Update(Location location) { AssetDBContext db = new AssetDBContext(); db.Locations.Attach(location); db.Entry(location).State = EntityState.Modified; int rowAffected = db.SaveChanges(); return(rowAffected > 0); }
public ActionResult Edit([Bind(Include = "Id,Name,PhoneNo")] Employee employee) { if (ModelState.IsValid) { db.Entry(employee).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(employee)); }
public bool Update(GeneralCategory generalCategory) { AssetDBContext db = new AssetDBContext(); db.GeneralCategories.Attach(generalCategory); db.Entry(generalCategory).State = EntityState.Modified; int rowAffected = db.SaveChanges(); return(rowAffected > 0); }
public bool Update(OrganizationBranch organizationBranch) { AssetDBContext db = new AssetDBContext(); db.OrganizationBranches.Attach(organizationBranch); db.Entry(organizationBranch).State = EntityState.Modified; int rowAffacted = db.SaveChanges(); return(rowAffacted > 0); }
public ActionResult Edit([Bind(Include = "Id,Name,ShortName,OrganizationId")] OrganizationBranch organizationbranch) { if (ModelState.IsValid) { db.Entry(organizationbranch).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.OrganizationId = new SelectList(db.Organizations, "Id", "Name", organizationbranch.OrganizationId); return(View(organizationbranch)); }
public ActionResult Edit([Bind(Include = "Id,Name,ShortName,OrganizationBranchId")] AssetLocation assetlocation) { if (ModelState.IsValid) { db.Entry(assetlocation).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.OrganizationBranchId = new SelectList(db.OrganizationBranches, "Id", "Name", assetlocation.OrganizationBranchId); return(View(assetlocation)); }
public ActionResult Edit([Bind(Include = "Id,Name,Code,Price,SerialNo,Description,SubCategoryId")] Asset asset) { if (ModelState.IsValid) { db.Entry(asset).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SubCategoryId = new SelectList(db.SubCategories, "Id", "Name", asset.SubCategoryId); return(View(asset)); }
public ActionResult Edit([Bind(Include = "Id,Name,Code,GeneralCategoryId")] Category category) { if (ModelState.IsValid) { db.Entry(category).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.GeneralCategoryId = new SelectList(db.GeneralCategories, "Id", "Name", category.GeneralCategoryId); return(View(category)); }
public ActionResult Edit([Bind(Include = "Id,AssetId,OrganizationId,SerialNo,RegistrationCode,Code,AssetLocationId,EmployeeId")] AssetRegistration assetregistration) { if (ModelState.IsValid) { db.Entry(assetregistration).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AssetId = new SelectList(db.Assets, "Id", "Name", assetregistration.AssetId); ViewBag.AssetLocationId = new SelectList(db.AssetLocations, "Id", "Name", assetregistration.AssetLocationId); ViewBag.EmployeeId = new SelectList(db.Employees, "Id", "Name", assetregistration.EmployeeId); ViewBag.OrganizationId = new SelectList(db.Organizations, "Id", "Name", assetregistration.OrganizationId); return(View(assetregistration)); }