Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 3
0
 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));
 }
Exemplo n.º 4
0
 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));
        }
Exemplo n.º 8
0
        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));
        }
Exemplo n.º 11
0
        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));
        }