Exemplo n.º 1
0
        protected override void InitQueryPanel(QueryPanel queryPanel)
        {
            base.InitQueryPanel(queryPanel);
            var panel = queryPanel.CreateTab("显示字段");

            _checkbox = new CheckBoxListWithReverseSelect {
                RepeatColumns = 6, RepeatDirection = RepeatDirection.Horizontal
            };
            _checkbox.Items.Add(new ListItem("入库日期", "Date"));
            _checkbox.Items.Add(new ListItem("计划号", "ProductionPlan_PlanNumber"));
            _checkbox.Items.Add(new ListItem("会计单位", "AccountingUnit_Name"));
            _checkbox.Items.Add(new ListItem("部门", "Department_Name"));
            _checkbox.Items.Add(new ListItem("经办人", "Employee_Name"));
            _checkbox.Items.Add(new ListItem("速冻库", "Store_Name"));
            _checkbox.Items.Add(new ListItem("入库类型", "OtherInStoreType_Name"));
            _checkbox.Items.Add(new ListItem("摘要", "Remark"));
            _checkbox.Items.Add(new ListItem("存货名称", "Goods_Name"));
            _checkbox.Items.Add(new ListItem("存货编码", "Goods_Code"));
            _checkbox.Items.Add(new ListItem("规格", "Goods_Spec"));
            _checkbox.Items.Add(new ListItem("主数量", "Number"));
            _checkbox.Items.Add(new ListItem("主单位", "Goods_MainUnit"));
            _checkbox.Items.Add(new ListItem("生产数量", "SecondNumber2"));
            _checkbox.Items.Add(new ListItem("生产单位", "Goods_SecondUnit2"));
            _checkbox.Items.Add(new ListItem("创建人", "CreateUser_Name"));
            _checkbox.Items.Add(new ListItem("备注", "Remark"));
            panel.EAdd(_checkbox);
            var hPanel = new HLayoutPanel();

            CreateDataRangePanel(hPanel);
            queryPanel.ConditonPanel.EAdd(hPanel);
            mQueryControls.Add("显示字段", _checkbox);
            mQueryControls.EnableHoldLastControlNames.Add("显示字段");
        }
Exemplo n.º 2
0
        public static void CreateExportExcelPart(VLayoutPanel vPanel, DFBrowseGrid grid, string displayName)
        {
            HLayoutPanel hbox     = vPanel.Add(new HLayoutPanel(), new VLayoutOption(HorizontalAlign.Left));
            var          exporter = new Exporter();

            hbox.Add(new TSButton("导出到Excel", delegate
            {
                var lastQuery = grid.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;
                exporter.Export(new TSingSoft.WebPluginFramework.Exports.QueryResultExcelExporter(displayName, GetQueryResult(dom)));
            }));
            hbox.Add(exporter);
        }
Exemplo n.º 3
0
        private void CreateQuery(VLayoutPanel vPanel)
        {
            var layout = new LayoutManager("", mDFInfo, mQueryContainer);
            var config = new AutoLayoutConfig();

            layout.Config = config;
            config.Add("ID");
            config.Add("Name");
            config.Add("AccountingUnit_ID");
            config.Add("Department_ID");
            config.Add("Employee_ID");
            vPanel.Add(layout.CreateLayout());

            HLayoutPanel hPanel = new HLayoutPanel()
            {
                Align = HorizontalAlign.Left
            };
            TSButton qButton = new TSButton("开始查询");

            hPanel.Add(qButton);
            qButton.Click += delegate
            {
                _grid.Query = GetDQueryDom();
                _grid.DataBind();
            };
            dfContainer.AddNonDFControl(qButton, "$btnsearch");
            hPanel.Add(new RedirectTSButton("清除条件"));
            vPanel.Add(hPanel);
            vPanel.Add(new HLayoutPanel());
        }
Exemplo n.º 4
0
        //添加统一 货位按钮
        private void AddSameCargoSpace(HLayoutPanel hPanel)
        {
            hPanel.Add(new SimpleLabel("选择货位"));
            var selectCargo =
                hPanel.Add(new ChoiceBox(B3FrameworksConsts.DataSources.货位)
            {
                Width = Unit.Pixel(130),
                EnableInputArgument = true,
                EnableTopItem       = true,
                OnBeforeDrop        = "this.codeArgument = __DFContainer.getValue('Store_ID');"
            });

            var summary = new TSButton()
            {
                Text = "统一货位"
            };

            summary.Click += (sender, e) =>
            {
                if (!selectCargo.IsEmpty)
                {
                    detailGrid.GetFromUI();
                    var cargoSpace_ID   = long.Parse(selectCargo.Value);
                    var cargoSpace_Name = selectCargo.DisplayValue;

                    foreach (var r in Dmo.Details)
                    {
                        r.CargoSpace_ID   = cargoSpace_ID;
                        r.CargoSpace_Name = cargoSpace_Name;
                    }
                    detailGrid.DataBind();
                }
            };
            hPanel.Add(summary);
        }
