Beispiel #1
0
        private void AddDetails(TitlePanel titlePanel)
        {
            var vPanel = titlePanel.EAdd(new VLayoutPanel());
            var toobar = new HLayoutPanel();

            vPanel.Add(toobar, new VLayoutOption(HorizontalAlign.Left));

            if (CanSave)
            {
                AddToolsPanel(toobar);
            }

            //      AddCopyAndPaste(toobar);

            var editor = new DFCollectionEditor <PackingBagType_Detail>(() => Dmo.Details);

            editor.AllowDeletionFunc = () => CanSave;

            editor.CanDeleteFunc  = detail => true;
            editor.IsEditableFunc = (field, detail) => CanSave;

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

            _detailGrid.ShowLineNo = true;
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Code"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Spec"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("ProductShift_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("GoodsProperty_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Abbreviation"));

            _detailGrid.Columns.EAdd(new DFEditGridColumn <DFChoiceBox>("GoodsPacking_ID")).InitEditControl +=
                (sender, e) =>
            {
                e.Control.Width               = Unit.Percentage(100);
                e.Control.DataKind            = B3UnitedInfosConsts.DataSources.存货;
                e.Control.EnableTopItem       = true;
                e.Control.EnableInputArgument = true;
                e.Control.DFDisplayField      = "GoodsPacking_Name";
            };

            _detailGrid.Columns.Add(new DFEditGridColumn <DFTextBox>("StandNumber"));



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

            titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name);

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

            vPanel.Add(_detailGrid);
        }
Beispiel #2
0
        private void AddDetails(TitlePanel titlePanel)
        {
            var vPanel = titlePanel.EAdd(new VLayoutPanel());
            var toobar = new HLayoutPanel();

            vPanel.Add(toobar, new VLayoutOption(HorizontalAlign.Left));

            if (CanSave)
            {
                AddToolsPanel(toobar);
            }

            //      AddCopyAndPaste(toobar);

            var editor = new DFCollectionEditor <PackagingTransfer_Detail>(() => Dmo.Details);

            editor.AllowDeletionFunc = () => CanSave;

            editor.CanDeleteFunc  = detail => true;
            editor.IsEditableFunc = (field, detail) => CanSave;

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

            _detailGrid.ShowLineNo = true;
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("OutGoods_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Code"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Spec"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("ProductionPlan_PlanNumber"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("GoodsPacking_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("SecondNumber"));
            var section = mPageLayoutManager.AddSection("DetaiColumns", "明细列");

            titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name);

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

            vPanel.Add(_detailGrid);
        }
Beispiel #3
0
        void InitToolBar(TitlePanel panel)
        {
            var toolbar = new HLayoutPanel();

            toolbar.CssClass += "LeftPaddingWrapper";
            panel.EAdd(toolbar);
            var exporter = new Exporter();

            toolbar.Add(new TSButton("导出到Excel", delegate {
                var lastQuery = detailGrid.LastQuery;
                if (lastQuery == null)
                {
                    throw new Exception("请先进行查询");
                }
                var dom = new LoadArguments((DQueryDom)lastQuery.DQuery.Clone());
                foreach (var colIndex in lastQuery.SumColumns)
                {
                    dom.SumColumns.Add(colIndex);
                }
                foreach (var colIndex in lastQuery.GroupSumColumns)
                {
                    dom.GroupSumColumns.Add(colIndex);
                }
                dom.DQuery.Range = SelectRange.All;
                string fileName  = "班组包材领用测算表.xlsx";
                exporter.Export(new QueryResultExcelExporter(fileName, GetQueryResult(dom)));
            }));
            toolbar.Add(exporter);


            var preBtn = new TSButton("预览");

            preBtn.OnClientClick = "preventEventDefault(event);if(window.__printUrl){Preview(window.__printUrl);}else{alert('先搜索出结果才能打印');}";
            toolbar.Add(preBtn);

            var printBtn = new TSButton("打印");

            printBtn.OnClientClick = "preventEventDefault(event);if(window.__printUrl){Print(window.__printUrl);}else{alert('先搜索出结果才能打印');}";
            toolbar.Add(printBtn);
        }
