示例#1
0
        ///<summary>
        ///查询所有托盘
        ///</summary>
        ///<returns></returns>
        public List <ContainerEntity> GetAllContainer(string warehouseCode, string state)
        {
            List <ContainerEntity> list = new List <ContainerEntity>();

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

                #region 正常错误处理

                JsonGetAllContainer bill = JsonConvert.DeserializeObject <JsonGetAllContainer>(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 (JsonGetAllContainerResult jbr in bill.result)
                {
                    ContainerEntity asnEntity = new ContainerEntity();
                    #region
                    asnEntity.ContainerCode     = jbr.ctCode;
                    asnEntity.ContainerName     = jbr.ctName;
                    asnEntity.ContainerType     = jbr.ctType;
                    asnEntity.ContainerTypeDesc = jbr.ctTypeDesc;
                    asnEntity.ContainerWeight   = StringToDecimal.GetTwoDecimal(jbr.ctWeight);
                    asnEntity.IsDelete          = Convert.ToInt32(jbr.isDeleted);
                    #endregion
                    list.Add(asnEntity);
                }
                return(list);

                #endregion
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message + ex.StackTrace);
            }
            return(list);
        }
示例#2
0
        /// <summary>
        /// 盘点单管理---跟库存实时比对,显示报告
        /// </summary>
        /// <param name="billID"></param>
        /// <returns></returns>
        public DataTable GetReportVsStock(int billID)
        {
            #region
            DataTable tblDatas = new DataTable("Datas");
            tblDatas.Columns.Add("ZN_NAME", Type.GetType("System.String"));
            tblDatas.Columns.Add("LC_CODE", Type.GetType("System.String"));
            tblDatas.Columns.Add("SKU_NAME", Type.GetType("System.String"));
            tblDatas.Columns.Add("COUNT_QTY", Type.GetType("System.Decimal"));
            tblDatas.Columns.Add("STOCK_QTY", Type.GetType("System.Decimal"));
            tblDatas.Columns.Add("DIFF_QTY", Type.GetType("System.Decimal"));
            tblDatas.Columns.Add("STOCK_EXP_DATE", Type.GetType("System.DateTime"));
            tblDatas.Columns.Add("EXP_DATE", Type.GetType("System.DateTime"));
            tblDatas.Columns.Add("IS_SYNC", Type.GetType("System.String"));

            #endregion

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

                #region 正常错误处理

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


                #region 赋值
                foreach (JsonGetReportVsStockResult tm in bill.result)
                {
                    DataRow newRow;
                    newRow              = tblDatas.NewRow();
                    newRow["ZN_NAME"]   = tm.znName;
                    newRow["LC_CODE"]   = tm.lcCode;
                    newRow["SKU_NAME"]  = tm.skuName;
                    newRow["COUNT_QTY"] = StringToDecimal.GetTwoDecimal(tm.countQty);
                    newRow["STOCK_QTY"] = StringToDecimal.GetTwoDecimal(tm.stockQty);
                    newRow["DIFF_QTY"]  = StringToDecimal.GetTwoDecimal(tm.countQty) - StringToDecimal.GetTwoDecimal(tm.stockQty);
                    if (!string.IsNullOrEmpty(tm.stockExpDate))
                    {
                        newRow["STOCK_EXP_DATE"] = tm.stockExpDate;
                    }
                    if (!string.IsNullOrEmpty(tm.expDate))
                    {
                        newRow["EXP_DATE"] = tm.expDate;
                    }
                    //newRow["IS_SYNC"] =;
                    tblDatas.Rows.Add(newRow);
                }
                return(tblDatas);

                #endregion
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
            return(tblDatas);
        }