Exemplo n.º 5
0
        private void CreateQuery(VLayoutPanel vPanel)
        {
            var layoutManager = new LayoutManager("", mDFInfo, mQueryContainer);

            var config = new AutoLayoutConfig();

            layoutManager.Config = config;

            AddQueryControl(config, layoutManager);
            vPanel.Add(layoutManager.CreateLayout(), new VLayoutOption(HorizontalAlign.Center));
            var hPanel = new HLayoutPanel()
            {
                Align = HorizontalAlign.Center
            };

            var qButton = new TSButton("开始查询");

            hPanel.Add(qButton);
            qButton.Click += delegate
            {
                GetDetail();
                mGrid.DataBind();
            };
            dfContainer.AddNonDFControl(qButton, "$btnsearch");
            hPanel.Add(new RedirectTSButton("清除条件"));
            vPanel.Add(hPanel);
        }
Exemplo n.º 6
0
        private void AddToolsPanel(HLayoutPanel toobar)
        {
            toobar.Add(new SimpleLabel("选择存货"));
            var goodsSelect = new ChoiceBox(B3UnitedInfosConsts.DataSources.存货)
            {
                Width                = Unit.Pixel(120),
                AutoPostBack         = true,
                EnableMultiSelection = true,
                EnableInputArgument  = true
            };

            toobar.Add(goodsSelect);
            goodsSelect.SelectedValueChanged += (sender, e) =>
            {
                _detailGrid.GetFromUI();
                foreach (var sGoodsID in goodsSelect.GetValues())
                {
                    var goodsid = Convert.ToInt64(sGoodsID);
                    if (Dmo.Details.Any(x => x.Goods_ID == goodsid))
                    {
                        continue;
                    }
                    var detail = new PackingBagType_Detail();
                    detail.Goods_ID = goodsid;
                    DmoUtil.RefreshDependency(detail, "Goods_ID");
                    Dmo.Details.Add(detail);
                }
                goodsSelect.DisplayValue = string.Empty;
                _detailGrid.DataBind();
            };
        }
Exemplo n.º 7
0
        private void AddToolsPanel(HLayoutPanel toobar)
        {
            toobar.Add(new SimpleLabel("选择存货"));
            var goodsSelect = new ChoiceBox(B3UnitedInfosConsts.DataSources.存货)
            {
                Width                = Unit.Pixel(120),
                AutoPostBack         = true,
                EnableMultiSelection = true,
                EnableInputArgument  = true
            };

            toobar.Add(goodsSelect);
            goodsSelect.SelectedValueChanged += (sender, e) => {
                _detailGrid.GetFromUI();
                foreach (var sGoodsID in goodsSelect.GetValues())
                {
                    var goods  = GoodsBL.Instance.Load(Convert.ToInt64(sGoodsID));
                    var detail = new PackingRecipients_Detail();
                    detail.Goods_ID = goods.ID;
                    DmoUtil.RefreshDependency(detail, "Goods_ID");
                    Dmo.Details.Add(detail);
                }
                goodsSelect.DisplayValue = string.Empty;
                _detailGrid.DataBind();
            };

//      var quickSelctButton = new DialogButton { Url = "~/B3UnitedInfos/Dialogs/QucicklySelectGoodsDetailsDialog.aspx", Text = "快速选择" };
//      quickSelctButton.Click += delegate {
//        ReceiveSelectedGoodsDetailDialog();
//      };
//      toobar.Add(quickSelctButton);
        }
Exemplo n.º 8
0
        Control CreateDataRangePanel()
        {
            var hPanel = new HLayoutPanel();

            hPanel.Add(new SimpleLabel("日期"));
            sd = hPanel.Add(new DateInput());
            hPanel.Add(new LiteralControl("→"));
            ed = hPanel.Add(new DateInput());
            return(hPanel);
        }
Exemplo n.º 9
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);
        }
Exemplo n.º 10
0
        HLayoutPanel CreateDataRangePanel()
        {
            var hPanel = new HLayoutPanel();

            hPanel.Add(new SimpleLabel("日期"));
            dateInput       = new DateInput();
            dateInput.Value = DateTime.Today.AddDays(-1);

            hPanel.Add(dateInput);
            return(hPanel);
            //            hPanel.Add(QueryCreator.DateRange(_mainInfo.Fields["Date"], mQueryContainer, "MinDate", "MaxDate"));
        }
