Beispiel #1
0
        private void SetAccountInfo()
        {
            if (!this.blNewFlag)
            {
                Model.Info_mtl_item info = modelObj as Model.Info_mtl_item;
                this.SetDataBind(info);
            }

            Model.Info_mtl_kind kind = this.Tag as Model.Info_mtl_kind;
            lblParent.Text = kind.Kind_Name;
        }
Beispiel #2
0
        private void BtnAdd_Click(object sender, EventArgs e)
        {
            FmMtlSelect fm = new FmMtlSelect();

            fm.SelectValue += (obj) =>
            {
                Model.Info_mtl_item     mtl  = obj as Model.Info_mtl_item;
                Model.Info_matchTb_item item = Mtl2MatchTbItem(mtl);

                mDataGridItem.AddItem <Model.Info_matchTb_item>(item);
            };
            fm.ShowDialog();
        }
Beispiel #3
0
        void btnEditItem_Click(object sender, EventArgs e)
        {
            if (mDataGridItem.CurrentRow == null)
            {
                return;
            }
            Model.Info_mtl_kind kind = this.treeView1.SelectedNode.Tag as Model.Info_mtl_kind;

            Model.Info_mtl_item item = this.mDataGridItem.GetCurrentEntity() as Model.Info_mtl_item;

            FmMtlInfo fmItem = new FmMtlInfo(item);

            fmItem.Tag          = kind;
            fmItem.SelectValue += FmItem_SelectValue;
            fmItem.ShowDialog();
        }
Beispiel #4
0
        protected override bool BtnOkClick()
        {
            Dictionary <Control, string> dicEmptyCtrs = this.GetValidEmptyCtrs();

            if (dicEmptyCtrs.Count > 0)
            {
                foreach (var ctr in dicEmptyCtrs.Keys)
                {
                    Miles.Framework.UI.Function.MForm.SetToolTip(ctr, dicEmptyCtrs[ctr], 1000);
                    return(false);
                }
            }

            Model.Info_mtl_item item = cmbMtlInfo1.SelectedItem as Model.Info_mtl_item;
            this.DoSelectValueEvent(item);

            return(true);
        }
Beispiel #5
0
        GaoShan.Sales.UI.Report.FmMatchTbManagerReport reportMatchTb = null;// new Report.FmMatchTbManagerReport();

        private void BtnReCreate_Click(object sender, EventArgs e)
        {
            if (reportMatchTb == null)
            {
                reportMatchTb = new GaoShan.Sales.UI.Report.FmMatchTbManagerReport();
            }
            Model.Info_matchTb info = dataSource as Model.Info_matchTb;

            //reportMatchTb.ShowGrid(info);
            Dictionary <string, object> dicVar = reportMatchTb.GetMatchTbVars(info);

            //获得生成物料
            Model.Info_matchTb_tmp_set tmpSet = Cache.LogicCache.GetMatchTbTmpSet(info.Tent_Width, info.Tent_MainSpec);
            if (tmpSet == null)
            {
                string msg = string.Format("不存在宽度{0}米,主材规格{1}的物料组成数据", info.Tent_Width, info.Tent_MainSpec);
                Miles.Framework.UI.Function.MForm.SetToolTip(btnReCreate, msg, 1000);

                return;
            }

            Dictionary <string, Model.Info_mtl_item> dicMtlItem = Cache.LogicCache.DicMtlItem;
            List <Model.Info_matchTb_item>           items      = new List <Model.Info_matchTb_item>();

            foreach (var v in tmpSet.SetItems)
            {
                Model.Info_mtl_item     mtl  = dicMtlItem[v.Key];
                Model.Info_matchTb_item item = Mtl2MatchTbItem(mtl);

                object  value  = GaoShan.Sales.UI.Report.ReportTemplateBase.ParseFormula(v.Value, dicVar);
                decimal result = -1;
                decimal.TryParse(value.ToString(), out result);

                item.Item_Count = result;

                items.Add(item);
            }

            mDataGridItem.Clear();
            mDataGridItem.SetDataSource <Model.Info_matchTb_item>(items);
        }
Beispiel #6
0
        void btnDeleteItem_Click(object sender, EventArgs e)
        {
            if (mDataGridItem.CurrentRow == null)
            {
                return;
            }

            Model.Info_mtl_item item = this.mDataGridItem.GetCurrentEntity() as Model.Info_mtl_item;

            if (Miles.Framework.UI.Function.Dialog.ShowWarningYesNo("确定要删除物料:" + item.Mtl_Name + "?"))
            {
                //if (manager.HasItemRecord(item.Gs_Id))
                //{
                //    Miles.Framework.UI.Function.MForm.SetToolTip(this.toolStripItem, "商品存在业务数据不能删除", 1000);
                //    return;
                //}

                if (manager.Remove(item))
                {
                    this.mDataGridItem.DeleteCurrentItem <Model.Info_mtl_item>();
                }
            }
        }
Beispiel #7
0
        protected override bool BtnOkClick()
        {
            Dictionary <Control, string> dicEmptyCtrs = this.GetValidEmptyCtrs();

            if (dicEmptyCtrs.Count > 0)
            {
                foreach (var ctr in dicEmptyCtrs.Keys)
                {
                    Miles.Framework.UI.Function.MForm.SetToolTip(ctr, dicEmptyCtrs[ctr], 1000);
                    return(false);
                }
            }

            Model.Bu_MatchTb_Item info = this.GetDataBind <Model.Bu_MatchTb_Item>();
            Model.Info_mtl_item   item = cmbMtlInfo1.SelectedItem as Model.Info_mtl_item;

            Model.Bu_MatchTb_Item update = Miles.Coro.Common.Utils.CopyToChild <Model.Info_mtl_item, Model.Bu_MatchTb_Item>(item);
            update.ItemFormula = info.ItemFormula;

            this.DoSelectValueEvent(update);

            return(true);
        }
Beispiel #8
0
        protected override bool BtnOkClick()
        {
            Dictionary <Control, string> dicEmptyCtrs = this.GetValidEmptyCtrs();

            if (dicEmptyCtrs.Count > 0)
            {
                foreach (var ctr in dicEmptyCtrs.Keys)
                {
                    Miles.Framework.UI.Function.MForm.SetToolTip(ctr, dicEmptyCtrs[ctr], 1000);
                    return(false);
                }
            }

            Model.Info_mtl_item info   = this.GetDataBind <Model.Info_mtl_item>();
            Model.Info_mtl_kind parent = this.Tag as Model.Info_mtl_kind;
            info.Kind_Code = parent.Kind_Code;
            if (this.blNewFlag)
            {
                if (!manager.Add(info))
                {
                    return(false);
                }
            }
            else
            {
                Model.Info_mtl_item old = modelObj as Model.Info_mtl_item;

                if (!manager.Update(info, old))
                {
                    return(false);
                }
            }

            this.DoSelectValueEvent(info);

            return(!chbInput.Checked);
        }
Beispiel #9
0
 public FmMtlInfo(Model.Info_mtl_item info)
     : base(info)
 {
     InitializeComponent();
 }