Example #1
0
        /// <summary>
        /// 盘点单管理--落放位
        /// </summary>
        /// <param name="billID"></param>
        /// <returns></returns>
        public List <CountDetailEntity> GetCountLocation(int billID)
        {
            List <CountDetailEntity> list = new List <CountDetailEntity>();

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

                #region 正常错误处理

                JsonGetCountLocation bill = JsonConvert.DeserializeObject <JsonGetCountLocation>(jsonQuery);
                if (bill == null)
                {
                    MsgBox.Warn(WebWork.JSON_DATA_NULL);
                    return(list);
                }
                if (bill.flag != 0)
                {
                    MsgBox.Warn(bill.error);
                    return(list);
                }
                #endregion

                #region 赋值数据
                foreach (JsonGetCountLocationResult jbr in bill.result)
                {
                    CountDetailEntity asnEntity = new CountDetailEntity();
                    asnEntity.BillID        = Convert.ToInt32(jbr.billId);
                    asnEntity.CellCode      = jbr.cellCode;
                    asnEntity.FloorCode     = jbr.floorCode;
                    asnEntity.ID            = Convert.ToInt32(jbr.id);
                    asnEntity.Location      = jbr.lcCode;
                    asnEntity.LocationState = jbr.lcState;
                    asnEntity.PassageCode   = jbr.passageCode;
                    asnEntity.ShelfCode     = jbr.shelfCode;
                    asnEntity.ZoneCode      = jbr.znCode;
                    asnEntity.ZoneName      = jbr.znName;
                    list.Add(asnEntity);
                }
                return(list);

                #endregion
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
            return(list);
        }
Example #2
0
        private List <CountDetailEntity> GetCheckedLocations()
        {
            List <CountDetailEntity> locations = new List <CountDetailEntity>();

            int[] rowIndexs = gridView1.GetSelectedRows();
            foreach (int i in rowIndexs)
            {
                if (gridView1.IsDataRow(i))
                {
                    CountDetailEntity loc = gridView1.GetRow(i) as CountDetailEntity;
                    locations.Add(loc);
                }
            }

            return(locations);
        }
Example #3
0
        /// <summary>
        /// 盘点单管理--盘点记录
        /// </summary>
        /// <param name="billID"></param>
        /// <returns></returns>
        public List <CountDetailEntity> GetCountRecords(int billID)
        {
            List <CountDetailEntity> list = new List <CountDetailEntity>();

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

                #region 正常错误处理

                JsonGetCountRecords bill = JsonConvert.DeserializeObject <JsonGetCountRecords>(jsonQuery);
                if (bill == null)
                {
                    MsgBox.Warn(WebWork.JSON_DATA_NULL);
                    return(list);
                }
                if (bill.flag != 0)
                {
                    MsgBox.Warn(bill.error);
                    return(list);
                }
                #endregion

                #region 赋值数据
                foreach (JsonGetCountRecordsResult jbr in bill.result)
                {
                    CountDetailEntity asnEntity = new CountDetailEntity();
                    asnEntity.BillID       = Convert.ToInt32(jbr.billId);
                    asnEntity.ID           = Convert.ToInt32(jbr.id);
                    asnEntity.Location     = jbr.lcCode;
                    asnEntity.MaterialCode = jbr.skuCode;
                    asnEntity.MaterialName = jbr.skuName;
                    asnEntity.Qty          = Convert.ToDecimal(jbr.qty);
                    asnEntity.UserCode     = jbr.userCode;
                    asnEntity.UserName     = jbr.userName;
                    asnEntity.ZoneCode     = jbr.znCode;
                    asnEntity.ZoneName     = jbr.znName;
                    //jbr.skuBarCode;
                    try
                    {
                        if (!string.IsNullOrEmpty(jbr.createDate))
                        {
                            asnEntity.CreateDate = Convert.ToDateTime(jbr.createDate);
                        }
                    }
                    catch (Exception msg)
                    {
                        MsgBox.Warn(msg.Message);
                        //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg);
                    }
                    list.Add(asnEntity);
                }
                return(list);

                #endregion
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
            return(list);
        }