Beispiel #4
0
        private void CreateDetailPanel(TitlePanel vPanel)
        {
            detailGrid = vPanel.EAdd(new DFBrowseGrid(new DFDataTableEditor())
            {
                Width = Unit.Percentage(100)
            });
            detailGrid.Columns.EAdd(new DFBrowseGridColumn("Goods_Name"));
            detailGrid.Columns.Add(new DFBrowseGridColumn("PlanNumber_Name"));
            detailGrid.Columns.Add(new DFBrowseGridColumn("计数规格"));
            detailGrid.Columns.EAdd(new DFBrowseGridColumn("盘数")).SumMode = SumMode.Sum;
            detailGrid.Columns.EAdd(new DFBrowseGridColumn("袋数")).SumMode = SumMode.Sum;
            detailGrid.Columns.EAdd(new DFBrowseGridColumn("重量")).SumMode = SumMode.Sum;
            detailGrid.Columns.Add(new DFBrowseGridColumn("包装模式"));

            var section = mPageLayoutManager.AddSection("DetailColumns", "布局");

            section.ApplyLayout(detailGrid, mPageLayoutManager, DFInfo.Get(typeof(ProduceOutput_Detail)));
            vPanel.SetPageLayoutSetting(mPageLayoutManager, section.Name);


            InitToolBar(vPanel);
        }
Beispiel #5
0
        private void CreateQueryPanel(TitlePanel titlePanel)
        {
            var       vPanel     = titlePanel.EAdd(new VLayoutPanel());
            var       tablePanel = vPanel.Add(new TableLayoutPanel(5, 5), new VLayoutOption(System.Web.UI.WebControls.HorizontalAlign.Justify));
            var       row        = 0;
            const int labelWidth = 4;

            tablePanel.Add(0, 1, row, row + 1, new SimpleLabel("日期", labelWidth));
            dateInput = tablePanel.Add(1, 2, row, ++row, new DFDateTimeInput()
            {
                Date = DateTime.Today
            });
            tablePanel.Add(1, 2, row, ++row, new LiteralControl("~"));
            enddateInput = tablePanel.Add(1, 2, row, ++row, new DFDateTimeInput()
            {
                Date = DateTime.Today.AddDays(1).AddSeconds(-1)
            });
            tablePanel.Add(0, 1, row, row + 1, new SimpleLabel("班组"));
            tablePanel.Add(1, 2, row, ++row, CreateShiftPart());

            tablePanel.Add(0, 1, row, row + 1, new SimpleLabel("装箱模式"));
            tablePanel.Add(1, 2, row, ++row, CreatePackModePart());
        }
Beispiel #6
0
        private void CreateDetailPanel(TitlePanel titlePanel)
        {
            var hPanel = titlePanel.EAdd(new HLayoutPanel());

            hPanel.Add(new LiteralControl("<h2>入库清单:</h2>"));
            if (CanSave)
            {
                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 ProductInStore_Temp_Detail()
                            {
                                Goods_ID = long.Parse(item)
                            };
                            DmoUtil.RefreshDependency(d, "Goods_ID");
                            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 ProductInStore_Temp_Detail();
                        detail.Goods_ID = temGoodsDetail.Goods_ID;
                        DmoUtil.RefreshDependency(detail, "Goods_ID");
                        Dmo.Details.Add(detail);
                    }
                    detailGrid.DataBind();
                };
            }
            var detailGridEditor = new DFCollectionEditor <ProductInStore_Temp_Detail>(() => Dmo.Details);

            detailGridEditor.AllowDeletionFunc = () => CanSave;
            detailGridEditor.CanDeleteFunc     = (detail) => CanSave;
            detailGridEditor.IsEditableFunc    = (field, detail) => CanSave;
            detailGrid = titlePanel.EAdd(new DFEditGrid(detailGridEditor)
            {
                Width = Unit.Percentage(100)
            });
            detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Name"));
            detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Code"));
            detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Spec"));
            new MainToSecondConvertRowManger(detailGrid);
            var section = mPageLayoutManager.AddSection("DetailColumns", "明细列");

            section.ApplyLayout(detailGrid, mPageLayoutManager, DFInfo.Get(typeof(ProductInStore_Temp_Detail)));
            titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name);
            var hPanel2 = new HLayoutPanel()
            {
                Align = HorizontalAlign.Left
            };

            titlePanel.Controls.Add(detailGrid);
        }
