public bool UpdateDeliver(DELIVER data)
        {
            string sql = @"sp_deliver_UPDATE";

            object[] obj = { "@DlvID", data.DlvID, "@EmpId", data.EmpID, "@SlpID", data.SlpID, "@DlvDate", data.DlvDate, "@DlvSerial", data.DlvSerial };
            using (TransactionScope ts = new TransactionScope())
            {
                try { Db.Update(sql, obj); ts.Complete(); return(true); }
                catch { return(false); }
            }
        }
        public string InsertDeliver(DELIVER data)
        {
            string sql   = "[sp_deliver_INSERT]";
            string retID = "";

            object[] obj = { "@EmpId", data.EmpID, "@SlpID", data.SlpID, "@DlvDate", data.DlvDate, "@DlvSerial", data.DlvSerial };
            using (TransactionScope ts = new TransactionScope())
            {
                try { retID = Db.InsertReturnID(sql, obj); ts.Complete(); return(retID); }
                catch { return(retID = ""); }
            }
        }
 public ActionResult EditDeliver(string DivID, string SlpID, string EMS)
 {
     if (Session["S_EmpID"] != null && Session["S_EmpFname"] != null)
     {
         DELIVER model = new DELIVER();
         model.EmpID     = Session["S_EmpID"].ToString();
         model.DlvSerial = EMS;
         model.SlpID     = SlpID;
         model.DlvDate   = DateTime.Now;
         model.DlvID     = DivID;
         if (_sellRepository.UpdateDeliver(model))
         {
             return(Json(true, JsonRequestBehavior.AllowGet));
         }
         return(Json(false, JsonRequestBehavior.AllowGet));
     }
     else
     {
         return(RedirectToAction("Login2", "Account"));
     }
 }