Ejemplo n.º 1
0
 public ActionResult Create(string reasonName, string isAdjust)
 {
     try {
         if (!string.IsNullOrEmpty(reasonName))
         {
             ReasonOutbound reasonOutbound = new ReasonOutbound();
             reasonOutbound.Name      = reasonName;
             reasonOutbound.IsDeleted = false;
             if (isAdjust == "True")
             {
                 reasonOutbound.IsAdjust = true;
             }
             if (ModelState.IsValid)
             {
                 objBs.reasonOutboundBs.Insert(reasonOutbound);
             }
             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() }));
     }
 }
Ejemplo n.º 2
0
        //Delete
        public void Delete(int Id)
        {
            ReasonOutbound reasonOutbound = db.ReasonOutbounds.Find(Id);

            reasonOutbound.IsDeleted       = true;
            db.Entry(reasonOutbound).State = EntityState.Modified;
            Save();
        }
Ejemplo n.º 3
0
 public ActionResult Create(string reasonName, string isAdjust)
 {
     try {
         if (!string.IsNullOrEmpty(reasonName)) {
             ReasonOutbound reasonOutbound = new ReasonOutbound();
             reasonOutbound.Name = reasonName;
             reasonOutbound.IsDeleted = false;
             if (isAdjust == "True") reasonOutbound.IsAdjust = true;
             if (ModelState.IsValid) {
                 objBs.reasonOutboundBs.Insert(reasonOutbound);
             }
             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() });
     }
 }
Ejemplo n.º 4
0
 //Update
 public void Update(ReasonOutbound reasonOutbound)
 {
     db.Entry(reasonOutbound).State = EntityState.Modified;
     Save();
 }
Ejemplo n.º 5
0
 //Insert
 public void Insert(ReasonOutbound reasonOutbound)
 {
     db.ReasonOutbounds.Add(reasonOutbound);
     Save();
 }
Ejemplo n.º 6
0
 //Update
 public void Update(ReasonOutbound reasonOutbound)
 {
     objDb.Update(reasonOutbound);
 }
Ejemplo n.º 7
0
 //Insert
 public void Insert(ReasonOutbound reasonOutbound)
 {
     objDb.Insert(reasonOutbound);
 }
Ejemplo n.º 8
0
 //Update
 public void Update(ReasonOutbound reasonOutbound)
 {
     db.Entry(reasonOutbound).State = EntityState.Modified;
     Save();
 }
Ejemplo n.º 9
0
 //Insert
 public void Insert(ReasonOutbound reasonOutbound)
 {
     db.ReasonOutbounds.Add(reasonOutbound);
     Save();
 }