Beispiel #7
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);
        }
Beispiel #8
0
        private void CreateDetailPanel(TitlePanel titlePanel)
        {
            var hPanel = titlePanel.EAdd(new HLayoutPanel());

            hPanel.Add(new LiteralControl("<h2>入库清单:</h2>"));
            if (CanSave)
            {
                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 ProductInStore_Temp_Detail()
                            {
                                Goods_ID = long.Parse(item), ProductionDate = DateTime.Today, Price = 0
                            };
                            DmoUtil.RefreshDependency(d, "Goods_ID");
                            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 ProductInStore_Temp_Detail();
                        detail.Goods_ID = temGoodsDetail.Goods_ID;
                        DmoUtil.RefreshDependency(detail, "Goods_ID");
                        detail.TaxRate      = detail.Goods_TaxRate;
                        detail.Number       = temGoodsDetail.Number;
                        detail.SecondNumber = temGoodsDetail.SecondNumber;
                        Dmo.Details.Add(detail);
                    }
                    detailGrid.DataBind();
                };

                var updateButton = hPanel.Add(new TSButton("更新生产计划号", delegate
                {
                    GetFromUI();
                    foreach (var item in Dmo.Details)
                    {
                        item.ProductPlan_ID   = Dmo.ProductPlan_ID;
                        item.ProductPlan_Name = Dmo.ProductPlan_Name;
                    }
                    detailGrid.DataBind();
                }));
            }


            var detailGridEditor = new DFCollectionEditor <ProductInStore_Temp_Detail>(() => Dmo.Details);

            detailGridEditor.AllowDeletionFunc = () => CanSave;
            detailGridEditor.CanDeleteFunc     = (detail) => CanSave;
            detailGridEditor.IsEditableFunc    = (field, detail) => CanSave;
            detailGrid = titlePanel.EAdd(new DFEditGrid(detailGridEditor)
            {
                Width = Unit.Percentage(100)
            });
            detailGrid.Columns.Add(new DFEditGridColumn("ProductionDate"));
            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.Add(productPlanCol);
            detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Name"));
            detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Code"));
            var script = @"
var id =parseInt(this.front.value);
simpleRestCall('/MainSystem/B3Butchery/Rpcs/GoodsBatchRpc/Get',
[id,['ProductionDate','QualityDays']],
function(result,dfContainer){
  dfContainer.setValue('ProductionDate',getDateTime(result.ProductionDate));
  dfContainer.setValue('QualityDays',result.QualityDays );
},{context:this.dfContainer});";

            detailGrid.Columns.EAdd(new DFEditGridColumn <DFChoiceBox>("GoodsBatch_ID")).InitEditControl += (sender, e) =>
            {
                e.Control.EnableTopItem    = true;
                e.Control.OnBeforeDrop     = "this.codeArgument = dfContainer.getValue('Goods_ID');this.dialogArguments='Goods_ID=' + this.codeArgument+'&TaxRate='+dfContainer.getValue('TaxRate')+'&TmpTaxRate='+dfContainer.getValue('TmpTaxRate')";
                e.Control.DataKind         = B3UnitedInfosConsts.DataSources.存货批次;
                e.Control.DFDisplayField   = "GoodsBatch_Name";
                e.Control.DialogUrl        = WpfPageUrl.ToGlobal("~/B3Butchery/Dialogs/GoodsBatchEdit.aspx?IsNewDialog=1");
                e.Control.OnClientSelected = script;
                e.Control.Width            = Unit.Pixel(160);
            };
            detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Spec"));
            detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("Number")).SumMode = SumMode.Sum;;
            detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_MainUnit"));
            detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("SecondNumber")).SumMode = SumMode.Sum;;
            detailGrid.Columns.Add(new DFEditGridColumn <DFTextBox>("Price"));
            detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("Money")).SumMode = SumMode.Sum;;
            detailGrid.Columns.Add(new DFEditGridColumn <DFTextBox>("Remark"));
            detailGrid.ValueColumns.Add("Goods_ID");
            detailGrid.ValueColumns.Add("Goods_UnitConvertDirection");
            detailGrid.ValueColumns.Add("Goods_MainUnitRatio");
            detailGrid.ValueColumns.Add("Goods_SecondUnitRatio");
            new MainToSecondConvertRowManger(detailGrid);
            var section = mPageLayoutManager.AddSection("DetailColumns", "明细列");

            section.ApplyLayout(detailGrid, mPageLayoutManager, DFInfo.Get(typeof(ProductInStore_Temp_Detail)));
            titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name);
            var hPanel2 = new HLayoutPanel()
            {
                Align = HorizontalAlign.Left
            };

            titlePanel.Controls.Add(detailGrid);
        }