示例#3
0
        /// <summary>
        /// 当前订单量	查询安全库存
        /// </summary>
        /// <returns></returns>
        public List <StockSafeSUPEntity> GetNotSafeStock()
        {
            List <StockSafeSUPEntity> list = new List <StockSafeSUPEntity>();

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

                #region 正常错误处理

                JsonGetNotSafeStock bill = JsonConvert.DeserializeObject <JsonGetNotSafeStock>(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 (JsonGetNotSafeStockResult jbr in bill.result)
                {
                    StockSafeSUPEntity asnEntity = new StockSafeSUPEntity();
                    #region 0-9
                    asnEntity.DIFF_QTY   = StringToDecimal.GetTwoDecimal(jbr.diffQty);
                    asnEntity.LC_CODE    = jbr.lcCode;
                    asnEntity.PIKING_QTY = StringToDecimal.GetTwoDecimal(jbr.pickingQty);
                    asnEntity.QTY        = StringToDecimal.GetTwoDecimal(jbr.qty);
                    asnEntity.SKU_CODE   = jbr.skuCode;
                    asnEntity.SKU_NAME   = jbr.skuName;
                    asnEntity.SPEC       = jbr.spec;
                    asnEntity.UM_NAME    = jbr.umName;
                    #endregion

                    #region
                    try
                    {
                        if (!string.IsNullOrEmpty(jbr.altestOut))
                        {
                            ;
                        }
                        //asnEntity. = Convert.ToDateTime(jbr.altestOut);
                    }
                    catch (Exception msg)
                    {
                        MsgBox.Warn(msg.Message);
                        //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg);
                    }
                    #endregion

                    list.Add(asnEntity);
                }
                return(list);

                #endregion
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
            return(list);
        }
示例#4
0
        ///<summary>
        ///查询所有计量单位组
        ///</summary>
        ///<returns></returns>
        public List <UnitGroupEntity> GetAllZJQ(int nums, int begin, out int total)
        {
            List <UnitGroupEntity> list = new List <UnitGroupEntity>();

            total = 0;
            try
            {
                #region 请求数据
                System.Text.StringBuilder loStr = new System.Text.StringBuilder();
                if (begin == 0)
                {
                    loStr.Append("beginRow=").Append("&");
                }
                else
                {
                    loStr.Append("beginRow=").Append(begin).Append("&");
                }
                loStr.Append("warehouseType=").Append(EUtilStroreType.WarehouseTypeToInt(GlobeSettings.LoginedUser.WarehouseType)).Append("&");
                if (begin == 0)
                {
                    loStr.Append("rows=");
                }
                else
                {
                    loStr.Append("rows=").Append(nums);
                }
                string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetAllZJQ);
                if (string.IsNullOrEmpty(jsonQuery))
                {
                    MsgBox.Warn(WebWork.RESULT_NULL);
                    //LogHelper.InfoLog(WebWork.RESULT_NULL);
                    return(list);
                }
                #endregion

                #region 正常错误处理

                JsonGetAllZJQ bill = JsonConvert.DeserializeObject <JsonGetAllZJQ>(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 (JsonGetAllZJQResult jbr in bill.result)
                {
                    UnitGroupEntity asnEntity = new UnitGroupEntity();
                    #region 0-10
                    asnEntity.Height     = StringToDecimal.GetTwoDecimal(jbr.height);
                    asnEntity.ID         = Convert.ToInt32(jbr.id);
                    asnEntity.IsActive   = jbr.isActive;
                    asnEntity.Length     = StringToDecimal.GetTwoDecimal(jbr.length);
                    asnEntity.Qty        = Convert.ToInt32(jbr.qty);
                    asnEntity.SkuBarcode = jbr.skuBarcode;
                    asnEntity.SkuCode    = jbr.skuCode;
                    asnEntity.SkuLevel   = Convert.ToInt32(jbr.skuLevel);
                    asnEntity.SkuName    = jbr.skuName;
                    asnEntity.Spec       = jbr.spec;
                    #endregion

                    #region 11-15
                    asnEntity.UnitCode = jbr.umCode;
                    asnEntity.UnitName = jbr.umName;
                    asnEntity.Weight   = StringToDecimal.GetTwoDecimal(jbr.weight);
                    asnEntity.Width    = StringToDecimal.GetTwoDecimal(jbr.width);
                    if (GlobeSettings.LoginedUser.WarehouseType == EWarehouseType.散货仓)
                    {
                        asnEntity.SkuLevel = Convert.ToInt32(jbr.skuLevel);
                        asnEntity.Skuvol   = StringToDecimal.GetTwoDecimal(jbr.skuVol);
                    }//
                    #endregion
                    list.Add(asnEntity);
                }

                total = bill.total;

                return(list);

                #endregion
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message + ex.StackTrace);
            }
            return(list);
        }
