示例#1
0
 private Info_matchTb_item Mtl2MatchTbItem(Info_mtl_item mtl)
 {
     Model.Info_matchTb_item item = Miles.Coro.Common.Utils.CopyToOther <Model.Info_mtl_item, Model.Info_matchTb_item>(mtl);
     item.Group_Name = Cache.LogicCache.DicGroupKind[mtl.Kind_Code].Kind_Name;
     item.MatchTb_Id = (long)this.Tag;
     return(item);
 }
示例#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();
        }
示例#3
0
        private void BtnDelete_Click(object sender, EventArgs e)
        {
            if (mDataGridItem.CurrentRow == null)
            {
                return;
            }
            Model.Info_matchTb_item item = mDataGridItem.GetCurrentEntity() as Model.Info_matchTb_item;

            string msg = string.Format("确定删除:{0}?", item.Mtl_Name);

            if (Miles.Framework.UI.Function.Dialog.ShowQuestionYesNo(msg))
            {
                mDataGridItem.DeleteCurrentItem <Model.Info_matchTb_item>();
            }
        }
示例#4
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);
        }