Beispiel #9
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);
        }
Beispiel #10
0
        private void AddDetail(TitlePanel titlePanel)
        {
            var vPanel = titlePanel.EAdd(new VLayoutPanel());

            if (CanSave)
            {
                var hPanel = new HLayoutPanel();
                vPanel.Add(hPanel, new VLayoutOption(HorizontalAlign.Left));
                hPanel.Add(new SimpleLabel("选择存货"));
                var selectGoods = new ChoiceBox(B3UnitedInfosConsts.DataSources.存货)
                {
                    Width = Unit.Pixel(130), EnableInputArgument = true, AutoPostBack = true, EnableTopItem = true, EnableMultiSelection = true
                };
                selectGoods.SelectedValueChanged += delegate
                {
                    detailGrid.GetFromUI();
                    if (!selectGoods.IsEmpty)
                    {
                        var gids = selectGoods.GetValues().Distinct();
                        foreach (var g in gids)
                        {
                            if (Dmo.Details.Any(x => x.Goods_ID == long.Parse(g)))
                            {
                                continue;
                            }
                            var d = new Picking_Detail()
                            {
                                Goods_ID = long.Parse(g)
                            };
                            DmoUtil.RefreshDependency(d, "Goods_ID");
                            Dmo.Details.Add(d);
                        }
                    }
                    selectGoods.Clear();
                    detailGrid.DataBind();
                };
                hPanel.Add(selectGoods);
            }

            var editor = new DFCollectionEditor <Picking_Detail>(() => Dmo.Details);

            editor.AllowDeletionFunc = () => CanSave;
            editor.IsEditableFunc    = (field, detail) => CanSave;
            editor.CanDeleteFunc     = detail => CanSave;

            detailGrid = new DFEditGrid(editor)
            {
                Width = Unit.Percentage(100)
            };
            detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Code"));
            detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Name"));
            detailGrid.Columns.EAdd(new DFEditGridColumn <DFValueLabel>("Goods_Spec"));
            detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("Number"));
            detailGrid.Columns.EAdd(new DFEditGridColumn <DFValueLabel>("Goods_MainUnit"));
            detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("SecondNumber"));
            detailGrid.Columns.EAdd(new DFEditGridColumn <DFValueLabel>("Goods_SecondUnit"));
            detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("Remark"));

            detailGrid.ValueColumns.Add("Goods_ID");
            detailGrid.ValueColumns.Add("Goods_UnitConvertDirection");
            detailGrid.ValueColumns.Add("Goods_MainUnitRatio");
            detailGrid.ValueColumns.Add("Goods_SecondUnitRatio");
            mDFContainer.AddNonDFControl(detailGrid, "$detailGrid");

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

            section.SetRequired("Number", "SecondNumber");
            section.ApplyLayout(detailGrid, mPageLayoutManager, DFInfo.Get(typeof(Picking_Detail)));
            new NumberSecondNumberConvertRowMangerWithMoneyChanged(detailGrid);
            vPanel.Add(detailGrid);
        }
