Exemplo n.º 1
0
        /// <summary>
        /// 增加一条订单运单数据
        /// </summary>
        /// <param name="arrOrderID"></param>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool AddOrderExpress(string[] arrOrderNum, WX_ZZSCOrderExpressInfo model)
        {
            //DAL
            WX_ZZSCOrderExpressDAL dal = new WX_ZZSCOrderExpressDAL();

            List<string> listSql = new List<string>();
            List<object> listPar = new List<object>();

            //校验
            IEnumerable<WX_ZZSCOrderExpressInfo> list = dal.Query<WX_ZZSCOrderExpressInfo>(string.Format(" OrderNum IN ('{0}')", string.Join("','", arrOrderNum)));
            IEnumerable<string> listOrderNum = arrOrderNum.Where(x => list.FirstOrDefault(y => y.OrderNum.Equals(x)) == null);

            foreach (var item in listOrderNum)
            {
                model.ID = Guid.NewGuid().ToString("N");
                model.OrderNum = item;
                model.ExpressCode = string.Empty;
                model.ExpressNum = string.Empty;
                model.ExpressType = string.Empty;
                model.Flag = 0;
                model.NowState = 0;
                model.State = 0;
                model.Remark = string.Empty;

                listSql.Add(dal.AddSQL());
                listPar.Add(model);
            }

            return dal.ExecuteTran(listSql, listPar);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 将订单的运单数据记录下来
        /// </summary>
        /// <param name="par1"></param>
        /// <param name="par2"></param>
        /// <param name="par3"></param>
        /// <param name="par4"></param>
        /// <returns></returns>
        public ActionResult OrderExpressOpe(string par1, string par2, string par3, string par4)
        {
            //Request Data
            string orderNum = par1;
            string addr = par2;
            string phoneNum = par3;
            string userName = par4;

            string[] arrOrderNum = orderNum.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

            WX_ZZSCOrderExpressInfo model = new WX_ZZSCOrderExpressInfo()
            {
                Address = addr,
                PhoneNum = phoneNum,
                UserName = userName,
                UserID = Session["UserID"].ToString()
            };

            bool result = new OrderExpressService().AddOrderExpress(arrOrderNum, model);

            return Content(string.Empty);
        }