void BindGrid()
        {
            CashReleaseManager oManager = new CashReleaseManager();

            oManager.ConnectionString = this.ConnectionString;
            oManager.Open();
            gridControl1.DataSource = oManager.GetCashReleased();
            gridControl1.Refresh();
            oManager.Close();
        }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (cboTypeOfPayment.SelectedIndex == -1)
            {
                MessageBox.Show("Please select type of Payment!!!", "Fund", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (cboSourceOfFund.EditValue == null)
            {
                MessageBox.Show("Please select fund!!!", "Fund", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (btnAdd.Text == "Add")
            {
                CashReleaseManager oManager = new CashReleaseManager();
                CashReleaseUnit oUnit = new CashReleaseUnit();

                oManager.ConnectionString = this.ConnectionString;
                oManager.Open();

                oUnit.ReleaseNo = txtReleaseNo.Text;
                oUnit.DocNum = txtLoanNo.Text;
                oUnit.ChequeNo = txtCheckNo.Text;
                oUnit.TypeOfPayment = cboTypeOfPayment.Text;
                oUnit.SourceOfFund = cboSourceOfFund.EditValue == null ? "" : cboSourceOfFund.EditValue.ToString();
                oUnit.Amount = Convert.ToDouble(txtAmount.Text);

                oUnit.CreatedBy = this.ActiveUserID;
                oUnit.DateCreated = (DateTime)dtCreated.EditValue;
                oUnit.ModifiedBy = this.ActiveUserID;
                oUnit.DateModified = (DateTime)dtModified.EditValue;

                oManager.AddCashRelease(oUnit);

                oManager.Close();

                this.Close();
            }
            else if (btnAdd.Text == "Update")
            {
                CashReleaseManager oManager = new CashReleaseManager();
                CashReleaseUnit oUnit = new CashReleaseUnit();

                oManager.ConnectionString = this.ConnectionString;
                oManager.Open();

                oUnit.ReleaseNo = txtReleaseNo.Text;
                oUnit.DocNum = txtLoanNo.Text;
                oUnit.ChequeNo = txtCheckNo.Text;
                oUnit.TypeOfPayment = cboTypeOfPayment.Text;
                oUnit.SourceOfFund = cboSourceOfFund.EditValue.ToString();
                oUnit.Amount = Convert.ToDouble(txtAmount.Text);

                oUnit.CreatedBy = this.ActiveUserID;
                oUnit.DateCreated = (DateTime)dtCreated.EditValue;
                oUnit.ModifiedBy = this.ActiveUserID;
                oUnit.DateModified = (DateTime)dtModified.EditValue;

                oManager.UpdateCashRelease(oUnit);

                oManager.Close();

            }
        }
        void BindCashReleased()
        {
            CashReleaseManager oManager = new CashReleaseManager();

            oManager.ConnectionString = this.ConnectionString;
            oManager.Open();

            DataTable dt = oManager.GetInfo(txtLoanNo.Text);

            gridControl2.DataSource = dt;
            gridControl2.Refresh();

            oManager.Close();
        }
示例#4
0
        void BindCashReleased(DateTime dFrom, DateTime dTo)
        {
            CashReleaseManager oManager = new CashReleaseManager();
            oManager.ConnectionString = this.ConnectionString;
            oManager.Open();

            DataTable dt = oManager.GetCashReleased(dFrom, dTo);

            gridControl4.DataSource = dt;
            gridControl4.Refresh();

            gridView5.ExpandAllGroups();
            oManager.Close();
        }