コード例 #1
0
        /// <summary>
        /// 反向审核,取消货位锁定
        /// </summary>
        /// <param name="BillNo"></param>
        /// <returns></returns>
        public bool Rev_Validate(string BillNo)
        {
            bool flag = false;

            using (PersistentManager persistentManager = new PersistentManager())
            {
                MoveBillMasterDao dao    = new MoveBillMasterDao();
                DataSet           dsTemp = dao.GetData("select * from v_wms_move_billdetail where BILLNO='" + BillNo + "'");
                StringBuilder     sb     = new StringBuilder();
                foreach (DataRow row in dsTemp.Tables[0].Rows)
                {
                    sb.Append(string.Format("update WMS_WH_CELL SET ISLOCKED='0' WHERE CELLCODE IN ('{0}','{1}');", row["OUT_CELLCODE"].ToString(), row["IN_CELLCODE"].ToString()));
                }
                sb.Append(string.Format("update WMS_MOVE_BILLMASTER SET STATUS='1', VALIDATEPERSON='',VALIDATEDATE=null where BILLNO='{0}'", BillNo));
                dao.SetData(sb.ToString());
                flag = true;
            }
            return(flag);
        }
コード例 #2
0
 public string GetNewBillNo()
 {
     using (PersistentManager persistentManager = new PersistentManager())
     {
         MoveBillMasterDao dao = new MoveBillMasterDao();
         DataSet           ds  = dao.GetData(string.Format("select TOP 1 BILLNO FROM WMS_MOVE_BILLMASTER where BILLNO LIKE '{0}%' order by BILLNO DESC", System.DateTime.Now.ToString("yyyyMMdd")));
         if (ds.Tables[0].Rows.Count == 0)
         {
             return(System.DateTime.Now.ToString("yyyyMMdd") + "0001" + "M");
         }
         else
         {
             int i = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString().Substring(8, 4));
             i++;
             string newcode = i.ToString();
             for (int j = 0; j < 4 - i.ToString().Length; j++)
             {
                 newcode = "0" + newcode;
             }
             return(System.DateTime.Now.ToString("yyyyMMdd") + newcode + "M");
         }
     }
 }