Exemplo n.º 11
0
 protected override void InitToolBar(HLayoutPanel toolbar)
 {
     base.InitToolBar(toolbar);
     if (User.IsInRole("B3Butchery.报表.生产通知分析"))
     {
         var dataAnysBtn = new TSButton()
         {
             Text = "数据分析", UseSubmitBehavior = false
         };
         dataAnysBtn.OnClientClick = string.Format("OpenUrlInTopTab('{0}','生产通知分析');return false;", WpfPageUrl.ToGlobal(AspUtil.AddTimeStampToUrl("~/B3Butchery/Reports/ProductNoticeReport_/ProductNoticeReport.aspx")));
         toolbar.Add(dataAnysBtn);
     }
 }
Exemplo n.º 12
0
        protected override void BuildBody(Control container)
        {
            var layoutManager = new LayoutManager("main", mDFInfo, mDFContainer);
            var config        = new AutoLayoutConfig();

            config.Add("Date");
            config.Add("EndDate");
            config.Add("AccountingUnit_ID");
            config.Add("Department_ID");
            config.Add("Employee_ID");
            config.Add("PlanNumber");
            config.Add("ProductType");
            layoutManager.Config = config;
            container.Controls.Add(layoutManager.CreateLayout());

            var planNumberPanel = new HLayoutPanel();

            container.Controls.Add(planNumberPanel);
            planNumberButton = new TSButton();
            planNumberPanel.Add(planNumberButton).Click += delegate
            {
                if (Dmo.BillState == 单据状态.已审核 && !string.IsNullOrEmpty(Dmo.PlanNumber))
                {
                    using (var context = new TransactionContext())
                    {
                        var update = new DQUpdateDom(typeof(ProductPlan));
                        update.Where.Conditions.Add(DQCondition.EQ("PlanNumber", Dmo.PlanNumber));
                        update.Columns.Add(new DQUpdateColumn("PlanNumbers", true));

                        context.Session.ExecuteNonQuery(update);
                        context.Commit();
                    }

                    Dmo.PlanNumbers = true;
                    mBL.Update(Dmo);
                }
                AspUtil.RedirectAndAlert(this, Request.RawUrl, "计划号关闭成功");
            };
            var vPanel = container.EAdd(new VLayoutPanel());

            CreateInputDetailPanel(vPanel);
            CreateOutputDetailPanel(vPanel);
        }
Exemplo n.º 13
0
        private void CreateQueryGrid(VLayoutPanel vPanel)
        {
            _grid = new DFBrowseGrid(new DFDataTableEditor())
            {
                Width = Unit.Percentage(100)
            };
            _grid.MultiSelectionEnabled = true;
            CreateQueryGridColumns(_grid);
            var hPanel = new HLayoutPanel()
            {
                Align = HorizontalAlign.Left
            };

            vPanel.Add(_grid);
            var button = new TSButton("选中");

            hPanel.Add(button);
            vPanel.Add(hPanel);
            button.Click += GridMultiSelection;
        }
Exemplo n.º 14
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);
        }
Exemplo n.º 15
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);
        }
Exemplo n.º 16
0
        private void AddCopyAndPaste(HLayoutPanel toobar)
        {
            toobar.Add(new TSButton("复制", delegate
            {
                GoodsDetailSummaryClipboardUtil.Copy(Dmo.Details.Select(item => (GoodsDetailSummaryBase)item).ToList());
                AspUtil.Alert(this, "复制成功!");
            }));

            if (CanSave)
            {
                toobar.Add(new TSButton("粘贴", delegate
                {
                    var list = GoodsDetailSummaryClipboardUtil.Paste <ProductNotice_Detail>();
                    foreach (var detail in list)
                    {
                        DmoUtil.RefreshDependency(detail, "Goods_ID");
                        Dmo.Details.Add(detail);
                    }
                    _detailGrid.DataBind();
                }));
            }
        }