示例#5
0
        ///<summary>
        ///基础管理(物料信息-获取本库物料信息)
        ///</summary>
        ///<returns></returns>
        public List <MaterialEntity> GetLocalAll(int nums, int begin, out int total)
        {
            List <MaterialEntity> list = new List <MaterialEntity>();

            total = 0;
            try
            {
                #region 请求数据
                System.Text.StringBuilder loStr = new System.Text.StringBuilder();
                if (begin == 0)
                {
                    loStr.Append("beginRow=").Append("&");
                    loStr.Append("rows=");
                }
                else
                {
                    loStr.Append("beginRow=").Append(begin).Append("&");
                    loStr.Append("rows=").Append(nums);
                }

                string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetLocalAll);
                if (string.IsNullOrEmpty(jsonQuery))
                {
                    MsgBox.Warn(WebWork.RESULT_NULL);
                    //LogHelper.InfoLog(WebWork.RESULT_NULL);
                    return(list);
                }
                #endregion

                #region 正常错误处理

                JsonGetLocalAll bill = JsonConvert.DeserializeObject <JsonGetLocalAll>(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 (JsonGetLocalAllResult jbr in bill.result)
                {
                    MaterialEntity asnEntity = new MaterialEntity();
                    #region 0-10
                    asnEntity.BrandName    = jbr.brdName;
                    asnEntity.ExpDays      = Convert.ToInt32(jbr.expDays);
                    asnEntity.MaterialCode = jbr.skuCode;
                    asnEntity.MaterialName = jbr.skuName;
                    asnEntity.SkuType      = jbr.skuType;
                    asnEntity.SkuTypeDesc  = jbr.itemDesc;
                    asnEntity.MaxStockQty  = Convert.ToInt32(jbr.maxStockQty);
                    asnEntity.MinStockQty  = Convert.ToInt32(jbr.minStockQty);
                    asnEntity.SecurityQty  = Convert.ToInt32(jbr.securityQty);
                    asnEntity.Spec         = jbr.spec;
                    #endregion

                    #region 11-16
                    asnEntity.TemperatureCode  = jbr.tempCode;
                    asnEntity.TemperatureName  = jbr.tempName;
                    asnEntity.TotalStockQty    = StringToDecimal.GetTwoDecimal(jbr.totalStockQty);//Math.Round(Convert.ToDecimal(ret), 2);
                    asnEntity.MaterialTypeName = jbr.typName;
                    #endregion
                    list.Add(asnEntity);
                }

                total = bill.total;

                return(list);

                #endregion
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
            return(list);
        }
示例#6
0
        /// <summary>
        /// 盘点单管理---报告上传
        /// </summary>
        /// <param name="billID"></param>
        /// <returns></returns>
        public DataTable GetReportOnlyDiff(int billID)
        {
            #region DataTable
            DataTable tblDatas = new DataTable("Datas");
            tblDatas.Columns.Add("ZN_NAME", Type.GetType("System.String"));
            tblDatas.Columns.Add("LC_CODE", Type.GetType("System.String"));
            tblDatas.Columns.Add("SKU_NAME", Type.GetType("System.String"));
            tblDatas.Columns.Add("COUNT_QTY", Type.GetType("System.Decimal"));
            tblDatas.Columns.Add("STOCK_QTY", Type.GetType("System.Decimal"));
            tblDatas.Columns.Add("DIFF_QTY", Type.GetType("System.Decimal"));
            tblDatas.Columns.Add("STOCK_EXP_DATE", Type.GetType("System.DateTime"));
            tblDatas.Columns.Add("EXP_DATE", Type.GetType("System.DateTime"));
            tblDatas.Columns.Add("SPEC", Type.GetType("System.String"));
            tblDatas.Columns.Add("REMARK", Type.GetType("System.String"));
            tblDatas.Columns.Add("UPLOADED", Type.GetType("System.Boolean"));
            tblDatas.Columns.Add("SKU_CODE", Type.GetType("System.String"));
            tblDatas.Columns.Add("UM_NAME", Type.GetType("System.String"));
            tblDatas.Columns.Add("IS_EFFECT", Type.GetType("System.String"));
            tblDatas.Columns.Add("ID", Type.GetType("System.Int32"));
            tblDatas.Columns.Add("BILL_ID", Type.GetType("System.Int32"));

            #endregion

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

                #region 正常错误处理

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

                #region 赋值
                foreach (JsonGetReportOnlyDiffResult tm in bill.result)
                {
                    DataRow newRow;
                    newRow              = tblDatas.NewRow();
                    newRow["ZN_NAME"]   = tm.znName;
                    newRow["LC_CODE"]   = tm.lcCode;
                    newRow["SKU_NAME"]  = tm.skuName;
                    newRow["SKU_CODE"]  = tm.skuCode;
                    newRow["COUNT_QTY"] = StringToDecimal.GetTwoDecimal(tm.countQty);
                    newRow["STOCK_QTY"] = StringToDecimal.GetTwoDecimal(tm.stockQty);
                    newRow["DIFF_QTY"]  = StringToDecimal.GetTwoDecimal(tm.countQty) - StringToDecimal.GetTwoDecimal(tm.stockQty);
                    newRow["UM_NAME"]   = tm.umName;
                    newRow["ID"]        = Convert.ToInt32(tm.id);
                    newRow["BILL_ID"]   = Convert.ToInt32(tm.billId);
                    newRow["IS_EFFECT"] = tm.ifEffect;
                    newRow["SPEC"]      = tm.spec;
                    newRow["REMARK"]    = tm.remark;
                    newRow["UPLOADED"]  = Convert.ToBoolean(tm.uploaded);
                    if (!string.IsNullOrEmpty(tm.stockExpDate))
                    {
                        newRow["STOCK_EXP_DATE"] = tm.stockExpDate;
                    }
                    if (!string.IsNullOrEmpty(tm.expDate))
                    {
                        newRow["EXP_DATE"] = tm.expDate;
                    }
                    tblDatas.Rows.Add(newRow);
                }
                return(tblDatas);

                #endregion
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
            return(tblDatas);
        }
示例#7
0
        /// <summary>
        /// 当前订单量-当前订单量 未排序订单,传60,,已排序订单,不传

        /// </summary>
        /// <param name="wType"></param>
        /// <param name="billState"></param>
        /// <returns></returns>
        public List <BillSKUNum> GetBillPlans(EWarehouseType wType, string billState)
        {
            List <BillSKUNum> list = new List <BillSKUNum>();

            try
            {
                #region 请求数据
                System.Text.StringBuilder loStr = new System.Text.StringBuilder();
                loStr.Append("wType=").Append(EUtilStroreType.WarehouseTypeToInt(wType)).Append("&");
                loStr.Append("billState=").Append(billState);
                string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetBillPlans, 300000);
                if (string.IsNullOrEmpty(jsonQuery))
                {
                    MsgBox.Warn(WebWork.RESULT_NULL);
                    //LogHelper.InfoLog(WebWork.RESULT_NULL);
                    return(list);
                }
                #endregion

                #region 正常错误处理

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

                BillSKUNum sku = null;
                foreach (JsonGetBillPlansResult tm in bill.result)
                {
                    sku               = new BillSKUNum();
                    sku.SKUCode       = tm.skuCode;
                    sku.SKUName       = tm.skuName;
                    sku.Spec          = tm.spec;
                    sku.UmCode        = tm.umCode;
                    sku.UmName        = tm.umName;
                    sku.Qty           = Convert.ToDecimal(tm.qty);
                    sku.BillQty       = Convert.ToDecimal(tm.billQty);
                    sku.TotalQty      = StringToDecimal.GetTwoDecimal(tm.totalQty);
                    sku.StockTotalQty = StringToDecimal.GetTwoDecimal(tm.stockTotalQty);
                    sku.BackupQty     = StringToDecimal.GetTwoDecimal(tm.backupQty);
                    sku.IsCase        = Convert.ToInt32(tm.isCase);
                    sku.Flag          = Convert.ToInt32(tm.flag);
                    sku.AdviceQty     = tm.qtyAdviceQty;
                    sku.AdviceUmName  = tm.adviceUmName;

                    list.Add(sku);
                }
                return(list);

                #endregion
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
            return(list);
        }
示例#8
0
        /// <summary>
        /// 查询所有物料,用于物料维护,如果是填充其他界面,请调用GetActiveMaterials()函数
        /// </summary>
        /// <returns></returns>
        public List <MaterialEntity> GetAll()
        {
            List <MaterialEntity> list = new List <MaterialEntity>();

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

                #region 正常错误处理

                JsonGetAllSku bill = JsonConvert.DeserializeObject <JsonGetAllSku>(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 (JsonGetAllSkuResult jbr in bill.result)
                {
                    MaterialEntity asnEntity = new MaterialEntity();
                    #region 0-10
                    asnEntity.ExpDays      = Convert.ToInt32(jbr.expDays);
                    asnEntity.BrandName    = jbr.brdName;
                    asnEntity.MaterialCode = jbr.skuCode;
                    asnEntity.MaterialName = jbr.skuName;
                    asnEntity.MaxStockQty  = Convert.ToInt32(jbr.maxStockQty);
                    asnEntity.MinStockQty  = Convert.ToInt32(jbr.minStockQty);
                    asnEntity.SecurityQty  = Convert.ToInt32(jbr.securityQty);
                    asnEntity.SkuType      = jbr.skuType;
                    asnEntity.SkuTypeDesc  = jbr.itemDesc;
                    asnEntity.Spec         = jbr.spec;
                    #endregion

                    #region 11-20
                    asnEntity.TemperatureName  = jbr.tempName;
                    asnEntity.TemperatureCode  = jbr.tempCode;
                    asnEntity.TotalStockQty    = StringToDecimal.GetTwoDecimal(jbr.totalStockQty);
                    asnEntity.MaterialTypeName = jbr.typName;
                    //asnEntity.UnitGrpCode
                    #endregion
                    try
                    {
                        //if (!string.IsNullOrEmpty(jbr.closeDate))
                        //    asnEntity.CloseDate = Convert.ToDateTime(jbr.closeDate);
                        //if (!string.IsNullOrEmpty(jbr.printedTime))
                        //    asnEntity.PrintedTime = Convert.ToDateTime(jbr.printedTime);
                        //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);
        }
示例#9
0
        /// <summary>
        /// 装车信息--查询所有
        /// </summary>
        /// <returns></returns>
        public List <VehicleEntity> GetCarAll()
        {
            List <VehicleEntity> list = new List <VehicleEntity>();

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

                #region 正常错误处理

                JsonGetCarAll bill = JsonConvert.DeserializeObject <JsonGetCarAll>(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 (JsonGetCarAllResult jbr in bill.result)
                {
                    VehicleEntity asnEntity = new VehicleEntity();
                    asnEntity.ID            = Convert.ToInt32(jbr.id);
                    asnEntity.IsActive      = jbr.isActive;
                    asnEntity.RouteCode     = jbr.rtCode;
                    asnEntity.RouteName     = jbr.rtName;
                    asnEntity.UserCode      = jbr.userCode;
                    asnEntity.UserName      = jbr.userName;
                    asnEntity.UserPhone     = jbr.mobilePhone;
                    asnEntity.VehicleCode   = jbr.vhCode;
                    asnEntity.VehicleNO     = jbr.vhNo;
                    asnEntity.VehicleVolume = StringToDecimal.GetTwoDecimal(jbr.vhVolume);//Math.Round(Convert.ToDecimal(ret), 2);//Convert.ToDecimal(jbr.vhVolume);
                    asnEntity.VhAttri       = jbr.vhAttri;
                    asnEntity.VhType        = jbr.vhType;
                    asnEntity.VhAttriStr    = jbr.itemDesc;
                    asnEntity.VhTypeStr     = jbr.typeDesc;
                    list.Add(asnEntity);
                }
                return(list);

                #endregion
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
            return(list);
        }
示例#10
0
        /// <summary>
        /// 查询库存修正记录
        /// </summary>
        /// <param name="lc_code"></param>
        /// <param name="dateBegin"></param>
        /// <param name="dateEnd"></param>
        /// <returns></returns>
        public DataTable GetStockReviseRecords(DateTime?dateBegin, DateTime?dateEnd, int nums, int begin, out int total)
        {
            total = 0;

            #region
            DataTable tblDatas = new DataTable("Datas");
            tblDatas.Columns.Add("lcCode", Type.GetType("System.String"));
            tblDatas.Columns.Add("skuCode", Type.GetType("System.String"));
            tblDatas.Columns.Add("oldStockQty", Type.GetType("System.Decimal"));
            tblDatas.Columns.Add("newStockQty", Type.GetType("System.Decimal"));
            tblDatas.Columns.Add("CZ_USER", Type.GetType("System.String"));
            tblDatas.Columns.Add("FH_USER", Type.GetType("System.String"));
            tblDatas.Columns.Add("createtime", Type.GetType("System.DateTime"));
            tblDatas.Columns.Add("UM_NAME", Type.GetType("System.String"));
            tblDatas.Columns.Add("SKU_NAME", Type.GetType("System.String"));
            tblDatas.Columns.Add("DIFFQTY", Type.GetType("System.Decimal"));
            #endregion

            try
            {
                #region 请求数据
                System.Text.StringBuilder loStr = new System.Text.StringBuilder();
                loStr.Append("dateBegin=").Append(dateBegin).Append("&");
                if (begin == 0)
                {
                    loStr.Append("beginRow=").Append("&");
                    loStr.Append("rows=").Append("&");
                }
                else
                {
                    loStr.Append("beginRow=").Append(begin).Append("&");
                    loStr.Append("rows=").Append(nums).Append("&");
                }
                loStr.Append("dateEnd=").Append(dateEnd);
                string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_GetStockReviseRecords);
                if (string.IsNullOrEmpty(jsonQuery))
                {
                    MsgBox.Warn(WebWork.RESULT_NULL);
                    //LogHelper.InfoLog(WebWork.RESULT_NULL);
                    return(tblDatas);
                }
                #endregion

                #region 正常错误处理

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

                #region 赋值
                foreach (JsonGetStockReviseRecordsResult tm in bill.result)
                {
                    DataRow newRow;
                    #region
                    newRow                = tblDatas.NewRow();
                    newRow["lcCode"]      = tm.lcCode;
                    newRow["skuCode"]     = tm.skuCode;
                    newRow["oldStockQty"] = StringToDecimal.GetTwoDecimal(tm.oldStockQty);
                    newRow["newStockQty"] = StringToDecimal.GetTwoDecimal(tm.newStockQty);
                    newRow["CZ_USER"]     = tm.czUser;
                    newRow["FH_USER"]     = tm.fhUser;
                    newRow["createtime"]  = Convert.ToDateTime(tm.createtime);
                    newRow["UM_NAME"]     = tm.umName;
                    newRow["SKU_NAME"]    = tm.skuName;
                    newRow["DIFFQTY"]     = StringToDecimal.GetTwoDecimal(tm.diffqty);
                    #endregion

                    tblDatas.Rows.Add(newRow);
                }

                total = bill.total;

                return(tblDatas);

                #endregion
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
            return(tblDatas);
        }
示例#11
0
        /// <summary>
        /// 当前订单量--双击,查看明细
        /// </summary>
        /// <param name="skuCode"></param>
        /// <returns></returns>
        public DataTable GetSKULocation(string skuCode)
        {
            #region
            DataTable tblDatas = new DataTable("Datas");
            tblDatas.Columns.Add("ZN_NAME", Type.GetType("System.String"));
            tblDatas.Columns.Add("LC_CODE", Type.GetType("System.String"));
            tblDatas.Columns.Add("SKU_NAME", Type.GetType("System.String"));
            tblDatas.Columns.Add("SKU_CODE", Type.GetType("System.String"));
            tblDatas.Columns.Add("STOCKQTY", Type.GetType("System.String"));
            tblDatas.Columns.Add("STOCKUMNAME", Type.GetType("System.String"));
            tblDatas.Columns.Add("SALEUMNAME", Type.GetType("System.String"));
            #endregion

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

                #region 正常错误处理

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

                List <JsonVehiclesEntity> jb = new List <JsonVehiclesEntity>();
                #region 赋值
                foreach (JsonGetSKULocationResult tm in bill.result)
                {
                    DataRow newRow;
                    newRow                = tblDatas.NewRow();
                    newRow["ZN_NAME"]     = tm.znName;
                    newRow["LC_CODE"]     = tm.lcCode;
                    newRow["SKU_NAME"]    = tm.skuName;
                    newRow["SKU_CODE"]    = tm.skuCode;
                    newRow["STOCKQTY"]    = StringToDecimal.GetTwoDecimal(tm.stockQty);
                    newRow["STOCKUMNAME"] = tm.stockUmName;
                    newRow["SALEUMNAME"]  = tm.saleUmName;
                    tblDatas.Rows.Add(newRow);
                }
                return(tblDatas);

                #endregion
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
            return(tblDatas);
        }
示例#12
0
        /// <summary>
        /// 物料信息编辑
        /// </summary>
        /// <param name="sku_code"></param>
        /// <returns></returns>
        public List <UnitGroupEntity> GetUmName(string sku_code)
        {
            List <UnitGroupEntity> list = new List <UnitGroupEntity>();

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

                #region 正常错误处理

                JsonGetUmName bill = JsonConvert.DeserializeObject <JsonGetUmName>(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 (JsonGetUmNameResult jbr in bill.result)
                {
                    UnitGroupEntity asnEntity = new UnitGroupEntity();
                    #region 0-10
                    asnEntity.Height   = StringToDecimal.GetTwoDecimal(jbr.height);
                    asnEntity.ID       = Convert.ToInt32(jbr.id);
                    asnEntity.IsActive = jbr.isActive;
                    asnEntity.Length   = StringToDecimal.GetTwoDecimal(jbr.length);
                    //jbr.namePy;
                    asnEntity.Qty        = Convert.ToInt32(jbr.qty);
                    asnEntity.SkuBarcode = jbr.skuBarCode;
                    asnEntity.SkuCode    = jbr.skuCode;
                    asnEntity.SkuLevel   = Convert.ToInt32(jbr.skuLevel);
                    asnEntity.SkuName    = jbr.skuName;
                    asnEntity.Spec       = jbr.spec;
                    #endregion
                    #region 11-15
                    asnEntity.UnitCode = jbr.umCode;
                    asnEntity.UnitName = jbr.umName;
                    asnEntity.Weight   = StringToDecimal.GetTwoDecimal(jbr.weight);
                    asnEntity.Width    = StringToDecimal.GetTwoDecimal(jbr.width);
                    #endregion

                    list.Add(asnEntity);
                }
                return(list);

                #endregion
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
            return(list);
        }
示例#13
0
        public void StringToDecimal_InputTooBigValues_ThrowsOverflowException(string number, int scale)
        {
            Notation notation = new Notation(scale);

            NUnit.Framework.Assert.Throws <OverflowException>(() => StringToDecimal.ConvertingToDecimal(number, notation));
        }
示例#14
0
        public void StringToDecimal_InpotNullOrEmptyValues_ThrowsNullException(string number, int scale)
        {
            Notation notation = new Notation(scale);

            NUnit.Framework.Assert.Throws <ArgumentNullException>(() => StringToDecimal.ConvertingToDecimal(number, notation));
        }
示例#15
0
        public int StringToDecimal_CorrectValues_PositiveTest(string number, int scale)
        {
            Notation notation = new Notation(scale);

            return(StringToDecimal.ConvertingToDecimal(number, notation));
        }