public bool IsEmployeeUpdated(EmployeeVM itemVm)
        {
            Employee item = new Employee()
            {
                Id               = itemVm.Id,
                Name             = itemVm.Name,
                Code             = itemVm.Code,
                BranchId         = itemVm.BranchId,
                JoiningDate      = itemVm.JoiningDate,
                Image            = itemVm.Image,
                Contact          = itemVm.Contact,
                Email            = itemVm.Email,
                ReferenceId      = itemVm.ReferenceId,
                EmergencyContact = itemVm.EmergencyContact,
                NID              = itemVm.NID,
                FathersName      = itemVm.FathersName,
                MothersName      = itemVm.MothersName,
                PresentAddress   = itemVm.PresentAddress,
                PermanentAddress = itemVm.PermanentAddress,
                Date             = itemVm.Date
            };

            dbContext.Entry(item).State = EntityState.Modified;
            var isUpdated = dbContext.SaveChanges() > 0;

            return(isUpdated);
        }
 public ActionResult Edit([Bind(Include = "ID,Type,Model,Quantity_Available,Quantity_Sold,Unit_Price,Selling_Price,Des,Date_Updated,Unique_Barcode")] Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(product));
 }
 public ActionResult Edit([Bind(Include = "ID,Name,Phone2,Address")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customer));
 }
Example #4
0
 public ActionResult Edit([Bind(Include = "ID,Address_ID,Company_Name,Contact_Name,Contact_Designation,Email")] Supplier supplier)
 {
     if (ModelState.IsValid)
     {
         db.Entry(supplier).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Address_ID = new SelectList(db.Addresses, "ID", "City", supplier.Address_ID);
     return(View(supplier));
 }
 public ActionResult Edit([Bind(Include = "ID,Name,Username,Password,Last_Login,User_Type,Address_ID,Mobile,Manager_ID")] Login login)
 {
     if (ModelState.IsValid)
     {
         db.Entry(login).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Address_ID = new SelectList(db.Addresses, "ID", "City", login.Address_ID);
     ViewBag.Manager_ID = new SelectList(db.Employees, "ID", "Name", login.Manager_ID);
     return(View(login));
 }
Example #6
0
 public ActionResult Edit([Bind(Include = "Invoice_ID,Customer_ID,Journal_ID,Date")] Sale sale)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sale).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Customer_ID = new SelectList(db.Customers, "ID", "Name", sale.Customer_ID);
     ViewBag.Journal_ID  = new SelectList(db.Journals, "ID", "ID", sale.Journal_ID);
     return(View(sale));
 }
 public ActionResult Edit([Bind(Include = "Barcode_Serial,Product_ID,Color,Date")] Barcode barcode)
 {
     if (ModelState.IsValid)
     {
         db.Entry(barcode).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Product_ID     = new SelectList(db.Products, "ID", "Type", barcode.Product_ID);
     ViewBag.Barcode_Serial = new SelectList(db.Gifts, "Barcode", "SL", barcode.Barcode_Serial);
     return(View(barcode));
 }
Example #8
0
        public bool IsBranchUpdated(BranchVM itemVm)
        {
            Branch item = new Branch()
            {
                Id             = itemVm.Id,
                Code           = itemVm.Code,
                Contact        = itemVm.Contact,
                Address        = itemVm.Address,
                OrganizationId = itemVm.OrganizationId,
                Date           = itemVm.Date
            };

            dbContext.Entry(item).State = EntityState.Modified;
            var isUpdated = dbContext.SaveChanges() > 0;

            return(isUpdated);
        }
        public bool IsExpenseCategoryUpdated(ExpenseCategoryVM itemVm)
        {
            ExpenseCategory item = new ExpenseCategory()
            {
                Id          = itemVm.Id,
                Name        = itemVm.Name,
                Code        = itemVm.Code,
                Description = itemVm.Description,
                Date        = itemVm.Date,
                ParentId    = itemVm.ParentId
            };

            dbContext.Entry(item).State = EntityState.Modified;
            var isUpdated = dbContext.SaveChanges() > 0;

            return(isUpdated);
        }
        public bool IsOrganizationUpdated(OrganizationVM itemVm)
        {
            Organization item = new Organization()
            {
                Id      = itemVm.Id,
                Name    = itemVm.Name,
                Code    = itemVm.Code,
                Contact = itemVm.Contact,
                Address = itemVm.Address,
                Image   = itemVm.Image,
                Date    = itemVm.Date
            };

            dbContext.Entry(item).State = EntityState.Modified;
            var isUpdated = dbContext.SaveChanges() > 0;

            return(isUpdated);
        }
        public bool IsItemUpdated(ItemVM itemVm)
        {
            Item item = new Item()
            {
                Id          = itemVm.Id,
                Name        = itemVm.Name,
                PreCode     = itemVm.PreCode,
                Code        = itemVm.Code,
                CostPrice   = itemVm.CostPrice,
                SalePrice   = itemVm.SalePrice,
                Description = itemVm.Description,
                Image       = itemVm.Image,
                Date        = itemVm.Date,
                CategoryId  = itemVm.CategoryId
            };

            dbContext.Entry(item).State = EntityState.Modified;
            var isUpdated = dbContext.SaveChanges() > 0;

            return(isUpdated);
        }
        public bool IsPartyUpdated(PartyVM itemVm)
        {
            Party item = new Party()
            {
                Id         = itemVm.Id,
                Name       = itemVm.Name,
                PreCode    = itemVm.PreCode,
                Code       = itemVm.Code,
                Contact    = itemVm.Contact,
                Address    = itemVm.Address,
                Email      = itemVm.Email,
                Image      = itemVm.Image,
                Date       = itemVm.Date,
                IsCustomer = itemVm.IsCustomer,
                IsSupplier = itemVm.IsSupplier
            };

            dbContext.Entry(item).State = EntityState.Modified;
            var isUpdated = dbContext.SaveChanges() > 0;

            return(isUpdated);
        }