public ActionResult Create(string reasonName, string isAdjust)
 {
     try {
         if (!string.IsNullOrEmpty(reasonName))
         {
             ReasonAccepted reasonAccepted = new ReasonAccepted();
             reasonAccepted.Name      = reasonName;
             reasonAccepted.IsDeleted = false;
             if (isAdjust == "True")
             {
                 reasonAccepted.IsAdjust = true;
             }
             if (ModelState.IsValid)
             {
                 objBs.reasonAcceptedBs.Insert(reasonAccepted);
             }
             return(RedirectToAction("Index", new { sms = "Created Successfully !" }));
         }
         else
         {
             return(RedirectToAction("Index", new { sms = "reason is null or empty !" }));
         }
     }
     catch (Exception ex) {
         return(RedirectToAction("Index", new { sms = "Operation Create failed ! " + ex.InnerException.InnerException.Message.ToString() }));
     }
 }
Exemple #2
0
        //Delete
        public void Delete(int Id)
        {
            ReasonAccepted reasonAccepted = db.ReasonAccepteds.Find(Id);

            reasonAccepted.IsDeleted       = true;
            db.Entry(reasonAccepted).State = EntityState.Modified;
            Save();
        }
Exemple #3
0
 //Update
 public void Update(ReasonAccepted reasonAccepted)
 {
     objDb.Update(reasonAccepted);
 }
Exemple #4
0
 //Insert
 public void Insert(ReasonAccepted reasonAccepted)
 {
     objDb.Insert(reasonAccepted);
 }
Exemple #5
0
 //Update
 public void Update(ReasonAccepted reasonAccepted)
 {
     db.Entry(reasonAccepted).State = EntityState.Modified;
     Save();
 }
Exemple #6
0
 //Insert
 public void Insert(ReasonAccepted reasonAccepted)
 {
     db.ReasonAccepteds.Add(reasonAccepted);
     Save();
 }