Exemple #1
0
 public ActionResult Create(string reasonName, string isAdjust)
 {
     try {
         if (!string.IsNullOrEmpty(reasonName))
         {
             ReasonOntime reasonOntime = new ReasonOntime();
             reasonOntime.Name      = reasonName;
             reasonOntime.IsDeleted = false;
             if (isAdjust == "True")
             {
                 reasonOntime.IsAdjust = true;
             }
             if (ModelState.IsValid)
             {
                 objBs.reasonOntimeBs.Insert(reasonOntime);
             }
             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)
        {
            ReasonOntime reasonOntime = db.ReasonOntimes.Find(Id);

            reasonOntime.IsDeleted       = true;
            db.Entry(reasonOntime).State = EntityState.Modified;
            Save();
        }
 public ActionResult Create(string reasonName, string isAdjust)
 {
     try {
         if (!string.IsNullOrEmpty(reasonName)) {
             ReasonOntime reasonOntime = new ReasonOntime();
             reasonOntime.Name = reasonName;
             reasonOntime.IsDeleted = false;
             if (isAdjust == "True") reasonOntime.IsAdjust = true;
             if (ModelState.IsValid) {
                 objBs.reasonOntimeBs.Insert(reasonOntime);
             }
             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 #4
0
 //Update
 public void Update(ReasonOntime reasonOntime)
 {
     db.Entry(reasonOntime).State = EntityState.Modified;
     Save();
 }
Exemple #5
0
 //Insert
 public void Insert(ReasonOntime reasonOntime)
 {
     db.ReasonOntimes.Add(reasonOntime);
     Save();
 }
Exemple #6
0
 //Update
 public void Update(ReasonOntime reasonOntime)
 {
     objDb.Update(reasonOntime);
 }
Exemple #7
0
 //Insert
 public void Insert(ReasonOntime reasonOntime)
 {
     objDb.Insert(reasonOntime);
 }