Exemplo n.º 17
0
        protected override void InitQueryPanel(QueryPanel queryPanel)
        {
            base.InitQueryPanel(queryPanel);
            var panel = queryPanel.CreateTab("显示字段");

            _checkbox = new CheckBoxListWithReverseSelect {
                RepeatColumns = 6, RepeatDirection = RepeatDirection.Horizontal
            };
            _checkbox.Items.Add(new ListItem("单号", "ID"));
            _checkbox.Items.Add(new ListItem("会计单位", "AccountingUnit_Name"));
            _checkbox.Items.Add(new ListItem("部门", "Department_Name"));
            _checkbox.Items.Add(new ListItem("业务员", "Employee_Name"));
            _checkbox.Items.Add(new ListItem("单据状态", "BillState"));
            AddQueryPanelByBrandItem_Name(_checkbox);
            _checkbox.Items.Add(new ListItem("日期", "Date"));
            _checkbox.Items.Add(new ListItem("生产单位", "ProductionUnit_Name"));
            _checkbox.Items.Add(new ListItem("加工要求", "ProduceRequest"));
            _checkbox.Items.Add(new ListItem("生产日期", "ProduceDate"));
            _checkbox.Items.Add(new ListItem("交货日期", "DeliveryDate"));
            _checkbox.Items.Add(new ListItem("源单据号", "DmoID"));
            _checkbox.Items.Add(new ListItem("存货名称", "Goods_Name"));
            _checkbox.Items.Add(new ListItem("存货属性", "GoodsProperty_Name"));
            _checkbox.Items.Add(new ListItem("属性分类", "GoodsPropertyCatalog_Name"));
            _checkbox.Items.Add(new ListItem("主数量", "Number"));
            _checkbox.Items.Add(new ListItem("主单位", "Goods_MainUnit"));
            _checkbox.Items.Add(new ListItem("辅数量", "SecondNumber"));
            _checkbox.Items.Add(new ListItem("辅单位", "Goods_SecondUnit"));
            _checkbox.Items.Add(new ListItem("单价", "Price"));
            _checkbox.Items.Add(new ListItem("摘要", "摘要"));
            _checkbox.Items.Add(new ListItem("备注", "Remark"));

            panel.EAdd(_checkbox);
            var hPanel = new HLayoutPanel();

            CreateDataRangePanel(hPanel);
            queryPanel.ConditonPanel.EAdd(hPanel);
            mQueryControls.Add("显示字段", _checkbox);
            mQueryControls.EnableHoldLastControlNames.Add("显示字段");
        }
Exemplo n.º 18
0
 void CreateDataRangePanel(HLayoutPanel hPanel)
 {
     hPanel.Add(new SimpleLabel(_mainInfo.Fields["Date"].Prompt));
     hPanel.Add(QueryCreator.DateRange(_mainInfo.Fields["Date"], mQueryContainer, "MinDate", "MaxDate"));
 }
Exemplo n.º 19
0
        void AddResultControls(Control vPanel)
        {
            vPanel.Controls.Add(new LiteralControl("选择要导出到Excel的字段"));
            _list = new CheckBoxListWithReverseSelect()
            {
                RepeatColumns = 6
            };
            _list.RepeatDirection = RepeatDirection.Horizontal;
            var fields = new[] { "ID", "Name", "PrintShortName", "Code", "Spec", "GoodsProperty_Name",
                                 "Feature", "Origin", "Brand", "ProductLine_Name", "TaxRate", "MainUnit", "SecondUnit", "MainUnitRatio", "SecondUnitRatio", "UnitConvertDirection", "Barcode", "OuterCode", "SecondUnitII", "SecondUnitII_MainUnitRatio", "SecondUnitII_SecondUnitRatio", "Remark", "属性分类" };

            foreach (string field in fields)
            {
                IDmoFieldInfo dmoFieldInfo;

                if (field == "属性分类")
                {
                    var item = new ListItem();
                    item.Text     = field;
                    item.Value    = "属性分类";
                    item.Selected = true;
                    _list.Items.Add(item);
                    continue;
                }
                if (!_dmoInfo.Fields.TryGetValue(field, out dmoFieldInfo))
                {
                    continue;
                }
                var dfField = mDFInfo.Fields.FirstOrDefault(x => field == x.Name);
                AddCheckBoxField(dfField, _list);
            }
            vPanel.Controls.Add(_list);
            HLayoutPanel hPanel = new HLayoutPanel();

            vPanel.Controls.Add(hPanel);
            var button = new LinkButton();

            button.Text = "导出到Excel";
            hPanel.Add(button);
            var exporter = new Exporter();

            hPanel.Add(exporter);
            button.Click += delegate
            {
                var dom = GetQueryDom();
                dom.OrderBy.Expressions.Clear();
                dom.Columns.Clear();
                var alias = dom.From.RootSource.Alias;
                foreach (ListItem item in _list.Items)
                {
                    if (item.Selected)
                    {
                        if (item.Text == "属性分类")
                        {
                            var goodsPropertyAlias = new JoinAlias("gpy", typeof(GoodsProperty));
                            dom.From.AddJoin(JoinType.Left, new DQDmoSource(goodsPropertyAlias), DQCondition.EQ(dom.From.RootSource.Alias, "GoodsProperty_ID", goodsPropertyAlias, "ID"));

                            dom.Columns.Add(DQSelectColumn.Field("GoodsPropertyCatalog_Name", goodsPropertyAlias, "属性分类"));
                        }
                        else
                        {
                            dom.Columns.Add(DQSelectColumn.Field(item.Value, item.Text));
                        }
                    }
                }
                dom.OrderBy.Expressions.Add(DQOrderByExpression.Create(alias, "ID", true));
                exporter.Export(new DQueryExcelExporter(LogicName + ".xls", new LoadArguments(dom)));
            };
        }