Beispiel #11
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 selectEmp = hPanel.Add(new ChoiceBox(B3UnitedInfosConsts.DataSources.存货)
                {
                    Width = Unit.Pixel(130), EnableInputArgument = true, AutoPostBack = true
                });
                selectEmp.SelectedValueChanged += delegate
                {
                    _detailGrid.GetFromUI();
                    if (!selectEmp.IsEmpty)
                    {
                        var empID = long.Parse(selectEmp.Value);

                        var d = new WorkShopRecord()
                        {
                            Goods_ID = empID
                        };
                        DmoUtil.RefreshDependency(d, "Goods_ID");
                        Dmo.Details.Add(d);
                    }
                    selectEmp.Clear();
                    _detailGrid.DataBind();
                };
            }

            var editor = new DFCollectionEditor <WorkShopRecord>(() => 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>("Goods_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Code"));

            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("PlanNumber_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("ChaCarBoardCode"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("BarCode"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFTextBox>("Number"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_MainUnit"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFTextBox>("SecondNumber"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_SecondUnit"));

            _detailGrid.Columns.Add(new DFEditGridColumn <DFTextBox>("SecondNumber2"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_SecondUnitII"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Remark"));
            var section = mPageLayoutManager.AddSection("DetaiColumns", "明细列");

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

            vPanel.Add(_detailGrid);
        }
Beispiel #12
0
        private void AddDetails(TitlePanel titlePanel)
        {
            var vPanel = titlePanel.EAdd(new VLayoutPanel());
            var toobar = new HLayoutPanel();

            vPanel.Add(toobar, new VLayoutOption(HorizontalAlign.Left));

            if (CanSave)
            {
                AddToolsPanel(toobar);
            }

//      AddCopyAndPaste(toobar);

            var editor = new DFCollectionEditor <PackingRecipients_Detail>(() => Dmo.Details);

            editor.AllowDeletionFunc = () => CanSave;

            editor.CanDeleteFunc  = detail => true;
            editor.IsEditableFunc = (field, detail) => CanSave;

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

            _detailGrid.ShowLineNo = true;
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("GoodsGoods_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Code"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Spec"));
            _detailGrid.Columns.EAdd(new DFEditGridColumn <DFChoiceBox>("PlanNumber_ID")).InitEditControl += (sender, e) =>
            {
                e.Control.DFDisplayField      = "PlanNumber_Name";
                e.Control.EnableTopItem       = true;
                e.Control.EnableInputArgument = true;
                e.Control.DataKind            = B3ButcheryDataSource.计划号;
                e.Control.Width = Unit.Percentage(100);
            };
            _detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("Number")).SumMode = SumMode.Sum;
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_MainUnit"));
            _detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("SecondNumber")).SumMode = SumMode.Sum;
            _detailGrid.Columns.EAdd(new DFEditGridColumn <DFValueLabel>("Goods_SecondUnit"));

            _detailGrid.Columns.Add(new DFEditGridColumn("Remark"));


            _detailGrid.ValueColumns.Add("Goods_ID");
            _detailGrid.ValueColumns.Add("Goods_UnitConvertDirection");
            _detailGrid.ValueColumns.Add("Goods_MainUnitRatio");
            _detailGrid.ValueColumns.Add("Goods_SecondUnitRatio");
            mDFContainer.AddNonDFControl(_detailGrid, "$detailGrid");


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

            titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name);
            section.SetRequired("Number");
            section.ApplyLayout(_detailGrid, mPageLayoutManager, DFInfo.Get(typeof(PackingRecipients_Detail)));

            vPanel.Add(_detailGrid);

            var scriptManager = new GoodsEditGridScriptManager(_detailGrid, "Number");

            titlePanel.Controls.Add(scriptManager);
        }
