コード例 #1
0
        protected override void InitForm(System.Web.UI.HtmlControls.HtmlForm form)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["Goods_ID"]))
            {
                mGoods = WebBLUtil.GetSingleDmo <Goods>(new Tuple <string, object>("ID", long.Parse(Request.QueryString["Goods_ID"])));
            }

            base.InitForm(form);
        }
コード例 #2
0
        public static IDQExpression 部门或上级部门条件(long deptID, JoinAlias alias = null)
        {
            var department = WebBLUtil.GetSingleDmo <Department>("ID", deptID);

            if (alias != null)
            {
                return(DQCondition.Or(from i in Range(1, department.Depth)
                                      select DQCondition.EQ(alias, "Department_ID", department.NodePath[i])));
            }
            return(DQCondition.Or(from i in Range(1, department.Depth)
                                  select DQCondition.EQ("Department_ID", department.NodePath[i])));
        }
コード例 #3
0
        public static GoodsInfoDto Get(long?id)
        {
            if (id == null)
            {
                return(null);
            }
            var goodsInfo = new GoodsInfoDto();

            var goods = WebBLUtil.GetSingleDmo <Goods>("ID", id, "SecondUnit", "UnitConvertDirection", "MainUnit", "MainUnitRatio", "SecondUnitRatio");

            goodsInfo.Goods_SecondUnit           = goods.SecondUnit;
            goodsInfo.Goods_MainUnit             = goods.MainUnit;
            goodsInfo.Goods_UnitConvertDirection = goods.UnitConvertDirection;
            goodsInfo.Goods_MainUnitRatio        = goods.MainUnitRatio;
            goodsInfo.Goods_SecondUnitRatio      = goods.SecondUnitRatio;
            return(goodsInfo);
        }