Exemplo n.º 20
0
 protected virtual void AddCustomerToolBar(HLayoutPanel hPanel)
 {
 }
Exemplo n.º 21
0
        private void CreateOutputDetailPanel(TitlePanel tPanel)
        {
            var hPanel = new HLayoutPanel();

            if (CanSave)
            {
                tPanel.Controls.Add(hPanel);

                hPanel.Add(new SimpleLabel("选择存货"));
                var selectEmp = hPanel.Add(new ChoiceBox(B3UnitedInfosConsts.DataSources.存货)
                {
                    Width = Unit.Pixel(130), EnableInputArgument = true, AutoPostBack = true
                });
                mDFContainer.AddNonDFControl(selectEmp, "$SelectGoods");
                selectEmp.SelectedValueChanged += delegate {
                    _detailGrid.GetFromUI();
                    if (!selectEmp.IsEmpty)
                    {
                        var empID = long.Parse(selectEmp.Value);
                        if (!Dmo.Details.Any(x => x.Goods_ID == empID))
                        {
                            var d = new ProduceFinish_Detail()
                            {
                                Goods_ID = empID
                            };
                            var last = Dmo.Details.LastOrDefault();
                            if (last != null)
                            {
                                d.BrandItem_ID   = last.BrandItem_ID;
                                d.BrandItem_Name = last.BrandItem_Name;
                            }
                            DmoUtil.RefreshDependency(d, "Goods_ID");
                            Dmo.Details.Add(d);
                        }
                    }
                    selectEmp.Clear();
                    _detailGrid.DataBind();
                    var script = B3ButcheryWebUtil.SetCursorPositionScript(butcheryConfig.ProduceFinishCursorField, "$DetailGrid", Dmo.Details.Count, _detailGrid.PageSize);
                    if (!string.IsNullOrEmpty(script))
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "Startup", script, true);
                    }
                };
                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 ProduceFinish_Detail {
                            Goods_ID = temGoodsDetail.Goods_ID
                        };
                        DmoUtil.RefreshDependency(detail, "Goods_ID");

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

                var addbt = hPanel.Add(new DialogButton {
                    Text = "选择生产通知单",
                });
                addbt.Url    = "/B3Butchery/Dialogs/SelectProductNoticeDialog.aspx";
                addbt.Click += delegate {
                    _detailGrid.GetFromUI();
                    var details = DialogUtil.GetCachedObj <ProduceFinish_Detail>(this);
                    foreach (var temGoodsDetail in details)
                    {
                        DmoUtil.RefreshDependency(temGoodsDetail, "Goods_ID");

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

                AddCustomerToolBar(hPanel);
            }
            var detailEditor = new DFCollectionEditor <ProduceFinish_Detail>(() => Dmo.Details)
            {
                AllowDeletionFunc = () => CanSave,
                CanDeleteFunc     = detail => CanSave,
                IsEditableFunc    = (field, detail) => CanSave
            };

            _detailGrid = new DFEditGrid(detailEditor)
            {
                Width = Unit.Percentage(100)
            };
            mDFContainer.AddNonDFControl(_detailGrid, "$DetailGrid");
            _detailGrid.NextRowOnEnter = true;
            _detailGrid.LastRowOnDown  = "__DFContainer.getControl('$SelectGoods').behind.focus();";
            tPanel.Controls.Add(_detailGrid);
            if (_useBrand)
            {
                _detailGrid.Columns.Add(new DFEditGridColumn("BrandItem_ID"));
            }
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Name"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Code"));
            _detailGrid.Add(new DFEditGridColumn <DFValueLabel>("Goods_Spec"));
            _detailGrid.Add(new DFEditGridColumn <DFTextBox>("Number"));
            _detailGrid.Add(new DFEditGridColumn <DFValueLabel>("Goods_MainUnit"));
            _detailGrid.Add(new DFEditGridColumn <DFTextBox>("SecondNumber"));
            _detailGrid.Add(new DFEditGridColumn <DFValueLabel>("Goods_SecondUnit"));
            _detailGrid.Columns.Add(new DFEditGridColumn <DFTextBox>("Remark"));
            _detailGrid.ValueColumns.Add("Goods_UnitConvertDirection");
            _detailGrid.ValueColumns.Add("Goods_MainUnitRatio");
            _detailGrid.ValueColumns.Add("Goods_SecondUnitRatio");
            new Main_Second_ConvertRatioRowManager(_detailGrid, "Number", "SecondNumber");
        }
