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();
        }
Beispiel #2
0
 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;
        }
Beispiel #5
0
        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;
        }
Beispiel #6
0
        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));
        }
Beispiel #7
0
 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 = "物料類型錯誤";
     }
 }
Beispiel #12
0
 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);
     }
 }
Beispiel #14
0
 public Model.AtBankAccount GetPrev(Model.AtBankAccount e)
 {
     return(sqlmapper.QueryForObject <Model.AtBankAccount>("AtBankAccount.get_prev", e));
 }
Beispiel #15
0
 public Model.AtBankAccount GetNext(Model.AtBankAccount e)
 {
     return(sqlmapper.QueryForObject <Model.AtBankAccount>("AtBankAccount.get_next", e));
 }
Beispiel #16
0
 public bool HasRowsAfter(Model.AtBankAccount e)
 {
     return(sqlmapper.QueryForObject <bool>("AtBankAccount.has_rows_after", e));
 }
Beispiel #17
0
 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));
 }
Beispiel #21
0
 public EditForm(Model.AtBankAccount AtBankAccount, string action)
     : this()
 {
     this.AtBankAccount = AtBankAccount;
     this.action        = action;
 }
Beispiel #22
0
        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));
 }
Beispiel #24
0
 protected override void MoveFirst()
 {
     this.AtBankAccount = this.AtBankAccountManager.GetFirst();
 }
Beispiel #25
0
 public void Insert(Model.AtBankAccount e)
 {
     this.Insert <Model.AtBankAccount>(e);
 }
 public bool HasRowsBefore(Model.AtBankAccount e)
 {
     return(accessor.HasRowsBefore(e));
 }
Beispiel #27
0
 public void Update(Model.AtBankAccount e)
 {
     this.Update <Model.AtBankAccount>(e);
 }
Beispiel #28
0
 public EditForm(Model.AtBankAccount AtBankAccount)
     : this()
 {
     this.AtBankAccount = AtBankAccount;
     this.action        = "update";
 }
Beispiel #29
0
 protected override void AddNew()
 {
     this.AtBankAccount    = new Model.AtBankAccount();
     this.AtBankAccount.Id = this.AtBankAccountManager.GetId();
 }