public BillCollectionForm() { InitializeComponent(); IList <Model.AtBillsIncome> billList = billIncomeManager.SelectAtBillsIncomeByBillsOften("0", null); bList = new List <Model.AtBillsIncome>(); if (billList != null) { foreach (Model.AtBillsIncome i in billList) { Model.AtBankAccount at = bankAccountManager.Get(i.CollectionAccount); Model.Customer cu = new BL.CustomerManager().Get(i.PassingObject); if (at != null) { i.C = at.BankAccountName; } if (cu != null) { i.A = cu.ToString(); } bList.Add(i); } } this.bindingSourcestringbillsOften.DataSource = billList; //this.bindingSourceAtBankAccount.DataSource = bankAccountManager.Select(); }
protected override void MoveLast() { if (this.AtBankAccount == null) { this.AtBankAccount = this.AtBankAccountManager.GetLast(); } }
/// <summary> /// Insert a AtBankAccount. /// </summary> public void Insert(Model.AtBankAccount atBankAccount) { // // todo:add other logic here // Validate(atBankAccount); atBankAccount.BankAccountId = Guid.NewGuid().ToString(); try { atBankAccount.InsertTime = DateTime.Now; BL.V.BeginTransaction(); string invoiceKind = this.GetInvoiceKind().ToLower(); string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, atBankAccount.InsertTime.Value.Year); string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, atBankAccount.InsertTime.Value.Year, atBankAccount.InsertTime.Value.Month); string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, atBankAccount.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(atBankAccount); BL.V.CommitTransaction(); } catch { BL.V.RollbackTransaction(); throw; } }
private void lookUpEditCollectionAccount_EditValueChanged(object sender, EventArgs e) { string collectionAccount = ""; if (this.lookUpEditCollectionAccount.EditValue != null) { collectionAccount = this.lookUpEditCollectionAccount.EditValue.ToString(); } IList <Model.AtBillsIncome> billList = billIncomeManager.SelectAtBillsIncomeByBillsOften("0", collectionAccount); bList = new List <Model.AtBillsIncome>(); if (billList != null) { foreach (Model.AtBillsIncome i in billList) { Model.AtBankAccount at = bankAccountManager.Get(i.CollectionAccount); Model.Customer cu = new BL.CustomerManager().Get(i.PassingObject); if (at != null) { i.C = at.BankAccountName; } if (cu != null) { i.A = cu.ToString(); } bList.Add(i); } } this.bindingSourcestringbillsOften.DataSource = billList; }
private void Binds() { IList <Model.AtBillsIncome> billList = billIncomeManager.Select(); bList = new List <Model.AtBillsIncome>(); if (billList != null) { foreach (Model.AtBillsIncome i in billList) { if (i.BillsOften == "尚未兌現") { Model.AtBankAccount at = bankAccountManager.Get(i.CollectionAccount); Model.Supplier cu = new BL.SupplierManager().Get(i.PassingObject); if (at != null) { i.C = at.BankAccountName; } if (cu != null) { i.A = cu.Id; i.B = cu.SupplierFullName; } bList.Add(i); } } } this.bindingSourcestringbillsOften.DataSource = bList; }
public bool ExistsExcept(Model.AtBankAccount e) { Hashtable paras = new Hashtable(); paras.Add("newId", e.Id); paras.Add("oldId", Get(e.BankAccountId) == null?null:Get(e.BankAccountId).Id); return(sqlmapper.QueryForObject <bool>("AtBankAccount.existsexcept", paras)); }
protected override void MoveNext() { Model.AtBankAccount AtBankAccount = this.AtBankAccountManager.GetNext(this.AtBankAccount); if (AtBankAccount == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this.AtBankAccount = AtBankAccount; }
/// <summary> /// Update a AtBankAccount. /// </summary> public void Update(Model.AtBankAccount atBankAccount) { // // todo: add other logic here. // Validate(atBankAccount); atBankAccount.UpdateTime = DateTime.Now; accessor.Update(atBankAccount); }
/// <summary> /// /// </summary> /// <param name="item"></param> public void MyClick(ref ChooseItem item) { ChooseAtBankAccountForm f = new ChooseAtBankAccountForm(); if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Model.AtBankAccount AtBankAccount = f.SelectedItem as Model.AtBankAccount; item = new ChooseItem(AtBankAccount, AtBankAccount.Id, AtBankAccount.BankAccountName); } }
public void Delete(Model.AtBankAccount atBankAccount) { try { V.BeginTransaction(); this.Delete(atBankAccount.BankAccountId); V.CommitTransaction(); } catch { V.RollbackTransaction(); throw; } }
public void MyLeave(ref ChooseItem item) { BL.AtBankAccountManager manager = new Book.BL.AtBankAccountManager(); Model.AtBankAccount AtBankAccount = manager.GetById(item.ButtonText); if (AtBankAccount != null) { item.EditValue = AtBankAccount; item.LabelText = AtBankAccount.BankAccountName; item.ButtonText = AtBankAccount.Id; } else { item.ErrorMessage = "物料類型錯誤"; } }
protected override void Delete() { if (this.AtBankAccount == null) { return; } if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK) { return; } this.AtBankAccountManager.Delete(this.AtBankAccount.BankAccountId); this.AtBankAccount = this.AtBankAccountManager.GetNext(this.AtBankAccount); if (this.AtBankAccount == null) { this.AtBankAccount = this.AtBankAccountManager.GetLast(); } }
private void Validate(Model.AtBankAccount atBankAccount) { if (string.IsNullOrEmpty(atBankAccount.Id)) { throw new Helper.RequireValueException(Model.AtBankAccount.PRO_Id); } if (string.IsNullOrEmpty(atBankAccount.BankAccountName)) { throw new Helper.RequireValueException(Model.AtBankAccount.PRO_BankAccountName); } if (string.IsNullOrEmpty(atBankAccount.AccountCategory)) { throw new Helper.RequireValueException(Model.AtBankAccount.PRO_AccountCategory); } if (string.IsNullOrEmpty(atBankAccount.BankId)) { throw new Helper.RequireValueException(Model.AtBankAccount.PRO_BankId); } }
public Model.AtBankAccount GetPrev(Model.AtBankAccount e) { return(sqlmapper.QueryForObject <Model.AtBankAccount>("AtBankAccount.get_prev", e)); }
public Model.AtBankAccount GetNext(Model.AtBankAccount e) { return(sqlmapper.QueryForObject <Model.AtBankAccount>("AtBankAccount.get_next", e)); }
public bool HasRowsAfter(Model.AtBankAccount e) { return(sqlmapper.QueryForObject <bool>("AtBankAccount.has_rows_after", e)); }
public bool HasRowsBefore(Model.AtBankAccount e) { return(sqlmapper.QueryForObject <bool>("AtBankAccount.has_rows_before", e)); }
public Model.AtBankAccount GetNext(Model.AtBankAccount e) { return(accessor.GetNext(e)); }
public bool ExistsExcept(Model.AtBankAccount e) { return(accessor.ExistsExcept(e)); }
public bool HasRowsAfter(Model.AtBankAccount e) { return(accessor.HasRowsAfter(e)); }
public EditForm(Model.AtBankAccount AtBankAccount, string action) : this() { this.AtBankAccount = AtBankAccount; this.action = action; }
public override void Refresh() { if (this.AtBankAccount == null) { this.AtBankAccount = new Book.Model.AtBankAccount(); this.action = "insert"; } this.textEditBankAccountId.Text = this.AtBankAccount.Id; this.textEditBankAccountName.Text = this.AtBankAccount.BankAccountName; this.comboBoxEditAccountCategory.EditValue = this.AtBankAccount.AccountCategory; this.newChooseContorlBankId.EditValue = this.AtBankAccount.Bank; this.textEditContact.Text = this.AtBankAccount.Contact; this.textEditContactPhone.Text = this.AtBankAccount.ContactPhone; this.textEditFax.Text = this.AtBankAccount.Fax; this.spinEditVotesAgainst.EditValue = this.AtBankAccount.VotesAgainst; this.spinEditVotesAgainstAfew.EditValue = this.AtBankAccount.VotesAgainstAfew; this.spinEditSecurityBalance.EditValue = this.AtBankAccount.SecurityBalance; this.spinEditTheirBalance.EditValue = this.AtBankAccount.TheirBalance; this.spinEditExistingBalance.EditValue = this.AtBankAccount.ExistingBalance; this.lookUpEditDepositSubject.EditValue = this.AtBankAccount.DepositSubject; this.lookUpEditVoteSubject.EditValue = this.AtBankAccount.VoteSubject; this.lookUpEditBorrowingSubject.EditValue = this.AtBankAccount.BorrowingSubject; this.memoEditMark.Text = this.AtBankAccount.Mark; switch (this.action) { case "insert": this.textEditBankAccountId.Properties.ReadOnly = false; this.textEditBankAccountName.Properties.ReadOnly = false; this.comboBoxEditAccountCategory.Properties.ReadOnly = false; this.newChooseContorlBankId.ShowButton = true; this.newChooseContorlBankId.ButtonReadOnly = false; this.textEditContact.Properties.ReadOnly = false; this.textEditContactPhone.Properties.ReadOnly = false; this.textEditFax.Properties.ReadOnly = false; this.spinEditVotesAgainst.Properties.ReadOnly = false; this.spinEditVotesAgainstAfew.Properties.ReadOnly = false; this.spinEditSecurityBalance.Properties.ReadOnly = false; this.spinEditTheirBalance.Properties.ReadOnly = false; this.spinEditExistingBalance.Properties.ReadOnly = false; this.lookUpEditDepositSubject.Properties.ReadOnly = false; this.lookUpEditVoteSubject.Properties.ReadOnly = false; this.lookUpEditBorrowingSubject.Properties.ReadOnly = false; this.memoEditMark.Properties.ReadOnly = false; break; case "update": this.textEditBankAccountId.Properties.ReadOnly = false; this.textEditBankAccountName.Properties.ReadOnly = false; this.comboBoxEditAccountCategory.Properties.ReadOnly = false; this.newChooseContorlBankId.ShowButton = true; this.newChooseContorlBankId.ButtonReadOnly = false; this.textEditContact.Properties.ReadOnly = false; this.textEditContactPhone.Properties.ReadOnly = false; this.textEditFax.Properties.ReadOnly = false; this.spinEditVotesAgainst.Properties.ReadOnly = false; this.spinEditVotesAgainstAfew.Properties.ReadOnly = false; this.spinEditSecurityBalance.Properties.ReadOnly = false; this.spinEditTheirBalance.Properties.ReadOnly = false; this.spinEditExistingBalance.Properties.ReadOnly = false; this.lookUpEditDepositSubject.Properties.ReadOnly = false; this.lookUpEditVoteSubject.Properties.ReadOnly = false; this.lookUpEditBorrowingSubject.Properties.ReadOnly = false; this.memoEditMark.Properties.ReadOnly = false; break; case "view": this.textEditBankAccountId.Properties.ReadOnly = true; this.textEditBankAccountName.Properties.ReadOnly = true; this.comboBoxEditAccountCategory.Properties.ReadOnly = true; this.newChooseContorlBankId.ShowButton = false; this.newChooseContorlBankId.ButtonReadOnly = true; this.textEditContact.Properties.ReadOnly = true; this.textEditContactPhone.Properties.ReadOnly = true; this.textEditFax.Properties.ReadOnly = true; this.spinEditVotesAgainst.Properties.ReadOnly = true; this.spinEditVotesAgainstAfew.Properties.ReadOnly = true; this.spinEditSecurityBalance.Properties.ReadOnly = true; this.spinEditTheirBalance.Properties.ReadOnly = true; this.spinEditExistingBalance.Properties.ReadOnly = true; this.lookUpEditDepositSubject.Properties.ReadOnly = true; this.lookUpEditVoteSubject.Properties.ReadOnly = true; this.lookUpEditBorrowingSubject.Properties.ReadOnly = true; this.memoEditMark.Properties.ReadOnly = true; break; default: break; } base.Refresh(); }
public Model.AtBankAccount GetPrev(Model.AtBankAccount e) { return(accessor.GetPrev(e)); }
protected override void MoveFirst() { this.AtBankAccount = this.AtBankAccountManager.GetFirst(); }
public void Insert(Model.AtBankAccount e) { this.Insert <Model.AtBankAccount>(e); }
public bool HasRowsBefore(Model.AtBankAccount e) { return(accessor.HasRowsBefore(e)); }
public void Update(Model.AtBankAccount e) { this.Update <Model.AtBankAccount>(e); }
public EditForm(Model.AtBankAccount AtBankAccount) : this() { this.AtBankAccount = AtBankAccount; this.action = "update"; }
protected override void AddNew() { this.AtBankAccount = new Model.AtBankAccount(); this.AtBankAccount.Id = this.AtBankAccountManager.GetId(); }