Exemplo n.º 22
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);
        }
Exemplo n.º 23
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);
        }
Exemplo n.º 24
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);
        }
Exemplo n.º 25
0
        private void SetupControls()
        {
            this.lblUserName     = new FormLabel(0, "lblUserName", true, "username");
            this.lblPassword     = new FormLabel(1, "lblPassword", true, "password");
            this.lblLogonProcess = new FormLabel(2, "lblLogonProcess", true, "logon_process");

            this.lblLogonProcess.Anchor |= AnchorStyles.Right;

            this.pbxAppIcon  = new System.Windows.Forms.PictureBox();
            this.lblAppName  = new System.Windows.Forms.Label();
            this.cbxUserName = new System.Windows.Forms.ComboBox();
            this.tbxPassword = new System.Windows.Forms.TextBox();
            this.btnExit     = new FlatButton(1, "exit", "", "exit");
            this.btnLogin    = new FlatButton(2, "login", "", "login");

            this.pbxAppIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
            this.lblAppName.Font     = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tbxPassword.UseSystemPasswordChar = true;

            this.lblAppName.AutoSize           = true;
            this.tbxPassword.Anchor           |= AnchorStyles.Right;
            this.cbxUserName.Anchor           |= AnchorStyles.Right;
            this.lblLogonProcess.Margin        = new Padding(0, 20, 0, 20);
            this.cbxUserName.FormattingEnabled = true;

            this.AcceptButton    = this.btnLogin;
            this.btnExit.Click  += new System.EventHandler(this.btnExit_Click);
            this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);

            this.tlpMain    = new HLayoutPanel("tlpMain", 6, 3, 0);
            this.tlpButtons = new HLayoutPanel("tlpButtons", 1, 3, 1);

            this.tlpMain.ColumnStyles[this.tlpMain.ColumnCount - 1] = new ColumnStyle(SizeType.Percent, 100F);
            this.tlpMain.RowStyles[1] = new RowStyle(SizeType.Percent, 100F);

            this.tlpMain.Controls.Add(this.pbxAppIcon, 0, 0);
            this.tlpMain.Controls.Add(this.lblAppName, 1, 0);
            this.tlpMain.Controls.Add(this.lblLogonProcess, 1, 2);
            this.tlpMain.Controls.Add(this.lblUserName, 1, 3);
            this.tlpMain.Controls.Add(this.cbxUserName, 2, 3);
            this.tlpMain.Controls.Add(this.lblPassword, 1, 4);
            this.tlpMain.Controls.Add(this.tbxPassword, 2, 4);
            this.tlpMain.Controls.Add(this.tlpButtons, 0, 5);

            this.tlpMain.SetColumnSpan(this.lblAppName, 2);
            this.tlpMain.SetColumnSpan(this.lblLogonProcess, 2);
            this.tlpMain.SetColumnSpan(this.tlpButtons, 3);
            this.tlpMain.SetRowSpan(this.pbxAppIcon, 5);

            this.tlpButtons.Controls.Add(this.btnLogin, 1, 0);
            this.tlpButtons.Controls.Add(this.btnExit, 2, 0);

            this.tlpButtons.ColumnStyles[0] = new ColumnStyle(SizeType.Percent, 100F);
            this.tlpButtons.Anchor          = AnchorStyles.Left |
                                              AnchorStyles.Right | AnchorStyles.Bottom;
            this.tlpButtons.AutoSize = true;

            this.Controls.Add(this.tlpMain);

            this.BackColor            = System.Drawing.Color.White;
            this.tlpMain.BackColor    = this.BackColor;
            this.tlpButtons.BackColor = Presentation.View.Theme.GroupPanelBackColor;

            this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text            = Resources.Texts.logon;
            this.lblAppName.Text = Resources.Texts.app_name;

            this.pbxAppIcon.Image = DomainModel.Application.ResourceManager.GetImage("lock_big");
        }