Beispiel #13
0
        private void CreateDetailPanel(TitlePanel titlePanel)
        {
            var hPanel = titlePanel.EAdd(new HLayoutPanel());

            hPanel.Add(new LiteralControl("<h2>入库清单:</h2>"));
            AddToolsBar(hPanel);

            hPanel.Add(new TSButton("复制", delegate
            {
                GoodsDetailSummaryClipboardUtil.Copy(Dmo.Details.Select((item) => (GoodsDetailSummaryBase)item).ToList());
                AspUtil.Alert(this, "复制成功");
            }));

            if (CanSave)
            {
                hPanel.Add(new TSButton("粘贴", delegate
                {
                    var list = GoodsDetailSummaryClipboardUtil.Paste <ProductInStore_Detail>();
                    foreach (var detail in list)
                    {
                        Dmo.Details.Add(detail);

                        DmoUtil.RefreshDependency(detail, "Goods_ID");
                    }
                    detailGrid.DataBind();
                }));
            }
            if (CanSave)
            {
                if (EnableAddSameCargoSpace)
                {
                    AddSameCargoSpace(hPanel);
                }
            }

            var detailGridEditor = new DFCollectionEditor <ProductInStore_Detail>(() => Dmo.Details);

            detailGridEditor.AllowDeletionFunc = () => CanSave;
            detailGridEditor.CanDeleteFunc     = (detail) => CanSave;
            detailGridEditor.IsEditableFunc    = (field, detail) => {
                switch (field.Name)
                {
                case "GoodsBatch_ID":
                    return(GoodsUtil.EnableBatch(detail.Goods_ID, detail.GoodsProperty_ID) && CanSave);

                case "Money":
                    return(false);

                case "SecondNumber":
                    var hasSecondUnit = !string.IsNullOrEmpty(detail.Goods_SecondUnit);
                    return(CanSave && hasSecondUnit);
                }

                return(CanSave);
            };
            detailGrid = titlePanel.EAdd(new DFEditGrid(detailGridEditor)
            {
                Width = Unit.Percentage(100), ShowLineNo = true
            });
            mDFContainer.AddNonDFControl(detailGrid, "$DetailGrid");
            detailGrid.NextRowOnEnter = true;
            detailGrid.LastRowOnDown  = "__DFContainer.getControl('$SelectGoods').behind.focus();";
            if (GlobalFlags.get(B3UnitedInfosConsts.GlobalFlags.库存支持品牌项))
            {
                detailGrid.Columns.Add(new DFEditGridColumn("BrandItem_ID"));
            }
            detailGrid.Columns.Add(new DFEditGridColumn("ProductionDate"));
            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.Add(productPlanCol);
            detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Name"));
            detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Code"));
            var script = @"
var id =parseInt(this.front.value);
simpleRestCall('/MainSystem/B3Butchery/Rpcs/GoodsBatchRpc/Get',
[id,['ProductionDate']],
function(result,dfContainer){
  dfContainer.setValue('ProductionDate',getDateTime(result.ProductionDate));
},{context:this.dfContainer});";

            detailGrid.Columns.EAdd(new DFEditGridColumn <DFChoiceBox>("GoodsBatch_ID")).InitEditControl += (sender, e) =>
            {
                e.Control.EnableTopItem    = true;
                e.Control.OnBeforeDrop     = "this.codeArgument = dfContainer.getValue('Goods_ID');this.dialogArguments='Goods_ID=' + this.codeArgument+'&TaxRate='+dfContainer.getValue('TaxRate')+'&TmpTaxRate='+dfContainer.getValue('TmpTaxRate')";
                e.Control.DataKind         = B3UnitedInfosConsts.DataSources.存货批次;
                e.Control.DFDisplayField   = "GoodsBatch_Name";
                e.Control.DialogUrl        = WpfPageUrl.ToGlobal("~/B3Butchery/Dialogs/GoodsBatchEdit.aspx?IsNewDialog=1");
                e.Control.OnClientSelected = script;
                e.Control.Width            = Unit.Pixel(160);
            };
            detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Spec"));
            var cargoSpaceColumn = detailGrid.Columns.EAdd(new DFEditGridColumn <DFChoiceBox>("CargoSpace_ID"));

            cargoSpaceColumn.InitEditControl += (sender, e) =>
            {
                e.Control.EnableTopItem  = true;
                e.Control.OnBeforeDrop   = "this.codeArgument = __DFContainer.getValue('Store_ID');";
                e.Control.DataKind       = B3FrameworksConsts.DataSources.货位;
                e.Control.DFDisplayField = "CargoSpace_Name";
                e.Control.Width          = Unit.Pixel(160);
            };
            detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("Number")).SumMode = SumMode.Sum;
            detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_MainUnit"));
            detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_SecondUnit"));
            detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("SecondNumber")).SumMode = SumMode.Sum;
            if (CheckDefaultRole("隐藏单价"))
            {
                detailGrid.Columns.Add(new DFEditGridColumn <DFTextBox>("Price"));
            }
            AddColumn(detailGrid);
            if (CheckDefaultRole("隐藏单价"))
            {
                detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("Money")).SumMode = SumMode.Sum;
            }
            detailGrid.Columns.Add(new DFEditGridColumn <DFTextBox>("Remark"));
            detailGrid.ValueColumns.Add("Goods_ID");
            detailGrid.ValueColumns.Add("Goods_UnitConvertDirection");
            detailGrid.ValueColumns.Add("Goods_MainUnitRatio");
            detailGrid.ValueColumns.Add("Goods_SecondUnitRatio");
            new MainToSecondConvertRowManger(detailGrid);
            var section = mPageLayoutManager.AddSection("DetailColumns", "明细列");

            section.ApplyLayout(detailGrid, mPageLayoutManager, DFInfo.Get(typeof(ProductInStore_Detail)));
            titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name);
        }