コード例 #4
0
        private void AddDetails(TitlePanel titlePanel)
        {
            var vPanel = titlePanel.EAdd(new VLayoutPanel());

            if (CanSave)
            {
                var hPanel = vPanel.Add(new HLayoutPanel(), new VLayoutOption(HorizontalAlign.Left));
                hPanel.Add(new SimpleLabel("选择计数名称"));
                var selectGoods = hPanel.Add(new ChoiceBox(B3ButcheryDataSource.计数名称)
                {
                    Width = Unit.Pixel(130), EnableMultiSelection = true, EnableInputArgument = true, AutoPostBack = true
                });
                selectGoods.SelectedValueChanged += delegate
                {
                    _detailGrid.GetFromUI();
                    if (!selectGoods.IsEmpty)
                    {
                        foreach (var item in selectGoods.GetValues())
                        {
                            var detail = new FrozenInStoreSetBill_Detail {
                                CalculateGoods_ID = long.Parse(item)
                            };
                            var goods = WebBLUtil.GetSingleDmo <CalculateGoods>("ID", long.Parse(item));
                            detail.CalculateGoods_MainUnit   = goods.MainUnit;
                            detail.CalculateGoods_Name       = goods.Name;
                            detail.CalculateGoods_Code       = goods.Code;
                            detail.CalculateGoods_MainUnit   = goods.MainUnit;
                            detail.CalculateGoods_SecondUnit = goods.SecondUnit;
                            detail.CalculateCatalog_ID       = goods.CalculateCatalog_ID;
                            detail.CalculateCatalog_Name     = goods.CalculateCatalog_Name;
                            detail.SecondUnitII = goods.SecondUnitII;
                            Dmo.Details.Add(detail);
                        }
                    }
                    selectGoods.Clear();
                    _detailGrid.DataBind();
                };

                var addGoodsbt = hPanel.Add(new DialogButton
                {
                    Text = "选择计数名称",
                });
                addGoodsbt.Url    = "/B3Butchery/Dialogs/SelectCalculateGoodsDialog.aspx";
                addGoodsbt.Click += delegate
                {
                    _detailGrid.GetFromUI();
                    var details = DialogUtil.GetCachedObj <TemGoodsDetail>(this);
                    foreach (var temGoodsDetail in details)
                    {
                        var detail = new FrozenInStoreSetBill_Detail {
                            CalculateGoods_ID = temGoodsDetail.Goods_ID
                        };
                        //DmoUtil.RefreshDependency(detail, "Goods_ID");
                        var goods = WebBLUtil.GetSingleDmo <CalculateGoods>("ID", temGoodsDetail.Goods_ID);
                        detail.CalculateGoods_MainUnit   = goods.MainUnit;
                        detail.CalculateGoods_Name       = goods.Name;
                        detail.CalculateGoods_Code       = goods.Code;
                        detail.CalculateGoods_MainUnit   = goods.MainUnit;
                        detail.CalculateGoods_SecondUnit = goods.SecondUnit;
                        detail.CalculateCatalog_ID       = goods.CalculateCatalog_ID;
                        detail.CalculateCatalog_Name     = goods.CalculateCatalog_Name;
                        detail.SecondUnitII = goods.SecondUnitII;

                        Dmo.Details.Add(detail);
                    }
                    _detailGrid.DataBind();
                };
            }

            var editor = new DFCollectionEditor <FrozenInStoreSetBill_Detail>(() => Dmo.Details)
            {
                AllowDeletionFunc = () => CanSave,
                CanDeleteFunc     = detail => true,
                IsEditableFunc    = (field, detail) => CanSave
            };

            _detailGrid = new DFEditGrid(editor)
            {
                DFGridSetEnabled = false, Width = Unit.Percentage(100)
            };

            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("CalculateCatalog_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("CalculateGoods_Code"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("CalculateGoods_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("CalculateGoods_MainUnit"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("CalculateGoods_SecondUnit"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("SecondUnitII"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("DefaultNumber1"));

            _detailGrid.ValueColumns.Add("CalculateGoods_ID");
            var section = mPageLayoutManager.AddSection("DetaiColumns", "明细列");

            titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name);
            section.ApplyLayout(_detailGrid, mPageLayoutManager, DFInfo.Get(typeof(FrozenInStoreSetBill_Detail)));

            vPanel.Add(_detailGrid);
        }
コード例 #5
0
        private void AddDetails(TitlePanel titlePanel)
        {
            var vPanel = titlePanel.EAdd(new VLayoutPanel());

            if (CanSave)
            {
                var hPanel = vPanel.Add(new HLayoutPanel(), new VLayoutOption(HorizontalAlign.Left));
                hPanel.Add(new SimpleLabel("选择存货"));
                var selectGoods = hPanel.Add(new ChoiceBox(B3ButcheryDataSource.存货带编号)
                {
                    Width = Unit.Pixel(130), EnableMultiSelection = true, EnableInputArgument = true, AutoPostBack = true
                });
                selectGoods.SelectedValueChanged += delegate
                {
                    _detailGrid.GetFromUI();
                    if (!selectGoods.IsEmpty)
                    {
                        foreach (var item in selectGoods.GetValues())
                        {
                            var d = new FrozenOutStore_Detail {
                                Goods_ID = long.Parse(item)
                            };
                            var goods = WebBLUtil.GetSingleDmo <Goods>("ID", long.Parse(item));
                            d.Goods_MainUnit             = goods.MainUnit;
                            d.Goods_Name                 = goods.Name;
                            d.Goods_Code                 = goods.Code;
                            d.Goods_UnitConvertDirection = goods.UnitConvertDirection;

                            Dmo.Details.Add(d);
                        }
                    }
                    selectGoods.Clear();
                    _detailGrid.DataBind();
                };

                var addGoodsbt = hPanel.Add(new DialogButton
                {
                    Text = "选择存货",
                });
                addGoodsbt.Url    = "/B3Butchery/Dialogs/SelectGoodsDialog.aspx";
                addGoodsbt.Click += delegate
                {
                    _detailGrid.GetFromUI();
                    var details = DialogUtil.GetCachedObj <TemGoodsDetail>(this);
                    foreach (var temGoodsDetail in details)
                    {
                        var detail = new FrozenOutStore_Detail {
                            Goods_ID = temGoodsDetail.Goods_ID
                        };
                        //DmoUtil.RefreshDependency(detail, "Goods_ID");
                        var goods = WebBLUtil.GetSingleDmo <Goods>("ID", temGoodsDetail.Goods_ID);
                        detail.Goods_MainUnit             = goods.MainUnit;
                        detail.Goods_Name                 = goods.Name;
                        detail.Goods_Code                 = goods.Code;
                        detail.Goods_UnitConvertDirection = goods.UnitConvertDirection;
                        Dmo.Details.Add(detail);
                    }
                    _detailGrid.DataBind();
                };
            }

            var editor = new DFCollectionEditor <FrozenOutStore_Detail>(() => Dmo.Details)
            {
                AllowDeletionFunc = () => CanSave,
                CanDeleteFunc     = detail => true,
                IsEditableFunc    = (field, detail) => CanSave
            };

            _detailGrid = new DFEditGrid(editor)
            {
                DFGridSetEnabled = false, Width = Unit.Percentage(100)
            };
            var productPlanCol = new DFEditGridColumn <DFChoiceBox>("ProductPlan_ID");

            productPlanCol.InitEditControl += delegate(object sender, InitEditControlEventArgs <DFChoiceBox> e)
            {
                e.Control.DataKind            = B3ButcheryDataSource.计划号;
                e.Control.DFDisplayField      = "ProductPlan_Name";
                e.Control.EnableInputArgument = true;
                e.Control.EnableTopItem       = true;
                e.Control.Width = Unit.Pixel(120);
            };

            _detailGrid.Columns.EAdd(new DFEditGridColumn <DFValueLabel>("Goods_Name")).HeaderText = "半成品名称";
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Code"));
            _detailGrid.Columns.EAdd(new DFEditGridColumn <DFValueLabel>("Goods2_Name")).HeaderText = "成品名称";
            _detailGrid.Columns.Add(new DFEditGridColumn <DFTextBox>("Number"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_MainUnit"));
            _detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("SecondNumber"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_SecondUnit"));

            _detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("SecondNumber2"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_SecondUnit2"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFTextBox>("Remark"));



            new Main_Second2_ConvertRatioRowManager(_detailGrid, "Number", "SecondNumber2");
            mDFContainer.AddNonDFControl(_detailGrid, "$DetailGrid");

            var section = mPageLayoutManager.AddSection("DetaiColumns", "明细列");

            titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name);

            section.ApplyLayout(_detailGrid, mPageLayoutManager, DFInfo.Get(typeof(FrozenOutStore_Detail)));

            vPanel.Add(_detailGrid);
        }