Exemplo n.º 26
0
        private void AddToolsBar(HLayoutPanel hPanel)
        {
            if (!CanSave)
            {
                return;
            }
            hPanel.Add(new SimpleLabel("选择存货"));
            var selectGoods =
                hPanel.Add(new ChoiceBox(B3ButcheryDataSource.存货带编号)
            {
                Width = Unit.Pixel(130),
                EnableMultiSelection = true,
                EnableInputArgument  = true,
                AutoPostBack         = true
            });

            mDFContainer.AddNonDFControl(selectGoods, "$SelectGoods");
            selectGoods.SelectedValueChanged += delegate
            {
                detailGrid.GetFromUI();
                if (!selectGoods.IsEmpty)
                {
                    var      config         = new B3ButcheryConfig();
                    DateTime?productionDate = null;
                    //判断当前配置 否为当天时间,是 为入库时间 默认是 否
                    if (config.ProductInStoreChooseDate.Value)
                    {
                        productionDate = Dmo.InStoreDate;
                    }
                    else
                    {
                        productionDate = DateTime.Today;
                    }

                    foreach (var item in selectGoods.GetValues())
                    {
                        var d = new ProductInStore_Detail()
                        {
                            Goods_ID       = long.Parse(item),
                            ProductionDate = productionDate,
                            Price          = 0
                        };
                        DmoUtil.RefreshDependency(d, "Goods_ID");
                        var last = Dmo.Details.LastOrDefault();
                        if (last != null)
                        {
                            d.BrandItem_ID   = last.BrandItem_ID;
                            d.BrandItem_Name = last.BrandItem_Name;
                        }
                        Dmo.Details.Add(d);
                    }
                }
                selectGoods.Clear();
                detailGrid.DataBind();

                var script = B3ButcheryWebUtil.SetCursorPositionScript(butcheryConfig.ProductInStoreCursorField, "$DetailGrid", Dmo.Details.Count, detailGrid.PageSize);
                if (!string.IsNullOrEmpty(script))
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "Startup", script, true);
                }
            };

            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_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();
            };
            hPanel.Add(new SimpleLabel("生产日期"));
            var selectDate = new DateInput();

            hPanel.Add(selectDate);
            var summary = new TSButton()
            {
                Text = "统一生产日期"
            };

            summary.Click += (sender, e) =>
            {
                if (!selectDate.IsEmpty)
                {
                    detailGrid.GetFromUI();
                    var date = selectDate.Value;
                    foreach (var r in Dmo.Details)
                    {
                        r.ProductionDate = date;
                    }
                    detailGrid.DataBind();
                }
            };
            hPanel.Add(summary);
            var quickSelctButton = new DialogButton()
            {
                Url = "~/B3UnitedInfos/Dialogs/QucicklySelectGoodsDetailsDialog.aspx", Text = "快速选择"
            };

            quickSelctButton.Click += delegate
            {
                ReceiveSelectedGoodsDetailDialog();
            };
            hPanel.Add(quickSelctButton);

            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();
            }));
            ProduceFinishBtn(hPanel, this);//耘垦选择生产完工单button


            var loadProductInStoreTemp = hPanel.Add(new DialogButton {
                Text = "选择模板",
            });

            loadProductInStoreTemp.Url    = "/B3Butchery/Dialogs/ProductInStoreTempDialog.aspx";
            loadProductInStoreTemp.Click += delegate
            {
                detailGrid.GetFromUI();
                var temp = DialogUtil.GetCachedObj <ProductInStore_Temp>(this).FirstOrDefault();

                Dmo.AccountingUnit_ID   = temp.AccountingUnit_ID;
                Dmo.AccountingUnit_Name = temp.AccountingUnit_Name;
                Dmo.Department_ID       = temp.Department_ID;
                Dmo.Department_Name     = temp.Department_Name;
                Dmo.Employee_ID         = temp.Employee_ID;
                Dmo.Employee_Name       = temp.Employee_Name;
                Dmo.InStoreType_ID      = temp.InStoreType_ID;
                Dmo.InStoreType_Name    = temp.InStoreType_Name;
                Dmo.Store_ID            = temp.Store_ID;
                Dmo.Store_Name          = temp.Store_Name;
                Dmo.CheckEmployee_ID    = temp.CheckEmployee_ID;
                Dmo.CheckEmployee_Name  = temp.CheckEmployee_Name;
                Dmo.CheckDate           = temp.CheckDate;
                if (Dmo.InStoreDate != null)
                {
                    Dmo.InStoreDate = temp.InStoreDate;
                }

                foreach (var de in temp.Details)
                {
                    var detail = new ProductInStore_Detail();
                    detail.BrandItem_ID   = de.BrandItem_ID;
                    detail.BrandItem_Name = de.BrandItem_Name;
                    detail.Goods_ID       = de.Goods_ID;
                    detail.Goods_Name     = de.Goods_Name;
                    detail.Goods_Spec     = de.Goods_Spec;
                    detail.Goods_Code     = de.Goods_Code;
                    DmoUtil.RefreshDependency(detail, "Goods_ID");
                    Dmo.Details.Add(detail);
                }
                AppToUI();
                detailGrid.DataBind();
            };
        }