Beispiel #14
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(B3UnitedInfosConsts.DataSources.存货)
                {
                    Width = Unit.Pixel(130), EnableMultiSelection = true, EnableInputArgument = true, AutoPostBack = true
                });
                selectGoods.SelectedValueChanged += delegate
                {
                    _detailGrid.GetFromUI();
                    if (!selectGoods.IsEmpty)
                    {
                        foreach (var item in selectGoods.GetValues())
                        {
                            if (Dmo.Details.Any(x => x.Goods_ID == long.Parse(item)))
                            {
                                continue;
                            }

                            var detail = new WorkShopCountConfig_Detail {
                                Goods_ID = long.Parse(item)
                            };
                            DmoUtil.RefreshDependency(detail, "Goods_ID");
                            Dmo.Details.Add(detail);
                        }
                    }
                    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 WorkShopCountConfig_Detail { Goods_ID = temGoodsDetail.Goods_ID };
                //        DmoUtil.RefreshDependency(detail, "Goods_ID");



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

            var editor = new DFCollectionEditor <WorkShopCountConfig_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>("Goods_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Code"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("GoodsProperty_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_MainUnit"));
            _detailGrid.Columns.EAdd(new DFEditGridColumn <DFValueLabel>("Goods_MainUnitRatio")).HeaderText = "主辅换算主单位比例";
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_SecondUnit"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_SecondUnitII_MainUnitRatio"));

            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_SecondUnitII"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFTextBox>("DefaultNumber1"));


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

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

            vPanel.Add(_detailGrid);
        }
Beispiel #15
0
        private void AddPayDetails(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 = new ChoiceBox(B3UnitedInfosConsts.DataSources.存货)
                {
                    Width = Unit.Pixel(130), EnableInputArgument = true, AutoPostBack = true, EnableTopItem = true, EnableMultiSelection = true
                };
                selectGoods.SelectedValueChanged += delegate
                {
                    _detailGrid.GetFromUI();
                    if (!selectGoods.IsEmpty)
                    {
                        var gids = selectGoods.GetValues().Distinct();
                        foreach (var g in gids)
                        {
                            var d = new ClientGoodsSet_Detail()
                            {
                                Goods_ID = long.Parse(g)
                            };
                            DmoUtil.RefreshDependency(d, "Goods_ID");
                            Dmo.Details.Add(d);
                        }
                    }
                    selectGoods.Clear();
                    _detailGrid.DataBind();
                };


                hPanel.Add(selectGoods);
                var addGoods = hPanel.Add(new DialogButton
                {
                    Text = "选择存货",
                });
                addGoods.Url    = "SelectGoodsDialogs.aspx";
                addGoods.Click += delegate
                {
                    _detailGrid.GetFromUI();
                    foreach (var goodsID in DialogUtil.GetCachedObj <long>(this))
                    {
                        if (Dmo.Details.Any(x => x.Goods_ID == goodsID))
                        {
                            continue;
                        }
                        var detail = new ClientGoodsSet_Detail()
                        {
                            Goods_ID = goodsID
                        };
                        DmoUtil.RefreshDependency(detail, "Goods_ID");
                        Dmo.Details.Add(detail);
                    }
                    _detailGrid.DataBind();
                };
            }
            ;


            var editor = new DFCollectionEditor <ClientGoodsSet_Detail>(() => Dmo.Details);

            editor.AllowDeletionFunc = () => CanSave;
            editor.CanDeleteFunc     = detail => CanSave;
            editor.IsEditableFunc    = (field, detail) => CanSave;
            _detailGrid = new DFEditGrid(editor);
            _detailGrid.DFGridSetEnabled = false;
            _detailGrid.Width            = Unit.Percentage(100);

            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("GoodsProperty_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Code"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Spec"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_StandardSecondNumber"));


            _detailGrid.ValueColumns.Add("Goods_ID");


            var section = mPageLayoutManager.AddSection("GoodsDetaiColumns", "存货明细");

            titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name);

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

            vPanel.Add(_detailGrid);
        }
