Beispiel #1
0
        private void JournalForm_Load(object sender, EventArgs e)
        {
            string userName = (Form1)base.MdiParent.UserName;

            this.resetUI(userName);
            DailyJournalDataTable journal = this._journal.getJournal();

            journal.AccountColumn.ColumnName       = "رقم الحساب";
            journal.codeColumn.ColumnName          = "رقم القيد";
            journal.CreditColumn.ColumnName        = "دائن";
            journal.DebitColumn.ColumnName         = "مدين";
            journal.Descrip_VCColumn.ColumnName    = "الشرح";
            journal.Date_DTColumn.ColumnName       = "التاريخ";
            this.dgvJournal.DataSource             = journal;
            this.dgvJournal.AutoSizeColumnsMode    = DataGridViewAutoSizeColumnsMode.Fill;
            this.dgvJournal.Columns["الشرح"].Width = 200;
            JournalForm._savedIndex = journal.Rows.Count - 1;
            base.WindowState        = FormWindowState.Maximized;
            this.pnlMain.Enabled    = false;
            AccountsBLL    accountsBLL = new AccountsBLL();
            COA_TDataTable allAccounts = accountsBLL.GetAllAccounts();

            int[] array = allAccounts.Select <COA_TRow, int>(new Func <COA_TRow, int>((a) => a.GL_ID)).ToArray <int>();
            AutoCompleteStringCollection autoCompleteStringCollections = new AutoCompleteStringCollection();

            for (int i = 0; i < array.Count <int>(); i++)
            {
                autoCompleteStringCollections.Add(array[i].ToString());
            }
            this.tbCode.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            this.tbCode.AutoCompleteMode         = AutoCompleteMode.Suggest;
            this.tbCode.AutoCompleteCustomSource = autoCompleteStringCollections;
        }
Beispiel #2
0
        public virtual COA_TDataTable GetMainAccounts()
        {
            this.Adapter.SelectCommand = this.CommandCollection[7];
            COA_TDataTable cOATDataTable = new COA_TDataTable();

            this.Adapter.Fill(cOATDataTable);
            return(cOATDataTable);
        }
Beispiel #3
0
        public virtual COA_TDataTable GetDataByID(int id)
        {
            this.Adapter.SelectCommand = this.CommandCollection[6];
            this.Adapter.SelectCommand.Parameters[0].Value = id;
            COA_TDataTable cOATDataTable = new COA_TDataTable();

            this.Adapter.Fill(cOATDataTable);
            return(cOATDataTable);
        }
Beispiel #4
0
        public virtual int Fill(COA_TDataTable dataTable)
        {
            this.Adapter.SelectCommand = this.CommandCollection[0];
            if (this.ClearBeforeFill)
            {
                dataTable.Clear();
            }
            int num = this.Adapter.Fill(dataTable);

            return(num);
        }
Beispiel #5
0
        public virtual COA_TDataTable getSubAccounts(int?parent)
        {
            this.Adapter.SelectCommand = this.CommandCollection[9];
            if (&parent.HasValue)
            {
                this.Adapter.SelectCommand.Parameters[0].Value = &parent.Value;
            }
            else
            {
                this.Adapter.SelectCommand.Parameters[0].Value = DBNull.Value;
            }
            COA_TDataTable cOATDataTable = new COA_TDataTable();

            this.Adapter.Fill(cOATDataTable);
            return(cOATDataTable);
        }
Beispiel #6
0
 private void tbCode_Leave(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(this.tbCode.Text))
     {
         int            num         = Convert.ToInt32(this.tbCode.Text);
         COA_TDataTable accountByID = this._accounts.GetAccountByID(num);
         this.tbName.Text = accountByID.Select <COA_TRow, string>(new Func <COA_TRow, string>((a) => a.GL_Name_VC)).Max <string>();
         MessageBox.Show("خطأ في رقم الحساب");
     }
     try
     {
     }
     catch
     {
     }
 }
Beispiel #7
0
        public popupAddForm()
        {
            this.components = null;
            base();
            this.InitializeComponent();
            this.accounts = new AccountsBLL();
            CategoryDataTable categories = this.accounts.getCategories();

            this.ddlCategory.DataSource    = categories;
            this.ddlCategory.DisplayMember = "Category_Name";
            this.ddlCategory.ValueMember   = "Category_ID";
            COA_TDataTable mainAccounts = this.accounts.GetMainAccounts();

            this.ddlSub.DataSource    = mainAccounts;
            this.ddlSub.DisplayMember = "GL_Name_VC";
            this.ddlSub.ValueMember   = "GL_ID";
            int num = Convert.ToInt32(this.ddlCategory.SelectedValue);
            int nextCategoryCode = this.accounts.getNextCategoryCode(num).Text = nextCategoryCode.ToString();
        }
Beispiel #8
0
        private void Deposit_Load(object sender, EventArgs e)
        {
            base.KeyDown += new KeyEventHandler(this.Deposit_KeyDown);
            BankBll bankBll = new BankBll();

            this.ddlBank.DataSource    = bankBll.getBanks();
            this.ddlBank.ValueMember   = "AccCode";
            this.ddlBank.DisplayMember = "Name";
            WithdrawalForm._print      = 0;
            WithdrawalForm._voucherID  = 0;
            COA_TDataTable allAccounts = this._accounts.GetAllAccounts();

            string[] array = allAccounts.Select <COA_TRow, string>(new Func <COA_TRow, string>((a) => a.GL_Name_VC)).ToArray <string>();
            AutoCompleteStringCollection autoCompleteStringCollections1 = new AutoCompleteStringCollection();

            for (int i = 0; i < array.Count <string>(); i++)
            {
                autoCompleteStringCollections1.Add(array[i]);
            }
            this.tbName.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            this.tbName.AutoCompleteMode         = AutoCompleteMode.Suggest;
            this.tbName.AutoCompleteCustomSource = autoCompleteStringCollections1;
            int[] numArray = allAccounts.Select <COA_TRow, int>(new Func <COA_TRow, int>((a) => a.GL_ID)).ToArray <int>();
            AutoCompleteStringCollection autoCompleteStringCollections2 = new AutoCompleteStringCollection();

            for (i = 0; i < numArray.Count <int>(); i++)
            {
                autoCompleteStringCollections2.Add(numArray[i].ToString());
            }
            this.tbCode.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            this.tbCode.AutoCompleteMode         = AutoCompleteMode.Suggest;
            this.tbCode.AutoCompleteCustomSource = autoCompleteStringCollections2;
            base.WindowState = FormWindowState.Maximized;
            this.canPrint(false);
            this.tsCreat.Select();
            if (this._directed != 0)
            {
                this.tsEdit_Click(sender, e);
                this.tbVNumber.Text = &this._vNum.ToString();
                this.tbVNumber_Leave(sender, e);
            }
        }
Beispiel #9
0
 public virtual int Update(COA_TDataTable dataTable)
 {
     return(this.Adapter.Update(dataTable));
 }