public override bool Save(ToolStripButton sender) { 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); } } List <Model.Info_matchTb_item> items = mDataGridItem.GetDataSource <Model.Info_matchTb_item>(); if (items == null || items.Count < 1) { return(false); } Model.Info_matchTb info = dataSource as Model.Info_matchTb; Model.Info_matchTb infoMatchTb = this.GetDataBind <Model.Info_matchTb>(info); infoMatchTb.Items = items; if (manager.Save(infoMatchTb)) { base.SetDataSource(infoMatchTb); base.selectValue = infoMatchTb; } return(true); }
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_matchTb info = this.GetDataBind <Model.Info_matchTb>(); Model.Info_link_bill bill = this.modelObj as Model.Info_link_bill; info = Miles.Coro.Common.Utils.CopyToOther <Model.Info_link_bill, Model.Info_matchTb>(bill, info); if (!manager.Add(info)) { return(false); } this.DoSelectValueEvent(info); return(true); }
void mDataGridNvl_CurrentRowChanged(object sender, EventArgs e) { if (this.mDataGridNvl.CurrentRow == null) { return; } Model.Info_matchTb info = mDataGridNvl.GetCurrentEntity() as Model.Info_matchTb; this.DoSelectValueEvent(info); }
private void Document(ToolStripButton sender) { if (ucMatchTbInfo1.CurrentSelectValue == null) { return; } Model.Info_matchTb info = ucMatchTbInfo1.CurrentSelectValue as Model.Info_matchTb; GaoShan.Sales.UI.Win.FmReoGridShow fmReoGridShow = new GaoShan.Sales.UI.Win.FmReoGridShow(); fmReoGridShow.SetReportBind(new GaoShan.Sales.UI.Report.FmMatchTbManagerReport(), info); fmReoGridShow.ShowDialog(); }
private void DocumentRemove(ToolStripButton sender) { if (ucMacchTbList1.CurrentSelectValue == null) { return; } Model.Info_matchTb info = ucMacchTbList1.CurrentSelectValue as Model.Info_matchTb; string msg = string.Format("确定删除:{0},{1}配套表?", info.Odr_No, info.MatchTb_Name); if (Miles.Framework.UI.Function.Dialog.ShowQuestionYesNo(msg)) { if (manager.Remove(info)) { LoadAll(); } } }
public override void SetDataSource(object dataSource) { Clear(); base.SetDataSource(dataSource); base.selectValue = dataSource; if (dataSource == null) { return; } Model.Info_matchTb info = dataSource as Model.Info_matchTb; this.Tag = info.MatchTb_Id; this.SetDataBind(dataSource); //商品列表添加 this.mDataGridItem.SetDataSource <Model.Info_matchTb_item>(info.Items); }
private void Document(ToolStripButton sender) { if (this.mDataGrid1.CurrentRow == null) { return; } Model.Info_matchTb info = mDataGrid1.GetCurrentEntity() as Model.Info_matchTb; if (info.Items.Count == 0) { info.Items = manager.GetMatchTbItems(info.MatchTb_Id); } GaoShan.Sales.UI.Win.FmReoGridShow fmReoGridShow = new GaoShan.Sales.UI.Win.FmReoGridShow(); fmReoGridShow.SetReportBind(new GaoShan.Sales.UI.Report.FmMatchTbManagerReport(), info); fmReoGridShow.ShowDialog(); }
public override void LoadDataSource(Worksheet sheet, object dataSource) { Model.Info_matchTb info = dataSource as Model.Info_matchTb; ReplaceVar(info, false); //替换静态变量 Dictionary <string, object> vars = GetMatchTbVars(info); ReplaceVar(vars); //InsertTheItems(info.Items); InsertItems(info.Items, tmpXlsItem); MergeItems(info.Items); //插入动态数据 //InsertTable(info.Items, GetItemMapArray); }
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); }
private void UcMacchTbList1_SelectValueChange(object sender, object obj) { Model.Info_matchTb infoTb = obj as Model.Info_matchTb; ucMatchTbInfo1.SetDataSource(infoTb); }
public void UpdateCurrentValue(Model.Info_matchTb info) { this.mDataGridNvl.EditCurrentItem <Model.Info_matchTb>(info); }