Beispiel #16
0
        private void AddDetails(TitlePanel titlePanel)
        {
            var vPanel = titlePanel.EAdd(new VLayoutPanel());
            var toobar = new HLayoutPanel();

            vPanel.Add(toobar, new VLayoutOption(HorizontalAlign.Left));

            if (CanSave)
            {
                AddToolsPanel(toobar);
            }

            AddCopyAndPaste(toobar);
            var editor = AddGridByOrderByID();

            editor.AllowDeletionFunc = () => CanSave;

            editor.CanDeleteFunc  = detail => true;
            editor.IsEditableFunc = (field, detail) => CanSave;

            _detailGrid = new DFEditGrid(editor);
            _detailGrid.DFGridSetEnabled = false;
            _detailGrid.Width            = Unit.Percentage(100);
            mDFContainer.AddNonDFControl(_detailGrid, "$detailGrid");
            _detailGrid.NextRowOnEnter = true;
            _detailGrid.LastRowOnDown  = "__DFContainer.getControl('$SelectGoods').behind.focus();";
            _detailGrid.ShowLineNo     = true;
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Code"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Name"));
            AddGridColumnsByBrandItem_ID(_detailGrid);
            foreach (var ioc in TypeIOCCenter.GetIOCList <ProductNoticeEdit.BeforeDetailGridApplyLayout>(GetType()))
            {
                ioc.Invoke(_detailGrid);
            }
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Spec"));
            _detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("Number")).SumMode = SumMode.Sum;
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_MainUnit"));
            _detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("SecondNumber")).SumMode = SumMode.Sum;
            _detailGrid.Columns.EAdd(new DFEditGridColumn <DFValueLabel>("Goods_SecondUnit"));
            _detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("ProduceRequest")).InitEditControl += (sender, e) => { e.Control.Width = 150; };
            _detailGrid.Columns.EAdd(new DFEditGridColumn <DFDateInput>("ProduceDate"));
            _detailGrid.Columns.EAdd(new DFEditGridColumn <DFDateInput>("DeliveryDate"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("DmoTypeID"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("DmoID"));
            _detailGrid.Columns.Add(new DFEditGridColumn("Remark"));
            if (GlobalFlags.get(B3ButcheryFlags.IsYongDa))
            {
                var cargoSpaceColumn = _detailGrid.Columns.EAdd(new DFEditGridColumn <DFChoiceBox>("SaleZone_ID"));
                cargoSpaceColumn.InitEditControl += (sender, e) =>
                {
                    e.Control.EnableTopItem       = true;
                    e.Control.EnableInputArgument = true;
                    e.Control.DataKind            = B3ButcheryDataSource.销售地区全部;
                    e.Control.DFDisplayField      = "SaleZone_Name";
                    e.Control.Width = Unit.Pixel(160);
                };
            }
            AddProductNoticeDetailGrid(_detailGrid);

            _detailGrid.ValueColumns.Add("Goods_ID");
            _detailGrid.ValueColumns.Add("Goods_UnitConvertDirection");
            _detailGrid.ValueColumns.Add("Goods_MainUnitRatio");
            _detailGrid.ValueColumns.Add("Goods_SecondUnitRatio");

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

            titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name);
            section.SetRequired("Number");
            section.ApplyLayout(_detailGrid, mPageLayoutManager, DFInfo.Get(typeof(ProductNotice_Detail)));

            vPanel.Add(_detailGrid);

            var scriptManager = new GoodsEditGridScriptManager(_detailGrid, "Number");

            titlePanel.Controls.Add(scriptManager);
        }