public Ro(Model.AcbeginbillReceivable reable) { InitializeComponent(); this.ReportName.Text = BL.Settings.CompanyChineseName; this.xrLabelTitle.Text = Properties.Resources.AcbeginbillReceivable; this.xrLabelPrint.Text += System.DateTime.Now.ToString("yyyy-MM-dd"); #region header this.AcbeginbillReceivableId.Text = reable.AcbeginbillReceivableId; this.AcbeginbillReceivableDate.Text = reable.AcbeginbillReceivableDate.Value.ToString("yyyy-MM-dd"); this.Employee1Id.Text = reable.Employee1 == null ? "" : reable.Employee1.EmployeeName; this.EmployeeId.Text = reable.Employee == null ? "" : reable.Employee.EmployeeName; this.AcbeginbillReceivableDesc.Text = reable.AcbeginbillReceivableDesc; // this.AtCurrencyCategoryId.Text = reable.AtCurrencyCategory == null ? "" : reable.AtCurrencyCategory.ToString(); #endregion #region Details this.DataSource = reable.Details; this.xrTableCell1CustomerId.DataBindings.Add("Text", this.DataSource, "Customer." + Model.Customer.PRO_CustomerShortName); // this.xrTableCell1AdvanceCollection.DataBindings.Add("Text", this.DataSource, Model.AcbeginbillReceivableDetail.PRO_AdvanceCollection, "{0:0.####}"); // this.xrTableCell1ShouldCollection.DataBindings.Add("Text", this.DataSource, Model.AcbeginbillReceivableDetail.PRO_ShouldCollection, "{0:0.####}"); this.xrTableCell1DomesticAdvanceCollection.DataBindings.Add("Text", this.DataSource, Model.AcbeginbillReceivableDetail.PRO_DomesticAdvanceCollection, "{0:0.####}"); // this.xrTableCell1ShouldCollection.DataBindings.Add("Text", this.DataSource, Model.AcbeginbillReceivableDetail.PRO_ShouldCollection, "{0:0.####}"); // this.xrTableCellDomesticAlreadyCollection.DataBindings.Add("Text", this.DataSource, Model.AcbeginbillReceivableDetail.PRO_DomesticAlreadyCollection, "{0:0.####}"); // this.xrTableCellDomesticShouldCollection.DataBindings.Add("Text", this.DataSource, Model.AcbeginbillReceivableDetail.PRO_DomesticShouldCollection, "{0:0.####}"); // this.xrTableCellAlreadyCollection.DataBindings.Add("Text", this.DataSource, Model.AcbeginbillReceivableDetail.PRO_AlreadyCollection, "{0:0.####}"); // this.xrTableCellBeginningBalance.DataBindings.Add("Text", this.DataSource, Model.AcbeginbillReceivableDetail.PRO_BeginningBalance, "{0:0.####}"); this.xrTableCellDomesticBeginningBalance.DataBindings.Add("Text", this.DataSource, Model.AcbeginbillReceivableDetail.PRO_DomesticBeginningBalance, "{0:0.####}"); #endregion }
/// <summary> /// 尾笔 /// </summary> protected override void MoveLast() { //if (mpsheader == null) { this._bill = this.billManager.Get(this.billManager.GetLast() == null ? "" : this.billManager.GetLast().AcbeginbillReceivableId); } }
/// <summary> /// Insert a AcbeginbillReceivable. /// </summary> public void Insert(Model.AcbeginbillReceivable acbeginbillReceivable) { try { BL.V.BeginTransaction(); acbeginbillReceivable.InsertTime = DateTime.Now; acbeginbillReceivable.UpdateTime = DateTime.Now; string invoiceKind = this.GetInvoiceKind().ToLower(); string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, acbeginbillReceivable.InsertTime.Value.Year); string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, acbeginbillReceivable.InsertTime.Value.Year, acbeginbillReceivable.InsertTime.Value.Month); string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, acbeginbillReceivable.InsertTime.Value.ToString("yyyy-MM-dd")); string sequencekey = string.Format(invoiceKind); SequenceManager.Increment(sequencekey_y); SequenceManager.Increment(sequencekey_m); SequenceManager.Increment(sequencekey_d); SequenceManager.Increment(sequencekey); accessor.Insert(acbeginbillReceivable); foreach (Model.AcbeginbillReceivableDetail detail in acbeginbillReceivable.Details) { detail.AcbeginbillReceivableDetailId = Guid.NewGuid().ToString(); detail.AcbeginbillReceivableId = acbeginbillReceivable.AcbeginbillReceivableId; detailsaccessor.Insert(detail); } BL.V.CommitTransaction(); } catch { BL.V.RollbackTransaction(); throw; } }
protected override void AddNew() { this._bill = new Model.AcbeginbillReceivable(); this._bill.AcbeginbillReceivableId = this.billManager.GetId(); this._bill.AcbeginbillReceivableDate = DateTime.Now; this._bill.Employee = BL.V.ActiveOperator.Employee; this._bill.Details = this.billDetailManager.SelectDefaultDetails(); }
public Model.AcbeginbillReceivable GetDetail(Model.AcbeginbillReceivable acbeginbillReceivable) { Model.AcbeginbillReceivable temp = accessor.Get(acbeginbillReceivable.AcbeginbillReceivableId); if (temp != null) { temp.Details = detailsaccessor.Select(temp); } return(temp); }
protected override void MoveNext() { Model.AcbeginbillReceivable temp = this.billManager.GetNext(this._bill); if (temp == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this._bill = this.billManager.Get(temp.AcbeginbillReceivableId); }
public void Delete(Model.AcbeginbillReceivable abr) { try { BL.V.BeginTransaction(); detailsaccessor.DeleteByParentId(abr.AcbeginbillReceivableId); this.Delete(abr.AcbeginbillReceivableId); BL.V.CommitTransaction(); } catch { BL.V.RollbackTransaction(); } }
protected override void Delete() { if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK) { return; } try { this.billManager.Delete(this._bill); this._bill = this.billManager.GetNext(this._bill); if (this._bill == null) { this._bill = this.billManager.GetLast(); } } catch { throw; } }
public override void Refresh() { if (this._bill == null) { this.AddNew(); this.action = "insert"; } else { if (this.action == "view") { this._bill = this.billManager.GetDetail(this._bill); if (this._bill == null) { this._bill = new Book.Model.AcbeginbillReceivable(); } } } this.textEditAcbeginbillReceivableId.Text = this._bill.AcbeginbillReceivableId; if (this._bill.AcbeginbillReceivableDate != null) { this.dateEditAcbeginbillReceivableDate.DateTime = this._bill.AcbeginbillReceivableDate.Value; } else { this.dateEditAcbeginbillReceivableDate.Text = ""; } this.memoEditAcbeginbillReceivableDesc.Text = this._bill.AcbeginbillReceivableDesc; this.newChooseContorlEmployee1Id.EditValue = this._bill.AuditEmp; this.newChooseContorlEmployeeId.EditValue = this._bill.Employee; // this.newChooseContorlAtCurrencyCategoryId.EditValue = this._bill.AtCurrencyCategory; //this.textEditAuditingState.Text = this._bill.AuditingState; this.textEditAuditingState.EditValue = this.GetAuditName(this._bill.AuditState); this.bindingSourceAcbeginbillReceivable.DataSource = this._bill.Details; //this.gridView1.GroupPanelText = "共: " + this.acbeginAccountPayble.Details.Count + " 項"; base.Refresh(); }
/// <summary> /// Update a AcbeginbillReceivable. /// </summary> public void Update(Model.AcbeginbillReceivable acbeginbillReceivable) { if (acbeginbillReceivable != null) { try { BL.V.BeginTransaction(); //更新详细 detailsaccessor.DeleteByParentId(acbeginbillReceivable.AcbeginbillReceivableId); foreach (Model.AcbeginbillReceivableDetail detial in acbeginbillReceivable.Details) { detailsaccessor.Insert(detial); } acbeginbillReceivable.UpdateTime = DateTime.Now; accessor.Update(acbeginbillReceivable); BL.V.CommitTransaction(); } catch { BL.V.RollbackTransaction(); } } }
public bool HasRowsAfter(Model.AcbeginbillReceivable e) { return(sqlmapper.QueryForObject <bool>("AcbeginbillReceivable.has_rows_after", e)); }
public bool HasRowsBefore(Model.AcbeginbillReceivable e) { return(sqlmapper.QueryForObject <bool>("AcbeginbillReceivable.has_rows_before", e)); }
public void Update(Model.AcbeginbillReceivable e) { this.Update <Model.AcbeginbillReceivable>(e); }
public void Insert(Model.AcbeginbillReceivable e) { this.Insert <Model.AcbeginbillReceivable>(e); }
public bool HasRowsAfter(Model.AcbeginbillReceivable e) { return(accessor.HasRowsAfter(e)); }
public Model.AcbeginbillReceivable GetNext(Model.AcbeginbillReceivable e) { return(accessor.GetNext(e)); }
/// <summary> /// 首笔 /// </summary> protected override void MoveFirst() { this._bill = this.billManager.Get(this.billManager.GetFirst() == null ? "" : this.billManager.GetFirst().AcbeginbillReceivableId); }
public EditForm(Model.AcbeginbillReceivable receivable, string action) : this() { this._bill = receivable; this.action = action; }
public EditForm(Model.AcbeginbillReceivable receivable) : this() { this._bill = receivable; this.action = "update"; }
public bool HasRowsBefore(Model.AcbeginbillReceivable e) { return(accessor.HasRowsBefore(e)); }
public Model.AcbeginbillReceivable GetNext(Model.AcbeginbillReceivable e) { return(sqlmapper.QueryForObject <Model.AcbeginbillReceivable>("AcbeginbillReceivable.get_next", e)); }
public IList <Model.AcbeginbillReceivableDetail> Select(Model.AcbeginbillReceivable acbeginbillReceivable) { return(accessor.Select(acbeginbillReceivable)); }
public Model.AcbeginbillReceivable GetPrev(Model.AcbeginbillReceivable e) { return(sqlmapper.QueryForObject <Model.AcbeginbillReceivable>("AcbeginbillReceivable.get_prev", e)); }
public IList <Model.AcbeginbillReceivableDetail> Select(Model.AcbeginbillReceivable acbeginbillReceivable) { return(sqlmapper.QueryForList <Model.AcbeginbillReceivableDetail>("AcbeginbillReceivableDetail.selectBybillId", acbeginbillReceivable.AcbeginbillReceivableId)); }