public ActionResult Edit([Bind(Include = "StatusID,Status_Name")] T_Status t_Status)
 {
     if (ModelState.IsValid)
     {
         _db.Entry(t_Status).State = EntityState.Modified;
         _db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(t_Status));
 }
 public ActionResult Edit(T_Place T_Place)
 {
     if (ModelState.IsValid)
     {
         _db.Entry(T_Place).State = EntityState.Modified;
         _db.SaveChanges();
         Session["Result"] = "okE";
         return(RedirectToAction("Index"));
     }
     return(View(T_Place));
 }
 public ActionResult Disbu(string DL)
 {
     if (DL != null)
     {
         var data = _db.T_Distributor.ToList();
         var Ex   = data.FirstOrDefault(a => a.DistributorID == DL);
         if (Ex != null)
         {
             Ex.Di_Status        = "2";
             _db.Entry(Ex).State = EntityState.Modified;
             _db.SaveChanges();
             Chang(DL);
         }
         return(RedirectToAction(nameof(IndexR)));
     }
     else
     {
         Session["Result"] = "error8";
         return(RedirectToAction(nameof(IndexR)));
     }
 }
        public ActionResult Edit(T_DistributorList data)
        {
            try
            {
                _db.Entry(data).State = EntityState.Modified;
                _db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 5
0
 public ActionResult Edit(T_Requisition data)
 {
     ViewBag.Re_TeaId = new SelectList(_db.Teacher, "TeaId", "TeaName");
     try
     {
         data.Re_StepID        = "0";
         _db.Entry(data).State = EntityState.Modified;
         _db.SaveChanges();
         Session["Result"] = "okE";
         return(RedirectToAction(nameof(Waiting)));
     }
     catch
     {
         return(View(data));
     }
 }
 public ActionResult Edit([Bind(Include = "CategoryID,CA_NameCategory")] T_Category t_Category)
 {
     if (ModelState.IsValid)
     {
         var p = int.TryParse(t_Category.CategoryID, out _);
         if (p)
         {
             _db.Entry(t_Category).State = EntityState.Modified;
             _db.SaveChanges();
             Session["Result"] = "okE";
             return(RedirectToAction("Index"));
         }
         else
         {
             ModelState.AddModelError("CategoryID", "กรุณากรอกเป็นตัวเลข");
             return(View());
         }
     }
     return(View(t_Category));
 }
Exemplo n.º 7
0
 public ActionResult Edit(T_Type T_Type)
 {
     ViewBag.TY_CategoryID = new SelectList(_db.T_Category, "CategoryID", "CA_NameCategory", T_Type.TypeID);
     if (ModelState.IsValid)
     {
         var p = int.TryParse(T_Type.TypeID, out _);
         if (p)
         {
             _db.Entry(T_Type).State = EntityState.Modified;
             _db.SaveChanges();
             Session["Result"] = "okE";
             return(RedirectToAction("Index"));
         }
         else
         {
             ModelState.AddModelError("TypeID", "กรุณากรอกเป็นตัวเลข");
             return(View());
         }
     }
     return(View(T_Type));
 }
Exemplo n.º 8
0
 public void Mo(T_Requisition IDPOST)
 {
     _db.Entry(IDPOST).State = EntityState.Modified;
     _db.SaveChanges();
 }