Пример #1
0
 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;
 }
Пример #2
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));
 }
Пример #3
0
 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));
 }
Пример #4
0
        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);
        }
Пример #5
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);
        }
Пример #6
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);
        }
Пример #8
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);
        }
Пример #10
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));
 }
Пример #12
0
 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));
 }
Пример #13
0
 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));
 }
Пример #14
0
 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));
 }