public override bool Save(ToolStripButton sender) { Model.Tb_tmp_info obj = d_cmb_Tmp.SelectedItem as Model.Tb_tmp_info; if (obj == null) { Miles.Framework.UI.Function.MForm.SetToolTip(this.d_cmb_Tmp, "请选择合同模板", 1000); return(false); } 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_OrderMain info = this.GetDataBind <Model.Info_OrderMain>(); info.Tmp_Id = obj.Tmp_Id; //info.Odr_No = this.Tag as string; info.Odr_Type = obj.Order_Type; info.Oper_Code = user.Employ_Code; mDataGrid2.EndEdit(); Dictionary <string, string> fieldExtend = new Dictionary <string, string>(); foreach (Model.Info_tmp_map map in mDataGrid2.GetDataSource <Model.Info_tmp_map>()) { if (string.IsNullOrEmpty(map.Var_Value)) { MessageBox.Show(string.Format("参数值:{0}不能为空", map.Var_Explain)); return(false); } fieldExtend.Add(map.Var_Text, map.Var_Value); } info.FieldExtend = fieldExtend; if (ucOrderProtocol1.StreamBody == null || ucOrderProtocol1.StreamBody.Length < 1) { Miles.Framework.UI.Function.MForm.SetToolTip(this.ucOrderProtocol1, "文本不能为空", 1000); return(false); } info.Odr_Clause = ucOrderProtocol1.StreamBody.ToArray(); info.Odr_No_Main = info.Odr_No; bool blFlag = orderManager.SaveOrderAllInfo(info, blUpdate); if (blFlag) { this.DoSelectValueEvent(info); } return(blFlag); }
private bool DoAdoptOrder(Miles.Coro.ORM.Repository r, Model.Info_OrderMain info) { int odrState = (int)Enum.OrderState.Pass;//2; info.Odr_State = odrState; Model.Tb_order_log log = new Model.Tb_order_log(); log.Odr_No = info.Odr_No; log.Oper_log = "合同审核通过"; log.Msg = "合同审核通过"; if (!WriteLog(r, log, info)) { return(false); } if (!UpdateOrderState(r, info)) { return(false); } //新建合同摘要表部分数据 if (!DoNewFinOrderGen(r, info)) { return(false); } //新建项目联络单要表部分数据 if (!DoNewLinkBill(r, info)) { return(false); } return(true); }
public override void SetDataSource(object dataSource) { Clear(); lblState.Text = "修改订单"; base.SetDataSource(dataSource); base.selectValue = dataSource; if (dataSource == null) { return; } blUpdate = true; Model.Info_OrderMain info = dataSource as Model.Info_OrderMain; //this.Tag = info.Odr_No; this.SetDataBind(dataSource); //商品列表添加 ucOrderItem1.SetDataSource(info); //加载变量部分 //模板部分先添加-选择模板后就自动加载了 //遍历变量,赋值 foreach (DataGridViewRow row in mDataGrid2.Rows) { Model.Info_tmp_map map = row.DataBoundItem as Model.Info_tmp_map; map.Var_Value = info.FieldExtend.ContainsKey(map.Var_Text) ? info.FieldExtend[map.Var_Text] : null; } //如果数据中条款数据为空,那么从选择的模板中调出来 if (info.Odr_Clause != null) { ucOrderProtocol1.SetDataSource(new MemoryStream(info.Odr_Clause)); } }
void mDataGridNvl_CurrentRowChanged(object sender, EventArgs e) { if (this.mDataGridNvl.CurrentRow == null) { return; } Model.Info_OrderMain info = mDataGridNvl.GetCurrentEntity() as Model.Info_OrderMain; this.DoSelectValueEvent(info); }
protected override void PrintPreview(ToolStripButton sender) { if (this.ucOrderList1.CurrentSelectValue == null) { return; } Model.Info_OrderMain info = ucOrderList1.CurrentSelectValue as Model.Info_OrderMain; Doc.DocBuilder.PrintDocPreview(new MemoryStream(info.Odr_BodyText), Doc.DocBuilder.ReportName); }
protected override void Save(ToolStripButton sender) { if (this.ucBody.Save(sender)) { Model.Info_OrderMain info_OrderMain = this.ucBody.CurrentSelectValue as Model.Info_OrderMain; this.SetButtonClickResultTip(sender, "保存成功"); if (SelectOrderChange != null) { SelectOrderChange(info_OrderMain); } } }
protected override void PrintPreview(ToolStripButton sender) { if (this.ucOrderList1.CurrentSelectValue == null) { return; } Model.Info_OrderMain info = ucOrderList1.CurrentSelectValue as Model.Info_OrderMain; Doc.DocBuilder docBuilder = new Doc.DocBuilder(info); Doc.DocBuilder.PrintDocPreview(docBuilder.ToStream(info.Odr_Clause), Doc.DocBuilder.ReportName); }
/// <summary> /// 拟定合同提交操作 /// </summary> /// <param name="info"></param> /// <returns></returns> public bool CommitOrder(Model.Info_OrderMain info) { if (ExistParentEmploy(info.Oper_Code)) { int odrState = (int)Enum.OrderState.Commit;// 1; info.Odr_State = odrState; return(UpdateOrderState(this.Repository, info)); } else { return(this.BatchTrans().Append <Model.Info_OrderMain>(DoAdoptOrder, info).Save()); } }
protected override bool BtnOkClick() { if (mDataGrid1.CurrentRow == null) { return(false); } Model.Info_OrderMain info = mDataGrid1.GetCurrentEntity() as Model.Info_OrderMain; this.DoSelectValueEvent(info); return(true); }
public bool UpdateOrderState(Miles.Coro.ORM.Repository r, Model.Info_OrderMain info) { if (r.Update <Model.Info_OrderMain>() .Set() .Field(Model.Tb_order_main.Table.Odr_State, info.Odr_State) .EndSet() .Where().And(Model.Info_OrderMain.Table.Odr_No, info.Odr_No) .EndWhere() .Save() < 1) { return(false); } return(true); }
private void DocumentEdit() { if (this.ucOrderList1.CurrentSelectValue == null) { return; } Model.Info_OrderMain info = ucOrderList1.CurrentSelectValue as Model.Info_OrderMain; FmOrderInfo fm = new FmOrderInfo(info); fm.SelectOrderChange += (obj) => { LoadSelfOrder(); }; fm.ShowDialog(); }
private void DocumentRemove() { if (this.ucOrderList1.CurrentSelectValue == null) { return; } Model.Info_OrderMain info = ucOrderList1.CurrentSelectValue as Model.Info_OrderMain; string msg = string.Format("确定删除:{0},{1}?", info.Odr_No, info.Odr_Prt_Name); if (Miles.Framework.UI.Function.Dialog.ShowQuestionYesNo(msg)) { if (manager.Remove(info)) { LoadSelfOrder(); } } }
private void BtnQuery_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtOrderNo.Text)) { return; } Model.Info_OrderMain orderMain = manager.FindTheOrderInfo(txtOrderNo.Text); if (orderMain == null) { Miles.Framework.UI.Function.MForm.SetToolTip(btnQuery, "没有满足条件的合同信息", 1000); } mDataGrid1.SetDataSource <Model.Info_OrderMain>(new List <Info_OrderMain>() { orderMain }); }
private void Check(ToolStripButton sender) { if (this.ucOrderList1.CurrentSelectValue == null) { return; } Model.Info_OrderMain info = ucOrderList1.CurrentSelectValue as Model.Info_OrderMain; string msg = string.Format("确定通过:{0},{1}?{2}总金额为:{3}", info.Odr_No, info.Jia_Name, Environment.NewLine, info.Tot_Cost); if (Miles.Framework.UI.Function.Dialog.ShowQuestionYesNo(msg)) { if (manager.CheckOrderPass(info)) { LoadSelfOrder(); } } }
private void Stop(ToolStripButton sender) { FmOrderSelect fmOrderNo = new FmOrderSelect(); fmOrderNo.SelectValue += (obj) => { Model.Info_OrderMain info = obj as Model.Info_OrderMain; string msg = string.Format("确定终止:{0},{1}?", info.Odr_No, info.Odr_Prt_Name); if (Miles.Framework.UI.Function.Dialog.ShowQuestionYesNo(msg)) { if (manager.OrderTermination(info)) { Query(null); } } }; fmOrderNo.ShowDialog(); }
private void Backward(ToolStripButton sender) { if (this.ucOrderList1.CurrentSelectValue == null) { return; } Model.Info_OrderMain info = ucOrderList1.CurrentSelectValue as Model.Info_OrderMain; Win.FmCheckCommentInfo fm = new Win.FmCheckCommentInfo(); fm.SelectValue += (obj) => { if (manager.CheckOrderNoPass(info, obj.ToString())) { LoadSelfOrder(); } }; fm.ShowDialog(); }
private void UcOrderList1_SelectValueChange(object sender, object obj) { if (this.ucOrderList1.CurrentSelectValue == null) { return; } Model.Info_OrderMain info_OrderMain = this.ucOrderList1.CurrentSelectValue as Model.Info_OrderMain; if (info_OrderMain.Items.Count == 0) { info_OrderMain.Items = manager.GetOrderItems(info_OrderMain.Odr_No); } if (info_OrderMain.Odr_BodyText == null) { info_OrderMain.Odr_BodyText = manager.GetOrderBodyText(info_OrderMain.Odr_No); } Doc.DocBuilder.LoadCtrViewDoc(this.mRichEditOnly1, new MemoryStream(info_OrderMain.Odr_BodyText)); }
protected override void Query(ToolStripButton sender) { FmOrderFind fmOrderNo = new FmOrderFind(); fmOrderNo.FindOrderNoList = (odrNo) => { return(manager.QueryCommitCostWithOrdNo(odrNo)); }; fmOrderNo.SelectValue += (obj) => { Model.Info_OrderMain info = obj as Model.Info_OrderMain; ucProjectCostInfo1.Clear(); ucProjectCostList1.Clear(); List <Model.Info_project_Cost> list = manager.FindTheDoneProjectCost(info.Odr_No); ucProjectCostList1.SetDataSource(list); }; fmOrderNo.ShowDialog(); }
private void UcOrderList1_SelectValueChange(object sender, object obj) { if (this.ucOrderList1.CurrentSelectValue == null) { return; } Model.Info_OrderMain info_OrderMain = this.ucOrderList1.CurrentSelectValue as Model.Info_OrderMain; if (info_OrderMain.Items.Count == 0) { info_OrderMain.Items = manager.GetOrderItems(info_OrderMain.Odr_No); } if (info_OrderMain.Odr_Clause == null) { info_OrderMain.Odr_Clause = manager.GetOrderClause(info_OrderMain.Odr_No); } Doc.DocBuilder docBuilder = new Doc.DocBuilder(info_OrderMain); Doc.DocBuilder.LoadCtrViewDoc(this.mRichEditOnly1, docBuilder.ToStream(info_OrderMain.Odr_Clause)); }
/// <summary> /// 有实际数值构造 /// </summary> /// <param name="orderMain"></param> public DocBuilder(Model.Info_OrderMain orderMain) { this.orderMain = orderMain; this.infoTmp = tmpManager.GetTheTmpAllInfo(orderMain.Tmp_Id); }
public void UpdateCurrentValue(Model.Info_OrderMain info) { this.mDataGridNvl.EditCurrentItem <Model.Info_OrderMain>(info); }
/// <summary> /// 审核不通过 /// </summary> /// <param name="info"></param> /// <returns></returns> public bool RejectOrder(Model.Info_OrderMain info) { return(this.BatchTrans().Append <Model.Info_OrderMain>(DoRejectOrder, info).Save()); }