public override bool Remove(Info_link_bill info) { return(this.BatchTrans().Append <long>( (r, id) => { if (r.Remove <Model.Tb_link_bill>() .Where().And(Model.Tb_link_bill.Table.LinkBill_Id, info.LinkBill_Id) .EndWhere() .Save() < 1) { return false; } return true; }, info.LinkBill_Id).Append <long>( (r, id) => { if (r.Remove <Model.Tb_link_bill_tent>() .Where().And(Model.Tb_link_bill_tent.Table.LinkBill_Id, info.LinkBill_Id) .EndWhere() .Save() < 0) { return false; } return true; }, info.LinkBill_Id) .Save()); }
internal bool BackLinkBill(Info_link_bill info) { //记录日志 //更新标志位 return(this.BatchTrans() .Append <long>((r, id) => { 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 (r.Update <Model.Tb_link_bill>() .Set() .Field(Model.Tb_link_bill.Table.Bill_State, (int)Enum.LinkState.New) .EndSet() .Where() .And(Model.Tb_link_bill.Table.LinkBill_Id, id) .EndWhere() .Save() < 1) { return false; } return true; }, info.LinkBill_Id) .Save()); }
public bool SaveLinkBillAll(Info_link_bill info) { ExeBatchTrans batchTrans = this.BatchTrans(); batchTrans .Append <long>( (r, id) => { if (r.Remove <Model.Tb_link_bill>() .Where().And(Model.Tb_link_bill.Table.LinkBill_Id, info.LinkBill_Id) .EndWhere() .Save() < 0) { return(false); } return(true); }, info.LinkBill_Id).Append <long>( (r, id) => { if (r.Remove <Model.Tb_link_bill_tent>() .Where().And(Model.Tb_link_bill_tent.Table.LinkBill_Id, info.LinkBill_Id) .EndWhere() .Save() < 0) { return(false); } return(true); }, info.LinkBill_Id) .Append <Tb_link_bill> ( (r, i) => { return(Add(r, i)); }, info); int seqNo = 1; foreach (var item in info.Items) { batchTrans.Append <Tb_link_bill_tent> ( (r, i) => { i.LinkBill_Id = info.LinkBill_Id; i.Item_Id = NewId(); i.Item_Seq = seqNo; return(Add(r, i)); }, item); seqNo++; } return(batchTrans.Save()); }
public bool SetDoneMatchTb(Info_link_bill info) { return(this.Repository.Update <Model.Tb_link_bill>() .Set() .Field(Model.Tb_link_bill.Table.Is_MatchTb, (int)Enum.IsFlag.Yes) .EndSet() .Where() .And(Model.Tb_link_bill.Table.LinkBill_Id, info.LinkBill_Id) .EndWhere() .Save() > 0 ? true : false); }
internal bool CancelLinkBill(Info_link_bill info) { //作废原来的单据标志位=-1 //新建一个取消的联络单,编码相同 return(this.BatchTrans() .Append <long>((r, id) => { 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 (r.Update <Model.Tb_link_bill>() .Set() .Field(Model.Tb_link_bill.Table.Bill_State, (int)Enum.LinkState.Invalid) .EndSet() .Where() .And(Model.Tb_link_bill.Table.LinkBill_Id, id) .EndWhere() .Save() < 1) { return false; } info.LinkBill_Id = NewId(); info.Bill_State = (int)Enum.LinkState.Valid; // 1; //直接提交状态 info.LinkBill_Type = (int)Enum.LinkBillType.Cancel; // 1; info.LinkBill_Name += "-取消单"; if (!this.Add(r, info)) { return false; } foreach (var v in info.Items) { v.Item_Id = NewId(); v.LinkBill_Id = info.LinkBill_Id; if (!this.Add(r, v)) { return false; } } return true; }, info.LinkBill_Id) .Save()); }
private bool DoNewLinkBill(Repository r, Info_OrderMain info) { Model.Info_link_bill linkBil = new Info_link_bill(); linkBil.LinkBill_Id = NewId(); linkBil.Bill_State = (int)Enum.LinkState.New;// 0; linkBil.Employ_Code = info.Oper_Code; linkBil.Jia_Name = info.Jia_Name; linkBil.Let_Bud_EDate = info.Let_Bud_EDate; linkBil.Let_Bud_SDate = info.Let_Bud_SDate; linkBil.Let_Entry_Date = info.Let_Entry_Date; linkBil.Let_Rm_EDate = info.Let_Rm_EDate; linkBil.Let_Rm_SDate = info.Let_Rm_SDate; linkBil.Let_Use_EDate = info.Let_Use_EDate; linkBil.Let_Use_SDate = info.Let_Use_SDate; linkBil.Odr_Bud_Palce = info.Odr_Bud_Palce; linkBil.Odr_Bud_Party = info.Odr_Bud_Party; linkBil.Odr_Date = info.Odr_Date; linkBil.Odr_Fixed_Mode = info.Odr_Fixed_Mode; linkBil.Odr_Ground_State = info.Odr_Ground_State; linkBil.Odr_No = info.Odr_No; linkBil.Odr_Place_Linkman = info.Odr_Place_Linkman; linkBil.Odr_Place_Phone = info.Odr_Place_Phone; linkBil.Odr_Prt_Name = info.Odr_Prt_Name; linkBil.Odr_Trans_Party = info.Odr_Trans_Party; linkBil.Odr_Type = info.Odr_Type; linkBil.Odr_Water_proof = info.Odr_Water_proof; if (!this.Add(r, linkBil)) { return(false); } foreach (var v in info.Items) { if (v.Product_Name.Equals("篷房")) { Model.Tb_link_bill_tent item = new Tb_link_bill_tent(); item.LinkBill_Id = linkBil.LinkBill_Id; item.Item_Id = NewId(); item.Item_Seq = v.Item_Seq; item.Item_Spec = v.Item_Spec; if (!this.Add(r, item)) { return(false); } } } return(true); }
private void mDataGridNvl_CurrentRowChanged(object sender, EventArgs e) { this.mDataGridItem.Clear(); if (this.mDataGridNvl.CurrentRow == null) { return; } Info_link_bill info = mDataGridNvl.GetCurrentEntity() as Info_link_bill; Sales.UI.Report.FmLinkBillManagerReport report = new Sales.UI.Report.FmLinkBillManagerReport(); //report.GridControl = this.reoGridLink; report.Show(info, this.reoGridLink); List <Info_store_out_item> items = manager.QueryOutItems(info.LinkBill_Id); mDataGridItem.SetDataSource <Info_store_out_item>(items); this.DoSelectValueEvent(info); }
private void Check(ToolStripButton sender) { if (tabControl1.SelectedIndex != 0) { return; } if (ucBackOrder1.CurrentSelectValue == null) { return; } Info_link_bill link = ucBackOrder1.CurrentSelectValue as Info_link_bill; FmStoreInOrderDone fm = new FmStoreInOrderDone(link); fm.SelectValue += (obj) => { LoadNotDoneLink(); }; fm.ShowDialog(); }
void mDataGridNvl_CurrentRowChanged(object sender, EventArgs e) { this.mDataGridMatchTb.Clear(); if (this.mDataGridNvl.CurrentRow == null) { return; } Info_link_bill info = mDataGridNvl.GetCurrentEntity() as Info_link_bill; Sales.UI.Report.FmLinkBillManagerReport report = new Sales.UI.Report.FmLinkBillManagerReport(); //report.GridControl = this.reoGridLink; report.Show(info, this.reoGridLink); List <GaoShan.Sales.Model.Info_matchTb> ltMatchTb = matchTbManager.FindAllLinkMatchTbs(info.LinkBill_Id); mDataGridMatchTb.SetDataSource <GaoShan.Sales.Model.Info_matchTb>(ltMatchTb); this.DoSelectValueEvent(info); }
public bool DoneOut(Info_link_bill link) { ExeBatchTrans exeBatchTrans = this.BatchTrans(); exeBatchTrans.Append <long>((r, id) => { if (r.Update <Tb_link_bill>() .Set().Field(Tb_link_bill.Table.Is_OutStore, (int)Enum.IsFlag.Yes) .EndSet() .Where() .And(Tb_link_bill.Table.LinkBill_Id, id) .EndWhere() .Save() < 1) { return(false); } return(true); }, link.LinkBill_Id); return(exeBatchTrans.Save()); }
private void Check(ToolStripButton sender) { if (tabControl1.SelectedIndex != 0) { return; } if (ucOutOrder1.CurrentSelectValue == null) { return; } Info_link_bill link = ucOutOrder1.CurrentSelectValue as Info_link_bill; string msg = string.Format("确定完成:{0},{1}项目联络单?", link.Odr_No, link.LinkBill_Name); if (Miles.Framework.UI.Function.Dialog.ShowQuestionYesNo(msg)) { if (manager.DoneOut(link)) { LoadNeedCreateOut(); this.SetButtonClickResultTip(sender, "保存成功"); } } }
public bool DoneBackOrder(Info_link_bill info) { //更新项目联络单完成标志位 ExeBatchTrans exeBatchTrans = this.BatchTrans(); exeBatchTrans.Append <long>((r, id) => { if (r.Update <Tb_link_bill>() .Set().Field(Tb_link_bill.Table.Is_BackStore, (int)Enum.IsFlag.Yes) .EndSet() .Where() .And(Tb_link_bill.Table.LinkBill_Id, id) .EndWhere() .Save() < 1) { return(false); } return(true); }, info.LinkBill_Id); return(exeBatchTrans.Save()); }
public bool CommitLinkBill(Info_link_bill info) { //修改联络单状态 //新建工程部费用数据 //Model.Tb_project_Cost tbProjectCost = new Tb_project_Cost(); //tbProjectCost.Cost_State = 0; //tbProjectCost.Employ_Code = info.Employ_Code; //tbProjectCost.Employ_Name = info.Employ_Name; //tbProjectCost.Jia_Name = info.Jia_Name; //tbProjectCost.LinkBill_Id = info.LinkBill_Id; //tbProjectCost.LinkBill_Name = info.LinkBill_Name; //tbProjectCost.Odr_Bud_Palce = info.Odr_Bud_Palce; //tbProjectCost.Odr_No = info.Odr_No; //tbProjectCost.Odr_No = info.Odr_No; //tbProjectCost.Odr_Prt_Name = info.Odr_Prt_Name; //tbProjectCost.Odr_Type = info.Odr_Type; return(this.BatchTrans() .Append <long>((r, id) => { if (r.Update <Model.Tb_link_bill>() .Set() .Field(Model.Tb_link_bill.Table.Bill_State, (int)Enum.LinkState.Valid) .EndSet() .Where() .And(Model.Tb_link_bill.Table.LinkBill_Id, id) .EndWhere() .Save() < 1) { return false; } return true; }, info.LinkBill_Id) .Save()); }
private void DocumentAdd(ToolStripButton sender) { if (tabControl1.SelectedIndex != 0) { return; } if (ucOutOrder1.CurrentSelectValue == null) { return; } Info_link_bill link = ucOutOrder1.CurrentSelectValue as Info_link_bill; Model.Info_store_out info = Miles.Coro.Common.Utils.CopyToOther <Info_link_bill, Model.Info_store_out>(link); info.StoreOut_Type = (int)Enum.OutStoreType.OrderOut; FmOutOrderInfo fm = new FmOutOrderInfo(info); fm.SelectValue += (obj) => { LoadNotDoneOut(); tabControl1.SelectedIndex = 1; }; fm.ShowDialog(); }
private void DocumentAdd(ToolStripButton sender) { if (tabControl1.SelectedIndex != 0) { return; } if (ucBackOrder1.CurrentSelectValue == null) { return; } Info_link_bill link = ucBackOrder1.CurrentSelectValue as Info_link_bill; Model.Info_store_in info = Miles.Coro.Common.Utils.CopyToOther <Info_link_bill, Model.Info_store_in>(link); info.StoreIn_Type = (int)Enum.InStoreState.Valid; FmInOrderInfo fm = new FmInOrderInfo(info); fm.SelectValue += (obj) => { LoadNotDoneIn(); tabControl1.SelectedIndex = 1; }; fm.ShowDialog(); }
public override bool Add(Info_link_bill t) { throw new NotImplementedException(); }
public bool CancelBill(Info_link_bill info) { return(processManager.CancelLinkBill(info)); }
public bool BackBill(Info_link_bill info) { return(processManager.BackLinkBill(info)); }
public bool Commit(Info_link_bill info) { return(processManager.CommitLinkBill(info)); }