示例#1
0
        private string SaveCustLoadAction(ITT_CUST_LOAD model)
        {
            try
            {
                ITT_CUST_LOAD_VALICATION validation = new ITT_CUST_LOAD_VALICATION(model);
                string msg = validation.ValidationAction();
                if (!string.IsNullOrEmpty(msg))
                {
                    return(msg);
                }

                if (model.BND_OUT_DATE != null && model.NBND_ARRIVAL_DATE == null)
                {
                    M_CALENDAR_BLL calBLL = new M_CALENDAR_BLL();
                    model.NBND_ARRIVAL_DATE = calBLL.GetArrivalDateFromOutDate(model.BND_OUT_DATE.Value);
                }

                model.LOADED_BY = Session[CHubConstValues.SessionUser].ToString();
                model.LOAD_DATE = DateTime.Now;
                ITT_CUST_LOAD_BLL tranBLL = new ITT_CUST_LOAD_BLL();
                tranBLL.Save(model);
                return(string.Empty);
            }
            catch (Exception ex)
            {
                return(string.Format("Fail Saved:{0}", ex.Message));
            }
        }
示例#2
0
        public ActionResult SaveCustLoad(ITT_CUST_LOAD model)
        {
            try
            {
                if (model.WILL_BILL_NO == null)
                {
                    return(Json(new RequestResult(false, "WillBillNo can't be empty")));
                }

                ITT_CUST_LOAD_BLL ctBLL = new ITT_CUST_LOAD_BLL();
                if (ctBLL.ExistCustLoad(model.WILL_BILL_NO, model.TC_GROUP))
                {
                    ITT_CUST_LOAD temp = ctBLL.GetCustLoadbyConstraint(model.WILL_BILL_NO, model.TC_GROUP);
                    if (model.LOAD_BATCH_TOKEN != temp.LOAD_BATCH_TOKEN)
                    {
                        return(Json(new RequestResult(false, "Exist same wayBillNO and TC Group Items")));
                    }
                }

                string msg = SaveCustLoadAction(model);
                if (!string.IsNullOrEmpty(msg))
                {
                    return(Json(new RequestResult(false, msg)));
                }

                return(Json(new RequestResult(true, null, model.LOAD_BATCH_TOKEN)));
            }
            catch (Exception ex)
            {
                //this.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
                //return Content(ex.Message);
                return(Json(new RequestResult(false, ex.Message)));
            }
        }
示例#3
0
        public ActionResult GetCustList(string willBillNo)
        {
            ITT_CUST_LOAD_BLL    custBLL = new ITT_CUST_LOAD_BLL();
            List <ITT_CUST_LOAD> result  = custBLL.GetCustList(willBillNo);

            foreach (var item in result)
            {
                if (item.LOAD_DATE == null)
                {
                    item.LOAD_DATE = DateTime.Now;
                }
            }
            return(Json(result));
        }
示例#4
0
 public ActionResult DeleteCustLoad(string token)
 {
     try
     {
         if (string.IsNullOrEmpty(token))
         {
             return(Json(new RequestResult(false, "token is empty")));
         }
         ITT_CUST_LOAD_BLL custBLL = new ITT_CUST_LOAD_BLL();
         custBLL.Delete(token);
         return(Json(new RequestResult(true)));
     }
     catch (Exception ex)
     {
         return(Json(new RequestResult(false, ex.Message)));
     }
 }