예제 #1
0
        /// <summary>
        /// 拣货计划 :保存拣配结果 之 : 查询临时表信息 (拣货临时表和缺货临时表)
        /// </summary>
        /// <param name="tempID"></param>
        /// <returns></returns>
        public JsonGetTempPickResult GetTempPickResult(string tempID)
        {
            JsonGetTempPickResult temp = new JsonGetTempPickResult();

            try
            {
                #region 请求数据
                System.Text.StringBuilder loStr = new System.Text.StringBuilder();
                loStr.Append("tempID=").Append(tempID);
                string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetTempPickResult);
                if (string.IsNullOrEmpty(jsonQuery))
                {
                    MsgBox.Warn(WebWork.RESULT_NULL);
                    //LogHelper.InfoLog(WebWork.RESULT_NULL);
                    return(temp);
                }
                #endregion

                #region 正常错误处理

                JsonGetTempPickResult bill = JsonConvert.DeserializeObject <JsonGetTempPickResult>(jsonQuery);
                if (bill == null)
                {
                    MsgBox.Warn(WebWork.JSON_DATA_NULL);
                    return(temp);
                }
                if (bill.flag != 0)
                {
                    MsgBox.Warn(bill.error);
                    return(temp);
                }
                #endregion
                if (bill.result != null)
                {
                    return(bill);
                }
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
            return(temp);
        }
예제 #2
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            //this._pickResult = soDal.GetTempPickResult(this.tempID);
            //this._pickResultError = soDal.GetTempPickResultError(this.tempID);

            ////读取临时保存的拣配结果
            //bindingSource1.DataSource = this._pickResult;
            //bindingSource2.DataSource = this._pickResultError;

            #region 接口
            JsonGetTempPickResult temp          = GetTempPickResult(this.tempID);
            List <PickPlanEntity> listPick      = new List <PickPlanEntity>();
            List <PickPlanEntity> listPickError = new List <PickPlanEntity>();
            if (temp.result != null)
            {
                if (temp.result[0].picktemp != null)
                {
                    #region 赋值数据 拣货临时表
                    foreach (JsonGetTempPickResultPick jbr in temp.result[0].picktemp)
                    {
                        PickPlanEntity asnEntity = new PickPlanEntity();
                        #region 0-10
                        asnEntity.BillID       = Convert.ToInt32(jbr.billId);
                        asnEntity.BillNO       = jbr.billNo;
                        asnEntity.ComMaterial  = jbr.comMaterial;
                        asnEntity.CustomerName = jbr.customerName;
                        asnEntity.DetailID     = Convert.ToInt32(jbr.detailID);
                        asnEntity.IsCase       = Convert.ToInt32(jbr.isCase);
                        asnEntity.Location     = jbr.location;
                        asnEntity.Material     = jbr.skuCode;
                        asnEntity.MaterialName = jbr.skuName;
                        asnEntity.Qty          = Convert.ToDecimal(jbr.qty);
                        #endregion
                        asnEntity.RowNO    = Convert.ToInt32(jbr.rowNO);
                        asnEntity.UnitName = jbr.unitName;
                        asnEntity.UnitCode = jbr.unitCode;
                        asnEntity.STOCK_ID = Convert.ToInt32(jbr.stockId);
                        //try
                        //{
                        //    if (!string.IsNullOrEmpty(jbr.createDate))
                        //        asnEntity.CreateData = Convert.ToDateTime(jbr.createDate);
                        //    if (!string.IsNullOrEmpty(jbr.expDate))
                        //        asnEntity.ExpDate = Convert.ToDateTime(jbr.expDate);
                        //}
                        //catch (Exception msg)
                        //{
                        //    LogHelper.errorLog("FrmListPickPlan+GetPickPlan", msg);
                        //}
                        listPick.Add(asnEntity);
                    }
                    #endregion
                }

                if (temp.result[0].picktemperror != null)
                {
                    #region 赋值数据 缺货临时表
                    foreach (JsonGetTempPickResultPickErr err in temp.result[0].picktemperror)
                    {
                        PickPlanEntity asnEntity = new PickPlanEntity();
                        #region 0-10
                        asnEntity.BillID       = Convert.ToInt32(err.billId);
                        asnEntity.BillNO       = err.billNo;
                        asnEntity.ComMaterial  = err.comMaterial;
                        asnEntity.CustomerName = err.customerName;
                        asnEntity.UnitName     = err.unitName;
                        asnEntity.Qty          = Convert.ToDecimal(err.qty);
                        asnEntity.DisableQty   = Convert.ToDecimal(err.DisableQty);
                        asnEntity.DisableQty2  = Convert.ToDecimal(err.disableQty2);
                        asnEntity.Material     = err.material;
                        asnEntity.MaterialName = err.materialName;
                        asnEntity.PickZnType   = err.pickZnType;
                        asnEntity.StockQty     = Convert.ToDecimal(err.stockQty);
                        asnEntity.SaleQty      = Convert.ToInt32(err.saleQty);
                        asnEntity.SecurityQty  = Convert.ToInt32(err.securityQty);
                        #endregion

                        //try
                        //{
                        //    if (!string.IsNullOrEmpty(jbr.createDate))
                        //        asnEntity.CreateData = Convert.ToDateTime(jbr.createDate);
                        //    if (!string.IsNullOrEmpty(jbr.expDate))
                        //        asnEntity.ExpDate = Convert.ToDateTime(jbr.expDate);
                        //}
                        //catch (Exception msg)
                        //{
                        //    LogHelper.errorLog("FrmListPickPlan+GetPickPlan", msg);
                        //}
                        listPickError.Add(asnEntity);
                    }
                    #endregion
                }
            }
            this._pickResult      = listPick;
            this._pickResultError = listPickError;
            #endregion

            //读取临时保存的拣配结果
            bindingSource1.DataSource = this._pickResult;
            bindingSource2.DataSource = this._pickResultError;

            //if (!string.IsNullOrEmpty(errMsg))
            //{
            //    errMsg = FormatErrMsg(errMsg);
            //    memoEdit1.Text = errMsg;
            //}
        }