public ActionResult Edit([Bind(Include = "Id,StatusName")] OrderStatus orderStatus)
 {
     if (ModelState.IsValid)
     {
         db.Entry(orderStatus).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(orderStatus);
 }
예제 #2
0
        public async Task <ActionResult> Edit(Menyu edit)
        {
            if (ModelState.IsValid)
            {
                db.Entry(edit).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(PartialView(edit));
        }
예제 #3
0
 public ActionResult Edit(Tarif edit)
 {
     if (ModelState.IsValid)
     {
         edit.IsActive        = Convert.ToBoolean(edit.Activ);
         db.Entry(edit).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(PartialView(edit));
 }
예제 #4
0
 public ActionResult Edit([Bind(Include = "Id,ContentText,Activ")] AboutDb aboutDb)
 {
     if (ModelState.IsValid)
     {
         aboutDb.IsActive        = Convert.ToBoolean(aboutDb.Activ);
         aboutDb.CreateDate      = DateTime.Now;
         db.Entry(aboutDb).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aboutDb));
 }
예제 #5
0
        public async Task <ActionResult> Edit(Currency edit)
        {
            if (ModelState.IsValid)
            {
                edit.IsActive        = Convert.ToBoolean(edit.Activ);
                db.Entry(edit).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            else
            {
                return(PartialView());
            }
        }
예제 #6
0
 public ActionResult Edit(Setting edit)
 {
     if (ModelState.IsValid)
     {
         if (edit.TitleImage != null && edit.TitleImage.ContentLength > 0)
         {
             var imgName   = ProsesImageFile.FileName(edit.TitleImage);
             var ImagePath = ProsesImageFile.ImagePath(imgName, "/Image/Settings");
             edit.TitleImage.SaveAs(ImagePath);
             edit.TitleImagePath = "/Image/Settings/" + imgName;
         }
         db.Entry(edit).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     else
     {
         return(RedirectToAction("Index"));
     }
 }
예제 #7
0
        public async Task <ActionResult> Edit(FaqDb EditFaq)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    EditFaq.FaqCreateDate   = DateTime.Now;
                    EditFaq.IsActive        = Convert.ToBoolean(EditFaq.Activ);
                    db.Entry(EditFaq).State = EntityState.Modified;
                    await db.SaveChangesAsync();

                    return(RedirectToAction("Index"));
                }
                else
                {
                    return(View(EditFaq));
                }
            }
            catch (Exception)
            {
                return(HttpNotFound());
            }
        }