Esempio n. 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() }));
     }
 }
Esempio n. 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() });
     }
 }
Esempio n. 4
0
 //Update
 public void Update(ReasonOntime reasonOntime)
 {
     db.Entry(reasonOntime).State = EntityState.Modified;
     Save();
 }
Esempio n. 5
0
 //Insert
 public void Insert(ReasonOntime reasonOntime)
 {
     db.ReasonOntimes.Add(reasonOntime);
     Save();
 }
Esempio n. 6
0
 //Update
 public void Update(ReasonOntime reasonOntime)
 {
     objDb.Update(reasonOntime);
 }
Esempio n. 7
0
 //Insert
 public void Insert(ReasonOntime reasonOntime)
 {
     objDb.Insert(reasonOntime);
 }