private void Bind()
        {
            Guid Id = Guid.Empty;

            if (!string.IsNullOrWhiteSpace(Request.QueryString["Id"]))
            {
                Guid.TryParse(Request.QueryString["Id"], out Id);
            }
            BindControl bc = new BindControl();

            if (!Id.Equals(Guid.Empty))
            {
                var bll   = new OrderReceiptProduct();
                var model = bll.GetModelByJoin(Id);
                if (model != null)
                {
                    hOrderProductId.Value             = model.Id.ToString();
                    hProductId.Value                  = model.ProductId.ToString();
                    hPackageId.Value                  = model.PackageId.ToString();
                    txtExpectedQty.Value              = model.ExpectedQty.ToString();
                    txtReceiptQty.Value               = model.ReceiptQty.ToString();
                    txtProductPurchaseOrderCode.Value = model.PurchaseOrderCode;
                    txtSort.Value           = model.Sort.ToString();
                    txtaProductRemark.Value = model.Remark;
                    txtPackageName.Value    = model.PackageName;
                    txtSupplierName.Value   = model.SupplierName;
                    txtProduceDate.Value    = model.ProduceDate;
                    txtQualityStatus.Value  = model.QualityStatus;
                    txtCheckQuantity.Value  = model.CheckQuantity.ToString();
                    txtRejectQuantity.Value = model.RejectQuantity.ToString();
                    txtQCStatus.Value       = model.QCStatus;

                    txtProduct.Value = model.ProductCode;
                    txtPackage.Value = model.PackageCode;

                    bc.BindDdl(ddlOrderReceiptStatus, typeof(EnumData.EnumReceiptOrderStatus), model.Status);
                    bc.BindDdl(ddlUnit, typeof(EnumData.EnumUnitLevel), model.Unit);
                    bc.BindDdl(ddlIsOk, typeof(EnumData.EnumIsOk), model.IsQCNeed ? "是":"否");
                }
            }
            else
            {
                hProductId.Value = Guid.Empty.ToString();
                hPackageId.Value = Guid.Empty.ToString();

                bc.BindDdl(ddlOrderReceiptStatus, typeof(EnumData.EnumReceiptOrderStatus), EnumData.EnumReceiptOrderStatus.新建.ToString());
                bc.BindDdl(ddlUnit, typeof(EnumData.EnumUnitLevel), "");
                bc.BindDdl(ddlIsOk, typeof(EnumData.EnumIsOk), "");
            }
        }
示例#2
0
        public ResResultModel GetSkuModel(object orderId, string productCode)
        {
            Guid gId = Guid.Empty;

            if (orderId != null)
            {
                Guid.TryParse(orderId.ToString(), out gId);
            }
            if (gId.Equals(Guid.Empty))
            {
                return(ResResult.Response(false, "参数值不正确", ""));
            }
            if (string.IsNullOrWhiteSpace(productCode))
            {
                return(ResResult.Response(false, "参数值不正确", ""));
            }
            var orpBll = new OrderReceiptProduct();
            var model  = orpBll.GetModelByProductcode(gId, productCode);

            if (model == null)
            {
                return(ResResult.Response(false, "数据不存在或已被删除", ""));
            }

            var stlBll   = new StockLocation();
            var stlModel = stlBll.GetList(1, 1, "", null).FirstOrDefault();

            if (stlModel == null)
            {
                return(ResResult.Response(false, "未找到任何库位", ""));
            }

            var skuModel = new PdaSkuModel();

            skuModel.ExpectedAmount    = model.ExpectedQty;
            skuModel.ReceiptAmount     = model.ReceiptQty;
            skuModel.ProductId         = model.ProductId;
            skuModel.PackageId         = model.PackageId;
            skuModel.Unit              = model.Unit;
            skuModel.StockLocationId   = stlModel.Id;
            skuModel.StockLocationCode = stlModel.Code;
            skuModel.StockLocationName = stlModel.Named;

            return(ResResult.Response(true, "调用成功", JsonConvert.SerializeObject(skuModel)));
        }
示例#3
0
        public PrintOrderInfo GetPrintOrderReceipt(Guid Id)
        {
            var data = new PrintOrderInfo();

            data.Title      = "收货单";
            data.SPrintDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm");

            var bll   = new OrderReceipt();
            var oInfo = bll.GetModel(Id);

            data.OrderCode         = oInfo.OrderCode;
            data.PurchaseOrderCode = "";
            data.SupplierName      = "";
            data.SPlanArrivalTime  = "";
            data.SPlanArrivalTime  = "";

            var t1 = Task.Factory.StartNew(() =>
            {
                BarcodeHelper bh     = new BarcodeHelper();
                data.BarcodeImageUri = bh.CreateBarcode(data.OrderCode);
            });

            var orpBll   = new OrderReceiptProduct();
            var sqlWhere = "and orp.OrderId = @OrderId ";
            var parm     = new SqlParameter("@OrderId", oInfo.Id);
            var pList    = orpBll.GetListByJoin(sqlWhere, parm);

            if (pList != null && pList.Count > 0)
            {
                var cargoList = new List <PrintOrderCargoInfo>();
                foreach (var item in pList)
                {
                    cargoList.Add(new PrintOrderCargoInfo("", item.ProductCode, item.ProductName, "", "", item.PackageCode, item.PackageName, item.Unit, item.ExpectedQty, item.ReceiptQty, ""));
                }
                data.CargoList = cargoList;
                //data.CargoList = JsonConvert.SerializeObject(cargoList);
            }

            t1.Wait();

            return(data);
        }