Exemplo n.º 27
0
 protected virtual void ProduceFinishBtn(HLayoutPanel hPanel, ProductInStoreEdit page)
 {
 }
Exemplo n.º 28
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);
        }
Exemplo n.º 29
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);
        }
Exemplo n.º 30
0
        protected override void InitQueryPanel(QueryPanel queryPanel)
        {
            base.InitQueryPanel(queryPanel);
            var panel = queryPanel.CreateTab("显示字段");

            _showTypeList = new CheckBoxList
            {
                RepeatColumns   = 6,
                RepeatDirection = RepeatDirection.Horizontal
            };
            _showTypeList.Items.Add(new ListItem("合并单元格")
            {
                Selected = true
            });

            panel.EAdd(new HLayoutPanel()
            {
                new SimpleLabel("显示格式"), _showTypeList
            });
            mQueryControls.Add("显示格式", _showTypeList);
            checkbox = new CheckBoxListWithReverseSelect()
            {
                RepeatColumns = 6, RepeatDirection = RepeatDirection.Horizontal
            };
            checkbox.Items.Add(new ListItem("单号", "ID"));
            checkbox.Items.Add(new ListItem("会计单位", "AccountingUnit_Name"));
            checkbox.Items.Add(new ListItem("部门", "Department_Name"));
            checkbox.Items.Add(new ListItem("仓库", "Store_Name"));
            checkbox.Items.Add(new ListItem("入库类型", "InStoreType_Name"));
            checkbox.Items.Add(new ListItem("入库时间", "InStoreDate"));
            checkbox.Items.Add(new ListItem("验收日期", "CheckDate"));
            checkbox.Items.Add(new ListItem("生产日期", "ProductionDate"));
            checkbox.Items.Add(new ListItem("生产计划号", "ProductPlan_Name"));
            checkbox.Items.Add(new ListItem("摘要", "Remark"));
            checkbox.Items.Add(new ListItem("存货名称", "Name"));
            checkbox.Items.Add(new ListItem("产品线", "ProductLine_Name"));
            checkbox.Items.Add(new ListItem("产品线分类", "ProductLineCategory_ID"));

            checkbox.Items.Add(new ListItem("打印简称", "PrintShortName"));
            checkbox.Items.Add(new ListItem("存货属性", "GoodsProperty_Name"));
            checkbox.Items.Add(new ListItem("存货编码", "Code"));
            checkbox.Items.Add(new ListItem("规格", "Spec"));
            checkbox.Items.Add(new ListItem("产地", "Origin"));
            checkbox.Items.Add(new ListItem("存货品牌", "Brand"));
            checkbox.Items.Add(new ListItem("存货属性", "存货属性"));
            checkbox.Items.Add(new ListItem("属性分类", "属性分类"));
            checkbox.Items.Add(new ListItem("主数量", "Number"));
            checkbox.Items.Add(new ListItem("主单位", "MainUnit"));
            checkbox.Items.Add(new ListItem("辅数量", "SecondNumber"));
            checkbox.Items.Add(new ListItem("辅单位", "SecondUnit"));
            checkbox.Items.Add(new ListItem("单价", "Price"));
            checkbox.Items.Add(new ListItem("金额", "Money"));
            checkbox.Items.Add(new ListItem("创建人", "CreateUser_Name"));
            checkbox.Items.Add(new ListItem("备注", "DRemark"));
            checkbox.Items.Add(new ListItem("标签", "Names"));
            checkbox.Items.Add(new ListItem("单据状态", "BillState"));
            checkbox.Items.Add(new ListItem("每日"));
            checkbox.Items.Add(new ListItem("每月"));
            checkbox.Items.Add(new ListItem("每年"));

            checkbox.Items.Add(new ListItem("货位", "CargoSpace_Name"));
            if (_useBrand)
            {
                checkbox.Items.Add(new ListItem("品牌项", "BrandItem_Name"));
            }

            AddDisplayfield(checkbox);
            panel.EAdd(checkbox);
            panel.EAddLiteral("<BR/>");
            panel.EAddLiteral("<span style='color:red'>属性分类等级:</span>");
            depth       = panel.EAdd(new DFTextBox());
            depth.Width = Unit.Pixel(20);
            var hPanel = new HLayoutPanel();

            CreateDataRangePanel(hPanel);
            queryPanel.ConditonPanel.EAdd(hPanel);
            mQueryControls.Add("显示字段", checkbox);
            mQueryControls.EnableHoldLastControlNames.Add("显示字段");
        }