public void Delete(Model.ShouldPayAccount shouldPayAccount) { try { //删除应付应收票据 var bills = new BL.AtBillsIncomeManager().SelectByShouldPayAccountId(shouldPayAccount.ShouldPayAccountId); if (bills != null && bills.Count > 0) { foreach (var item in bills) { new BL.AtBillsIncomeManager().Delete(item.BillsId); } } //删除本身 Delete(shouldPayAccount.ShouldPayAccountId); //删除应收账款明细表的查询条件 new BL.ShouldPayAccountConditionManager().Delete(shouldPayAccount.ShouldPayAccountConditionId); //删除会计传票 if (shouldPayAccount.AtSummon != null) { new BL.AtSummonManager().Delete(shouldPayAccount.AtSummon); } } catch { BL.V.RollbackTransaction(); throw; } }
//public ROInvoiceCGlistBiao(ConditionCO condition) // : this() //{ // this.xrLabelReportName.Text = "‘ª¸¶Ù~¿îÃ÷¼š±í"; // this.lblSupplierName.Text = condition.SupplierStart == null ? "" : condition.SupplierStart.SupplierFullName; // this.lblInvoiceDateRange.Text += (condition.StartInvoiceDate == null ? null : condition.StartInvoiceDate.Value.ToString("yyyy-MM-dd")) + " - " + (condition.EndInvoiceDate == null ? null : condition.EndInvoiceDate.Value.ToString("yyyy-MM-dd")); // this.lblPayDate.Text += (condition.StartFKDate == null ? null : condition.StartFKDate.Value.ToString("yyyy-MM-dd")) + " - " + (condition.EndFKDate == null ? null : condition.EndFKDate.Value.ToString("yyyy-MM-dd")); // this.lblTel.Text += condition.SupplierStart == null ? "" : condition.SupplierStart.SupplierPhone1; // this.lblAddress.Text += condition.SupplierStart == null ? "" : condition.SupplierStart.CompanyAddress; // this.lblFax.Text += condition.SupplierStart == null ? "" : condition.SupplierStart.SupplierFax; // if (condition.SupplierStart != null) // { // this.lblPayMethod.Text += condition.SupplierStart.PayMethod == null ? "" : condition.SupplierStart.PayMethod.PayMethodName; // this.lblNoId.Text += condition.SupplierStart.NoId; // } // //Bind // this.DataSource = this.invoicecgmanager.SelectByConditionCOBiao(condition.StartInvoiceDate, condition.EndInvoiceDate, condition.StartJHDate, condition.EndJHDate, condition.StartFKDate, condition.EndFKDate, condition.SupplierStart, condition.SupplierEnd, condition.ProductStart, condition.ProductEnd, condition.COStartId, condition.COEndId, condition.CusXOId, condition.EmpStart, condition.EmpEnd); // if (this.DataSource == null || (this.DataSource as DataTable).Rows.Count == 0) // throw new Helper.InvalidValueException("²éŸoÓ›ä›!"); // string sF; // decimal jine = 0, shuie = 0, zonge = 0; // foreach (DataRow dr in (this.DataSource as DataTable).Rows) // { // //if (dr[0].ToString().Contains("PID") || dr[0].ToString().Contains("POD")) // //{ // // try // // { // // //string DJ = dr["DanJia"].ToString(); // // //double Quantity = string.IsNullOrEmpty(dr["JHSL"].ToString()) ? 0 : Convert.ToDouble(dr["JHSL"].ToString()); // // //dr["DanJia"] = BL.SupplierProductManager.CountPrice(DJ, Quantity); // // //dr["JinE"] = Convert.ToDouble(dr["DanJia"]) * Convert.ToDouble(dr["JHSL"]); // // //dr["ShuiE"] = Convert.ToDouble(dr["JinE"]) * 0.05; // // //dr["Total"] = Convert.ToDouble(dr["JinE"]) + Convert.ToDouble(dr["ShuiE"]); // // } // // catch (Exception ex) // // { // // sF = ex.Message; // // } // //} // jine += Convert.ToDecimal(dr["JinE"]); // shuie += Convert.ToDecimal(dr["ShuiE"]); // } // zonge = jine + shuie; // if (this.DataSource == null || (this.DataSource as DataTable).Rows.Count == 0) // throw new global::Helper.InvalidValueException("ŸoÓ›ä›"); // this.tcJHDH.DataBindings.Add("Text", this.DataSource, "JHDN"); // this.tcJHRQ.DataBindings.Add("Text", this.DataSource, "JHRQ", "{0:yyyy-MM-dd}"); // this.tcProductName.DataBindings.Add("Text", this.DataSource, "ProductName"); // this.tcJHSL.DataBindings.Add("Text", this.DataSource, "JHSL"); // this.tcDJ.DataBindings.Add("Text", this.DataSource, "DanJia", "{0:0.####}"); // this.tcJinE.DataBindings.Add("Text", this.DataSource, "JinE", global::Helper.DateTimeParse.GetFormatA(BL.V.SetDataFormat.CGJEXiao.Value)); // this.tcCGorWWDanHao.DataBindings.Add("Text", this.DataSource, "CGorWWDanHao"); // this.tcDW.DataBindings.Add("Text", this.DataSource, "ProductUnit"); // this.TCZJinE.Text = this.invoicecgmanager.GetSiSheWuRu(jine, 0).ToString(); // this.TCTotalShuiE.Text = this.invoicecgmanager.GetSiSheWuRu(shuie, 0).ToString(); // this.TCTotalMoney.Text = this.invoicecgmanager.GetSiSheWuRu(zonge, 0).ToString(); // //this.TCZJinE.Summary.FormatString = "{0:0}"; // //this.TCZJinE.Summary.Func = SummaryFunc.Sum; // //this.TCZJinE.Summary.IgnoreNullValues = true; // //this.TCZJinE.Summary.Running = SummaryRunning.Report; // //this.TCZJinE.DataBindings.Add("Text", this.DataSource, "JinE"); // //this.TCTotalShuiE.Summary.FormatString = "{0:0}"; // //this.TCTotalShuiE.Summary.Func = SummaryFunc.Sum; // //this.TCTotalShuiE.Summary.IgnoreNullValues = true; // //this.TCTotalShuiE.Summary.Running = SummaryRunning.Report; // //this.TCTotalShuiE.DataBindings.Add("Text", this.DataSource, "ShuiE"); // //this.TCTotalMoney.Summary.FormatString = "{0:0}"; // //this.TCTotalMoney.Summary.Func = SummaryFunc.Sum; // //this.TCTotalMoney.Summary.IgnoreNullValues = true; // //this.TCTotalMoney.Summary.Running = SummaryRunning.Report; // //this.TCTotalMoney.DataBindings.Add("Text", this.DataSource, "Total"); //} //public ROInvoiceCGlistBiao(Model.Supplier supplier, string InvoiceDate, string FKDate, string Jine, string ShuiE, string ZheRang, string FKZheRang, string Money, DataTable dt, string AtSummonId, string YFId) public ROInvoiceCGlistBiao(Model.ShouldPayAccount shouldPayAccount, DataTable dt, string AtSummonId) : this() { this.xrLabelReportName.Text = "Schedule of accounts payable"; this.lblInvoiceDateRange.Text += shouldPayAccount.InvoiceDate; this.lblPayDate.Text += shouldPayAccount.PayDate; this.lblAtSummonId.Text += AtSummonId; this.lblEmployee.Text += shouldPayAccount.Employee == null ? null : shouldPayAccount.Employee.EmployeeName; if (shouldPayAccount.Supplier != null) { this.lblSupplierName.Text = shouldPayAccount.Supplier.SupplierFullName; this.lblTel.Text += shouldPayAccount.Supplier.SupplierPhone1; this.lblAddress.Text += shouldPayAccount.Supplier.CompanyAddress; this.lblFax.Text += shouldPayAccount.Supplier.SupplierFax; this.lblPayMethod.Text += shouldPayAccount.Supplier.PayMethod == null ? "" : shouldPayAccount.Supplier.PayMethod.PayMethodName; this.lblNoId.Text += shouldPayAccount.Supplier.NoId; } this.TCZJinE.Text = shouldPayAccount.JinE == null ? "0" : shouldPayAccount.JinE.ToString(); this.TCTotalShuiE.Text = shouldPayAccount.ShuiE == null ? "0" : shouldPayAccount.ShuiE.ToString(); this.TCTotalMoney.Text = shouldPayAccount.Total == null ? "0" : shouldPayAccount.Total.ToString(); this.TCZheRang.Text = shouldPayAccount.ZheRang == null ? "0" : shouldPayAccount.ZheRang.ToString(); this.TCFKZheRang.Text = shouldPayAccount.PayZheRang == null ? "0" : shouldPayAccount.PayZheRang.ToString(); this.DataSource = dt; this.tcJHDH.DataBindings.Add("Text", this.DataSource, "JHDN"); this.tcJHRQ.DataBindings.Add("Text", this.DataSource, "JHRQ", "{0:yyyy-MM-dd}"); this.tcProductName.DataBindings.Add("Text", this.DataSource, "ProductName"); this.tcJHSL.DataBindings.Add("Text", this.DataSource, "JHSL"); this.tcDJ.DataBindings.Add("Text", this.DataSource, "DanJia", "{0:0.####}"); this.tcJinE.DataBindings.Add("Text", this.DataSource, "JinE", global::Helper.DateTimeParse.GetFormatA(BL.V.SetDataFormat.CGJEXiao.Value)); this.tcCGorWWDanHao.DataBindings.Add("Text", this.DataSource, "CGorWWDanHao"); this.tcDW.DataBindings.Add("Text", this.DataSource, "ProductUnit"); //this.xrSubreport1.ReportSource = new ROInvoiceCGlistSub(shouldPayAccount.Detail); }
/// <summary> /// Insert a ShouldPayAccount. /// </summary> public void Insert(Model.ShouldPayAccount shouldPayAccount) { // // todo:add other logic here // try { BL.V.BeginTransaction(); shouldPayAccount.InsertTime = DateTime.Now; shouldPayAccount.UpdateTime = DateTime.Now; accessor.Insert(shouldPayAccount); foreach (var item in shouldPayAccount.Detail) { //2017年6月24日20:06:45 改為可以先建立發票,打應付賬款明細表時自動拉出對應的發票,對已這部分已存在的要修改不是增加 if (detailmanager.ExistsPrimary(item.ShouldPayAccountDetailId)) { detailmanager.Update(item); } else { detailmanager.Insert(item); } } BL.V.CommitTransaction(); } catch { BL.V.RollbackTransaction(); throw; } }
protected override void MoveLast() { if (this.flag == 1) { this.flag = 0; return; } this.shouldPayAccount = this.manager.GetLast(); }
protected override void MovePrev() { Model.ShouldPayAccount model = this.manager.GetPrev(this.shouldPayAccount); if (model == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this.shouldPayAccount = model; }
public Model.ShouldPayAccount GetDetail(string id) { Model.ShouldPayAccount model = accessor.Get(id); if (model != null) { model.Detail = this.detailmanager.GetByHeaderId(id); } return(model); }
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ShouldPayFormList f = new ShouldPayFormList(); if (f.ShowDialog(this) == DialogResult.OK) { this.shouldPayAccount = f.SelectItem as Model.ShouldPayAccount; this.Refresh(); } }
//public ROInvoiceCGlistBiao(Model.Supplier supplier, string InvoiceDate, string FKDate, string Jine, string ShuiE, string ZheRang, string FKZheRang, string Money, DataTable dt, string AtSummonId, string YFId) public ROInvoiceCGlistBiao(Model.ShouldPayAccount shouldPayAccount, DataTable dt, string AtSummonId, IList <Model.AtBillsIncome> AtBillsIncomeList) : this() { this.xrLabelReportName.Text = "應付帳款明細表"; this.lblInvoiceDateRange.Text += shouldPayAccount.InvoiceDate; this.lblPayDate.Text += shouldPayAccount.PayDate; this.lblAtSummonId.Text += AtSummonId; this.lblEmployee.Text += shouldPayAccount.Employee == null ? null : shouldPayAccount.Employee.EmployeeName; if (shouldPayAccount.Supplier != null) { this.lblSupplierName.Text = shouldPayAccount.Supplier.SupplierFullName; this.lblTel.Text += shouldPayAccount.Supplier.SupplierPhone1; this.lblAddress.Text += shouldPayAccount.Supplier.CompanyAddress; this.lblFax.Text += shouldPayAccount.Supplier.SupplierFax; this.lblPayMethod.Text += shouldPayAccount.Supplier.PayMethod == null ? "" : shouldPayAccount.Supplier.PayMethod.PayMethodName; this.lblNoId.Text += shouldPayAccount.Supplier.NoId; } //支票编号 foreach (var item in AtBillsIncomeList) { this.lblZhiPiaoId.Text += item.Id + ","; } //this.lblZhiPiaoId.Text = this.lblZhiPiaoId.Text.Substring(0, this.lblZhiPiaoId.Text.LastIndexOf(",")); this.lblZhiPiaoId.Text = this.lblZhiPiaoId.Text.TrimEnd(','); this.TCZJinE.Text = shouldPayAccount.JinE == null ? "0" : shouldPayAccount.JinE.ToString(); this.TCTotalShuiE.Text = shouldPayAccount.ShuiE == null ? "0" : shouldPayAccount.ShuiE.ToString(); this.TCTotalMoney.Text = shouldPayAccount.Total == null ? "0" : shouldPayAccount.Total.ToString(); this.TCZheRang.Text = shouldPayAccount.ZheRang == null ? "0" : shouldPayAccount.ZheRang.ToString(); this.TCFKZheRang.Text = shouldPayAccount.PayZheRang == null ? "0" : shouldPayAccount.PayZheRang.ToString(); this.DataSource = dt; this.tcJHDH.DataBindings.Add("Text", this.DataSource, "JHDN"); this.tcJHRQ.DataBindings.Add("Text", this.DataSource, "JHRQ", "{0:yyyy-MM-dd}"); this.tcProductName.DataBindings.Add("Text", this.DataSource, "ProductName"); this.tcJHSL.DataBindings.Add("Text", this.DataSource, "JHSL"); this.tcDJ.DataBindings.Add("Text", this.DataSource, "DanJia", "{0:0.####}"); this.tcJinE.DataBindings.Add("Text", this.DataSource, "JinE", global::Helper.DateTimeParse.GetFormatA(BL.V.SetDataFormat.CGJEXiao.Value)); this.tcCGorWWDanHao.DataBindings.Add("Text", this.DataSource, "CGorWWDanHao"); this.tcDW.DataBindings.Add("Text", this.DataSource, "ProductUnit"); if (shouldPayAccount.Detail != null && shouldPayAccount.Detail.Count > 0) { this.xrSubreport1.ReportSource = new ROInvoiceCGlistSub(shouldPayAccount.Detail); } }
protected override void Delete() { if (this.shouldPayAccount == null) { return; } if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { Model.ShouldPayAccount model = this.manager.GetNext(this.shouldPayAccount); this.manager.Delete(this.shouldPayAccount.ShouldPayAccountId); if (model == null) { this.shouldPayAccount = this.manager.GetLast(); } else { this.shouldPayAccount = model; } } }
protected override void AddNew() { //会计传票 this.atSummon = new Model.AtSummon(); this.atSummon.SummonDate = DateTime.Now; this.atSummon.Id = this.atSummonManager.GetId(); this.atSummon.SummonId = Guid.NewGuid().ToString(); this.atSummon.Details = new List <Model.AtSummonDetail>(); this.atSummon.CreditTotal = 0; this.atSummon.TotalDebits = 0; this.shouldPayAccount = new Book.Model.ShouldPayAccount(); this.shouldPayAccount.ShouldPayAccountId = Guid.NewGuid().ToString(); this.shouldPayAccount.AtSummon = this.atSummon; this.shouldPayAccount.AtSummonId = this.atSummon.SummonId; //this.shouldPayAccount.AtBillsIncome = this.AtBillsIncome; //this.shouldPayAccount.AtBillsIncomeId = this.AtBillsIncome.BillsId; this.shouldPayAccount.Employee = BL.V.ActiveOperator.Employee; if (this.shouldPayAccount.Employee != null) { this.shouldPayAccount.EmployeeId = this.shouldPayAccount.Employee.EmployeeId; } //应付票据作业 //this.AtBillsIncome = new Model.AtBillsIncome(); //this.AtBillsIncome.BillsId = Guid.NewGuid().ToString(); //this.AtBillsIncome.IncomeCategory = "0"; //this.AtBillsIncome.BillsOften = "0"; //this.AtBillsIncome.TheOpenDate = DateTime.Now; this.atBillsIncomeList = new List <Model.AtBillsIncome>(); Model.AtBillsIncome model = new Book.Model.AtBillsIncome(); model.BillsId = Guid.NewGuid().ToString(); model.TheOpenDate = DateTime.Now; model.ShouldPayAccountId = this.shouldPayAccount.ShouldPayAccountId; this.atBillsIncomeList.Add(model); this.action = "insert"; }
/// <summary> /// Update a ShouldPayAccount. /// </summary> public void Update(Model.ShouldPayAccount shouldPayAccount) { // // todo: add other logic here. // try { BL.V.BeginTransaction(); shouldPayAccount.UpdateTime = DateTime.Now; accessor.Update(shouldPayAccount); detailmanager.DeleteByHeaderId(shouldPayAccount.ShouldPayAccountId); foreach (var item in shouldPayAccount.Detail) { detailmanager.Insert(item); } BL.V.CommitTransaction(); } catch { BL.V.RollbackTransaction(); throw; } }
public bool HasRowsBefore(Model.ShouldPayAccount e) { return(sqlmapper.QueryForObject <bool>("ShouldPayAccount.has_rows_before", e)); }
public ShouldPayForm(Model.ShouldPayAccount model) : this() { this.shouldPayAccount = model; this.flag = 1; }
public override void Refresh() { if (this.shouldPayAccount == null) { this.AddNew(); } else { if (this.action == "view") { this.shouldPayAccount = this.manager.GetDetail(this.shouldPayAccount.ShouldPayAccountId); } } this.atSummon = this.shouldPayAccount.AtSummon; //this.AtBillsIncome = this.shouldPayAccount.AtBillsIncome; if (this.atSummon != null) { if (this.action != "insert") { this.atSummon = this.atSummonManager.GetDetails(this.atSummon.SummonId); } this.txt_AtSummonId.EditValue = this.atSummon.Id; this.date_AtSummonDate.EditValue = this.atSummon.SummonDate; this.cobAtSummonCategory.EditValue = this.atSummon.SummonCategory; this.txt_JieTaotal.EditValue = this.atSummon.TotalDebits; this.txt_DaiTotal.EditValue = this.atSummon.CreditTotal; this.bindingSourceAtDetail.DataSource = this.atSummon.Details; } if (this.action != "insert") { this.atBillsIncomeList = this.AtBillsIncomeManager.SelectByShouldPayAccountId(this.shouldPayAccount.ShouldPayAccountId); } foreach (var item in this.atBillsIncomeList) { if (item.BillsOften == "0") { item.BillsOften = "未托收"; } else if (item.BillsOften == "1") { item.BillsOften = "已托收"; } else if (item.BillsOften == "2") { item.BillsOften = "已兑现"; } else { item.BillsOften = null; } } this.bindingSourceAtBill.DataSource = this.atBillsIncomeList; //if (this.atBillsIncomeList != null) //{ //this.date_YFKPDate.EditValue = this.AtBillsIncome.TheOpenDate; //this.txt_YFCheckId.Text = this.AtBillsIncome.Id; //this.date_YFStopDate.EditValue = this.AtBillsIncome.Maturity; //this.date_YFChangeDate.EditValue = this.AtBillsIncome.MoveDay; //this.date_YFYDDate.EditValue = this.AtBillsIncome.TheJpy; //this.cobYFInvoiceState.EditValue = this.AtBillsIncome.BillsOften; //this.spe_YFMoney.EditValue = this.AtBillsIncome.NotesMoney; //this.nccYFSubject.EditValue = this.AtBillsIncome.Subject; //this.nccYFSupplier.EditValue = this.AtBillsIncome.PassingObject == null ? null : new BL.SupplierManager().Get(this.AtBillsIncome.PassingObject); //this.nccYFBank.EditValue = this.AtBillsIncome.Bank; //this.AtBillsIncome.IncomeCategory = "1"; //this.txt_YFPMId.Text = this.AtBillsIncome.NotesAccount; //} this.txt_InvoiceDate.Text = this.shouldPayAccount.InvoiceDate; this.txt_FKDate.Text = this.shouldPayAccount.PayDate; this.nccSupplier.EditValue = this.shouldPayAccount.Supplier; this.txt_PayMethod.EditValue = this.shouldPayAccount.Supplier == null ? null : this.shouldPayAccount.Supplier.PayMethod; this.spe_JinE.EditValue = this.shouldPayAccount.JinE == null ? 0 : this.shouldPayAccount.JinE; this.spe_ShuiE.EditValue = this.shouldPayAccount.ShuiE == null ? 0 : this.shouldPayAccount.ShuiE; this.spe_ZheRang.EditValue = this.shouldPayAccount.ZheRang == null ? 0 : this.shouldPayAccount.ZheRang; this.spe_FKZheRang.EditValue = this.shouldPayAccount.PayZheRang == null ? 0 : this.shouldPayAccount.PayZheRang; this.spe_Total.EditValue = this.shouldPayAccount.Total == null ? 0 : this.shouldPayAccount.Total; this.nccEmployee.EditValue = this.shouldPayAccount.Employee; this.bindingSourceDetail.DataSource = this.shouldPayAccount.Detail; base.Refresh(); switch (this.action) { case "view": this.gridView1.OptionsBehavior.Editable = false; this.gridView2.OptionsBehavior.Editable = false; this.gridView3.OptionsBehavior.Editable = false; break; default: this.gridView1.OptionsBehavior.Editable = true; this.gridView2.OptionsBehavior.Editable = true; this.gridView3.OptionsBehavior.Editable = true; break; } this.txt_PayMethod.Enabled = false; this.nccSupplier.Enabled = false; }
public void Update(Model.ShouldPayAccount e) { this.Update <Model.ShouldPayAccount>(e); }
public Model.ShouldPayAccount GetPrev(Model.ShouldPayAccount e) { return(accessor.GetPrev(e)); }
public bool HasRowsBefore(Model.ShouldPayAccount e) { return(accessor.HasRowsBefore(e)); }
public bool HasRowsAfter(Model.ShouldPayAccount e) { return(sqlmapper.QueryForObject <bool>("ShouldPayAccount.has_rows_after", e)); }
public Model.ShouldPayAccount GetPrev(Model.ShouldPayAccount e) { return(sqlmapper.QueryForObject <Model.ShouldPayAccount>("ShouldPayAccount.get_prev", e)); }
public Model.ShouldPayAccount GetNext(Model.ShouldPayAccount e) { return(sqlmapper.QueryForObject <Model.ShouldPayAccount>("ShouldPayAccount.get_next", e)); }
public bool HasRowsAfter(Model.ShouldPayAccount e) { return(accessor.HasRowsAfter(e)); }
protected override void MoveFirst() { this.shouldPayAccount = this.manager.GetFirst(); }
public Model.ShouldPayAccount GetNext(Model.ShouldPayAccount e) { return(accessor.GetNext(e)); }
public void Insert(Model.ShouldPayAccount e) { this.Insert <Model.ShouldPayAccount>(e); }