コード例 #1
0
 public ActionResult Create(string reasonName, string isAdjust)
 {
     try {
         if (!string.IsNullOrEmpty(reasonName))
         {
             ReasonInbound reasonInbound = new ReasonInbound();
             reasonInbound.Name      = reasonName;
             reasonInbound.IsDeleted = false;
             if (isAdjust == "True")
             {
                 reasonInbound.IsAdjust = true;
             }
             if (ModelState.IsValid)
             {
                 objBs.reasonInboundBs.Insert(reasonInbound);
             }
             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() }));
     }
 }
コード例 #2
0
ファイル: ReasonInboundDb.cs プロジェクト: tatthepm/SCGLKPI
        //Delete
        public void Delete(int Id)
        {
            ReasonInbound reasonInbound = db.ReasonInbounds.Find(Id);

            reasonInbound.IsDeleted       = true;
            db.Entry(reasonInbound).State = EntityState.Modified;
            Save();
        }
コード例 #3
0
ファイル: ReasonInboundDb.cs プロジェクト: tatthepm/SCGLKPI
 //Update
 public void Update(ReasonInbound reasonInbound)
 {
     db.Entry(reasonInbound).State = EntityState.Modified;
     Save();
 }
コード例 #4
0
ファイル: ReasonInboundDb.cs プロジェクト: tatthepm/SCGLKPI
 //Insert
 public void Insert(ReasonInbound reasonInbound)
 {
     db.ReasonInbounds.Add(reasonInbound);
     Save();
 }
コード例 #5
0
ファイル: ReasonInboundBs.cs プロジェクト: tatthepm/SCGLKPI
 //Update
 public void Update(ReasonInbound reasonInbound)
 {
     objDb.Update(reasonInbound);
 }
コード例 #6
0
ファイル: ReasonInboundBs.cs プロジェクト: tatthepm/SCGLKPI
 //Insert
 public void Insert(ReasonInbound reasonInbound)
 {
     objDb.Insert(reasonInbound);
 }