public ActionResult Edit([Bind(Include = "ID,Firstname,Lastname,Gender,BirthDay,Weight,Height,Description")] Customer customer) { if (ModelState.IsValid) { db.Entry(customer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(customer)); }
public ActionResult Edit([Bind(Include = "ID,CateName,CateCode")] Category category) { if (ModelState.IsValid) { db.Entry(category).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(category)); }
public ActionResult Edit([Bind(Include = "ID,CateID,ProductName,Buy,Size,Code,Ingredients,ImagePath,Description,Unit,Barcode,Sale")] Product product) { if (ModelState.IsValid) { db.Entry(product).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CateID = new SelectList(db.Categories, "ID", "CateName", product.CateID); return(View(product)); }
public ActionResult Edit([Bind(Include = "ID,ProductID,ProductName,Price,StockDate,Unit,Code,Qty,UserName,Status,Description")] Stock stock) { if (ModelState.IsValid) { db.Entry(stock).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProductID = new SelectList(db.Products, "ID", "ProductName", stock.ProductID); return(View(stock)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name")] Group group) { if (ModelState.IsValid) { db.Entry(group).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(group)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Latitude,Longtitude")] Supplier supplier) { if (ModelState.IsValid) { db.Entry(supplier).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(supplier)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Salary")] Position position) { if (ModelState.IsValid) { db.Entry(position).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(position)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Surname,PositionId")] Employee employee) { if (ModelState.IsValid) { db.Entry(employee).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.PositionId = new SelectList(db.Positions, "Id", "Name", employee.PositionId); return(View(employee)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Date,SupplierId")] Delivery delivery) { if (ModelState.IsValid) { db.Entry(delivery).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.SupplierId = new SelectList(db.Suppliers, "Id", "Name", delivery.SupplierId); return(View(delivery)); }
public async Task <ActionResult> Edit([Bind(Include = "MedicineId,DeliveryId,Quantity,Id")] MedicineDelivery medicineDelivery) { if (ModelState.IsValid) { db.Entry(medicineDelivery).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.DeliveryId = new SelectList(db.Deliveries, "Id", "Date", medicineDelivery.DeliveryId); ViewBag.MedicineId = new SelectList(db.Medicines, "Id", "Name", medicineDelivery.MedicineId); return(View(medicineDelivery)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name,GroupId,SupplierId,Price")] Medicine medicine) { if (ModelState.IsValid) { db.Entry(medicine).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.GroupId = new SelectList(db.Groups, "Id", "Name", medicine.GroupId); ViewBag.SupplierId = new SelectList(db.Suppliers, "Id", "Name", medicine.SupplierId); ViewBag.Id = new SelectList(db.Warehouses, "MedicineId", "MedicineId", medicine.Id); return(View(medicine)); }