Exemple #1
0
        private void LoadSettings()
        {
            try
            {
                //txtCashAccTitle.Text = objDAL.GetSettingValue(DAL.Settings.ProSettings.CashAccTitle);
                //txtOpDebit.Text  = objDAL.GetSettingValue(DAL.Settings.ProSettings.OpCashDebit);
                //txtOpCredit.Text = objDAL.GetSettingValue(DAL.Settings.ProSettings.OpCashCredit);
                //chkAutoPost.Checked = Convert.ToBoolean(objDAL.GetSettingValue(DAL.Settings.ProSettings.IsAutoPost));
                //chkVoiceMsg.Checked = Convert.ToBoolean(objDAL.GetSettingValue(DAL.Settings.ProSettings.MsgSounds));
                //chkMinToSysTry.Checked = Convert.ToBoolean(objDAL.GetSettingValue(DAL.Settings.ProSettings.MinToTry));
                txtAccountNo.Text = objDAL.GetSettingValue(DAL.Settings.ProSettings.SalaryExpAcc);
                txtAccIssue.Text  = objDAL.GetSettingValue(DAL.Settings.ProSettings.SampleIssuance);
                txtAccWaste.Text  = objDAL.GetSettingValue(DAL.Settings.ProSettings.ProductWastage);

                if (!string.IsNullOrEmpty(txtAccountNo.Text))
                {
                    DAL.AccountChart obj = new DAL.AccountChart();
                    obj.connectionstring = objDAL.connectionstring;
                    DataTable dt = obj.getRecord(" AND ACCOUNTNO='" + txtAccountNo.Text + "'");
                    txtAccountName.Text = dt.Rows[0]["AccountTitle"].ToString();

                    DataTable dt1 = obj.getRecord(" AND ACCOUNTNO='" + txtAccIssue.Text + "'");
                    if (dt1.Rows.Count > 0)
                    {
                        txtAccNameIssue.Text = dt1.Rows[0]["AccountTitle"].ToString();
                    }
                    DataTable dt2 = obj.getRecord(" AND ACCOUNTNO='" + txtAccWaste.Text + "'");
                    if (dt2.Rows.Count > 0)
                    {
                        txtAccNameWaste.Text = dt2.Rows[0]["AccountTitle"].ToString();
                    }
                    dt.Dispose();
                }
                else
                {
                    txtAccountName.Text = string.Empty;
                }


                //cboUsers.SelectedIndex = -1;
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message.ToString(), "Error");
            }
        }
        private void LoadGrid()
        {
            try
            {
                string vWhere = string.Empty;
                if (!string.IsNullOrEmpty(txtFilter.Text))
                {
                    vWhere = " AND (accountchart.AccountTitle Like '%" + txtFilter.Text + "%' or accountchart.AccountNo Like '%" + txtFilter.Text + "%')";
                }

                vWhere += " AND isnull(accountchart.AccountSubType,'')<>'Employee'  AND isnull(accountchart.IsBank,0)=0 AND Isnull(accountchart.IsParty,0)=0  AND accountchart.accounttype='" + cboAccountType.Text + "'";

                DataTable dt = objDAL.getRecord(vWhere);
                Grid.AutoGenerateColumns = false;
                Grid.DataSource          = dt;
            }
            catch (Exception exc)
            {
                Message.ShowMessage(MyMessages.MessageType.Error, exc.Message);
            }
        }
Exemple #3
0
        private void DisplayData()
        {
            string vWhere = string.Empty;

            if (!string.IsNullOrEmpty(txtFilter.Text))
            {
                vWhere = " AND AccountTitle Like '%" + txtFilter.Text + "%'";
            }



            if (vIsBank)
            {
                vWhere += " AND Isnull(IsBank,0)=1";
            }
            //else { vWhere += " AND Isnull(IsBank,0)=0"; }

            if (vIsParty)
            {
                vWhere += " AND Isnull(IsParty,0)=1";
            }
            //else { vWhere += " AND Isnull(IsDonor,0)=0"; }

            if (vIsGeneral)
            {
                vWhere += "  AND Isnull(IsBank,0)=0 AND Isnull(IsParty,0)=0";
            }

            try
            {
                DAL.AccountChart objDAL = new DAL.AccountChart();
                objDAL.connectionstring = connectionString;
                dt = objDAL.getRecord(vWhere);
                Grid.AutoGenerateColumns = false;
                Grid.DataSource          = dt;
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message.ToString());
            }
        }
Exemple #4
0
        private void txtAccountNo_TextChanged(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtAccountNo.Text))
            {
                ClearBodyControls();
            }
            else
            {
                string vWhere = string.Empty;
                vWhere = " AND AccountChart.AccountNo = " + txtAccountNo.Text;
                DAL.AccountChart obj = new DAL.AccountChart();

                obj.connectionstring = System.Configuration.ConfigurationManager.ConnectionStrings["MyString"].ConnectionString;
                //DataTable dt = obj.getParties(vWhere);
                DataTable dt = obj.getRecord(vWhere);

                if (dt.Rows.Count > 0)
                {
                    txtAccountNo.Text   = dt.Rows[0]["AccountNo"].ToString();    // vForm.MyID;
                    txtAccountName.Text = dt.Rows[0]["AccountTitle"].ToString(); // vForm.MyName;
                }
            }
        }