Example #1
0
        public static string SendGoods(string guids, string logisNo, string logisName, string logisCost, string logisMobile)
        {
            BasicSecurity basic = new BasicSecurity();
            string msg = string.Empty;
            //if (string.IsNullOrEmpty(guid) || string.IsNullOrEmpty(logisNo) || string.IsNullOrEmpty(logisName) || string.IsNullOrEmpty(logisCost)) return "";

            if (string.IsNullOrEmpty(guids) || basic.UserName == "") return "登陆超时";
            guids = guids.TrimEnd(',');
            Guid groupid = Guid.NewGuid();
            List<T_ERP_BatchOrder> bch = new List<T_ERP_BatchOrder>();
            T_ERP_BatchOrder bo = null;
            string[] newlist = guids.Split(',');
            foreach (string str in newlist)
            {
            bo = new T_ERP_BatchOrder();
            bo.Creator = bo.Updator = basic.UserName;
            bo.IsDel = bo.Reserved3 = true;
            bo.Reserved2 = bo.Remark = "";
            bo.Reserved1 = 0;
            bo.Guid = Guid.Parse(str);
            bo.GroupId = groupid;
            bch.Add(bo);
            }
            SerNoCaller.Calr_BatchOrder.Add(bch);
            Ultra.Logic.ResultData rd = SerNoCaller.Calr_SuppBatch.ExecSql("exec P_ERP_SendGoods @0,@1,@2,@3,@4,@5,@6", guids, groupid, logisNo, logisName, logisCost, logisMobile, basic.UserName);
            if (rd.QueryCount > 0)
            {
                msg = "发货成功";
            }
            else
            {
                msg = rd.ErrMsg;
            }
            return msg;
        }
Example #2
0
 public static string SendGoods(string guids, string logisNo, string logisName, string logisCost, string logisMobile)
 {
     //BasicSecurity basic = new BasicSecurity();
     string msg = string.Empty;
     //if (string.IsNullOrEmpty(guid) || string.IsNullOrEmpty(logisNo) || string.IsNullOrEmpty(logisName) || string.IsNullOrEmpty(logisCost)) return "";
     string userName = HttpUtility.UrlDecode(HttpContext.Current.Request.Cookies["Login"]["UserName"].ToString());
     if (string.IsNullOrEmpty(guids) || userName == "") return "登陆超时";
     guids = guids.TrimEnd(',');
     Guid groupid = Guid.NewGuid();
     List<T_ERP_BatchOrder> bch = new List<T_ERP_BatchOrder>();
     T_ERP_BatchOrder bo = null;
     string[] newlist = guids.Split(',');
     var bchlist = SerNoCaller.Calr_SuppBatch.Get("Where SuppName = @0 and  Guid in (@1)", userName, guids);
     var isPrint = bchlist.Where(j => j.Reserved1 == 0).ToList().Count();
     if (isPrint > 0)
     {
         return msg = "该数据不能发货,请先打印";
     }
     var isSendGoods = bchlist.Where(j => j.IsSendGoods).ToList().Count();
     if (isSendGoods > 0)
     {
         return msg = "该数据已发生变化,请刷新后操作";
     }
     foreach (string str in newlist)
     {
     bo = new T_ERP_BatchOrder();
     bo.Creator = bo.Updator = userName;
     bo.IsDel = bo.Reserved3 = true;
     bo.Reserved2 = bo.Remark = "";
     bo.Reserved1 = 0;
     bo.Guid = Guid.Parse(str);
     bo.GroupId = groupid;
     bch.Add(bo);
     }
     SerNoCaller.Calr_BatchOrder.Add(bch);
     Ultra.Logic.ResultData rd = SerNoCaller.Calr_SuppBatch.ExecSql("exec P_ERP_SendGoods @0,@1,@2,@3,@4,@5,@6,@7,@8", guids, groupid, logisNo, logisName, logisCost, logisMobile, userName,bchlist.FirstOrDefault().IsClear,bchlist.FirstOrDefault().BatchCode);
     if (rd.QueryCount > 0)
     {
         msg = "发货成功";
     }
     else
     {
         msg = rd.ErrMsg;
     }
     return msg;
 }