Beispiel #1
0
        private void LoadTree()
        {
            try
            {
                this.Cursor         = Cursors.WaitCursor;
                tvSubject.ImageList = clsLxms.GetImageList();
                DBGrid.DataSource   = null;
                tvSubject.Nodes.Clear();
                tvSubject.BackColor = frmOptions.BACKCOLOR;
                switch (cboSubjectType.SelectedIndex)
                {
                case 0:
                    dalAccBankAccount dal0 = new dalAccBankAccount();
                    BindingCollection <modAccBankAccount> list0 = dal0.GetIList(out Util.emsg);
                    if (list0 != null && list0.Count > 0)
                    {
                        foreach (modAccBankAccount mod in list0)
                        {
                            tvSubject.Nodes.Add(mod.AccountNo, mod.AccountNo + "(" + mod.BankName + ")", 0, 1);
                        }
                    }
                    break;

                case 1:
                    dalAccSubjectList dal1 = new dalAccSubjectList();
                    BindingCollection <modAccSubjectList> list1 = dal1.GetChildrenList(out Util.emsg);
                    if (list1 != null && list1.Count > 0)
                    {
                        foreach (modAccSubjectList mod in list1)
                        {
                            tvSubject.Nodes.Add(mod.SubjectId, mod.SubjectName, 0, 1);
                        }
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Beispiel #2
0
        public static decimal GetExchangeRate(string accountno)
        {
            dalAccBankAccount dal = new dalAccBankAccount();
            modAccBankAccount mod = dal.GetItem(accountno, out Util.emsg);

            if (mod != null)
            {
                dalAccCurrencyList dal2 = new dalAccCurrencyList();
                modAccCurrencyList mod2 = dal2.GetItem(mod.Currency, out Util.emsg);
                if (mod2 != null)
                {
                    return(mod2.ExchangeRate);
                }
                else
                {
                    return(1);
                }
            }
            else
            {
                return(1);
            }
        }
Beispiel #3
0
        private void cboBookType_SelectedIndexChanged(object sender, EventArgs e)
        {
            prepared          = false;
            DBGrid.DataSource = null;
            switch (cboBookType.SelectedIndex)
            {
            case 0:
                dalCustomerList dalCust = new dalCustomerList();
                BindingCollection <modCustomerSimpleList> listCust = dalCust.GetSimpleList(out Util.emsg);
                DBGrid.DataSource = listCust;
                if (listCust != null)
                {
                    for (int i = 2; i < DBGrid.ColumnCount; i++)
                    {
                        DBGrid.Columns[i].Visible = false;
                    }
                    DBGrid.Columns[0].Width = 90;
                    DBGrid.Columns[1].Width = DBGrid.Width - 140;
                }
                break;

            case 1:
                dalVendorList dalVendor = new dalVendorList();
                BindingCollection <modVendorList> listVendor = dalVendor.GetIList("1", string.Empty, out Util.emsg);
                DBGrid.DataSource = listVendor;
                if (listVendor != null)
                {
                    for (int i = 1; i < DBGrid.ColumnCount; i++)
                    {
                        DBGrid.Columns[i].Visible = false;
                    }
                    DBGrid.Columns[0].Width = DBGrid.Width - 50;
                }
                break;

            case 2:
                dalOtherReceivableObject dalORec = new dalOtherReceivableObject();
                BindingCollection <modOtherReceivableObject> listORec = dalORec.GetIList(true, out Util.emsg);
                DBGrid.DataSource = listORec;
                if (listORec != null)
                {
                    for (int i = 1; i < DBGrid.ColumnCount; i++)
                    {
                        DBGrid.Columns[i].Visible = false;
                    }
                    DBGrid.Columns[0].Width = DBGrid.Width - 50;
                }
                break;

            case 3:
                dalOtherPayableObject dalOPay = new dalOtherPayableObject();
                BindingCollection <modOtherPayableObject> listOPay = dalOPay.GetIList(true, out Util.emsg);
                DBGrid.DataSource = listOPay;
                if (listOPay != null)
                {
                    for (int i = 1; i < DBGrid.ColumnCount; i++)
                    {
                        DBGrid.Columns[i].Visible = false;
                    }
                    DBGrid.Columns[0].Width = DBGrid.Width - 50;
                }
                break;

            case 4:
                dalAccBankAccount dalCash = new dalAccBankAccount();
                BindingCollection <modAccBankAccount> listCash = dalCash.GetIList(out Util.emsg);
                DBGrid.DataSource = listCash;
                if (listCash != null)
                {
                    for (int i = 2; i < DBGrid.ColumnCount; i++)
                    {
                        DBGrid.Columns[i].Visible = false;
                    }
                    DBGrid.Columns[0].Width = 90;
                    DBGrid.Columns[1].Width = DBGrid.Width - 140;
                }
                break;
            }
            prepared = true;
        }