コード例 #1
0
        private void lblAddWithdrawal_Click(object sender, EventArgs e)
        {
            if (clsAccess.checkForInsertRestriction("Withdrawal Data Entry", Classes.clsUser.Username) != true)
            {
                return;
            }

            SavingsDataEntry savingsdataentry = new SavingsDataEntry();

            //controls
            foreach (Form form in Application.OpenForms)
            {
                if (form.GetType() == typeof(SavingsDataEntry))
                {
                    form.Activate();
                    savingsdataentry.btnSave.Text      = "SAVE";
                    savingsdataentry.btnSearch.Enabled = true;
                    savingsdataentry.txtNote.ReadOnly  = true;
                    return;
                }
            }
            savingsdataentry.btnSave.Text      = "SAVE";
            savingsdataentry.btnSearch.Enabled = true;
            savingsdataentry.txtNote.ReadOnly  = true;
            savingsdataentry.Show();
        }
コード例 #2
0
        private void lblAddWithdrawal_Click(object sender, EventArgs e)
        {
            SavingsDataEntry savingsdataentry = new SavingsDataEntry();

            //controls
            foreach (Form form in Application.OpenForms)
            {
                if (form.GetType() == typeof(SavingsDataEntry))
                {
                    form.Activate();
                    savingsdataentry.btnSave.Text      = "SAVE";
                    savingsdataentry.btnSearch.Enabled = true;
                    savingsdataentry.txtNote.ReadOnly  = true;
                    return;
                }
            }
            savingsdataentry.btnSave.Text      = "SAVE";
            savingsdataentry.btnSearch.Enabled = true;
            savingsdataentry.txtNote.ReadOnly  = true;
            savingsdataentry.Show();
        }
コード例 #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count == 0)
            {
                //No Data to be edit
                Alert.show("Please select savings you want to edit!", Alert.AlertType.warning);
                return;
            }
            //===================================================================================
            //                      CHECK FIRST IF THIS IS OPEN TO OTHERS
            //===================================================================================

            //this is for Status : FOR RELEASE ONLY
            if (dataGridView1.SelectedRows[0].Cells["Posted"].Value.ToString() == "False" && dataGridView1.SelectedRows[0].Cells["Cancelled"].Value.ToString() == "False" && dataGridView1.SelectedRows[0].Cells["ReleaseDate"].Value.ToString() == string.Empty)
            {
                //if method of withdrawal is ATM this regard
                if (dataGridView1.SelectedRows[0].Cells["Withdrawal_Mode"].Value.ToString() != "AT")
                {
                    //Check if open
                    if (clsOpen.checkOpenFormsAndTransaction("Savings", dataGridView1.SelectedRows[0].Cells["Withdrawal_Slip_No"].Value.ToString()) == true)
                    {
                        //Messagebox here for open form with user whos using the form and reference
                        Alert.show(clsOpen.returnUserOnlineAndReference("Savings", dataGridView1.SelectedRows[0].Cells["Withdrawal_Slip_No"].Value.ToString(), "Withdrawal"), Alert.AlertType.error);
                        return;
                    }
                    else
                    {
                        //Insert here for register the open form and reference
                        clsOpen.insertTransaction("Savings", dataGridView1.SelectedRows[0].Cells["Withdrawal_Slip_No"].Value.ToString());
                    }
                }
            }


            //show form
            foreach (Form form in Application.OpenForms)
            {
                if (form.GetType() == typeof(SavingsDataEntry))
                {
                    form.Activate();
                    x = true;
                }
                else
                {
                    x = false;
                }
            }

            SavingsDataEntry savingsEntry = new SavingsDataEntry();

            if (x != true)
            {
                savingsEntry.Show();
            }



            savingsEntry = (SavingsDataEntry)Application.OpenForms["SavingsDataEntry"];
            savingsEntry.btnSave.Text             = "UPDATE";
            savingsEntry.btnSearch.Enabled        = false;
            Classes.clsSavingsDataEntry.userID    = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString());
            savingsEntry.txtWithdrawalSlipNo.Text = dataGridView1.SelectedRows[0].Cells["Withdrawal_Slip_No"].Value.ToString();
            savingsEntry.txtEmployeeID.Text       = dataGridView1.SelectedRows[0].Cells["EmployeeID"].Value.ToString();
            savingsEntry.txtName.Text             = dataGridView1.SelectedRows[0].Cells["Name"].Value.ToString();
            savingsEntry.txtCurrentBalanceBeforeWithdrawal.Text = clsSavingsDataEntry.returnMembersSaving(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString());
            savingsEntry.txtCompany.Text = clsSavings.returnCompanyDescription(Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString()));

            //Put Members Bank and Account No Using ID
            clsSavings.returnBankAtm(savingsEntry.txtBankCode, savingsEntry.txtAccntNo, Classes.clsSavingsDataEntry.userID);


            //Disable Withdrawal From and Method
            savingsEntry.FieldControls(false, savingsEntry.radioPerea, savingsEntry.radioDansalan, savingsEntry.radioCash, savingsEntry.radioATM, savingsEntry.radioCheque, savingsEntry.txtAmountWithdrawn, savingsEntry.cmbBankName, savingsEntry.txtCheque);

            //Amount
            if (dataGridView1.SelectedRows[0].Cells["AmtWithdrawn"].Value.ToString() != "")
            {
                savingsEntry.txtAmountWithdrawn.Text = Convert.ToDecimal(dataGridView1.SelectedRows[0].Cells["AmtWithdrawn"].Value).ToString("#,0.00");
            }
            else
            {
                savingsEntry.txtAmountWithdrawn.Text = dataGridView1.SelectedRows[0].Cells["AmtWithdrawn"].Value.ToString();
            }



            savingsEntry.dtDateWithdrawal.Text = Convert.ToDateTime(dataGridView1.SelectedRows[0].Cells["wdDate"].Value).ToShortDateString();

            //Cancel Note and By
            savingsEntry.txtCancelledBy.Text = dataGridView1.SelectedRows[0].Cells["Cancelled_By"].Value.ToString();
            savingsEntry.txtNote.Text        = dataGridView1.SelectedRows[0].Cells["Cancelled_Note"].Value.ToString();

            //Posted by
            savingsEntry.txtPostedBy.Text = dataGridView1.SelectedRows[0].Cells["Posted_By"].Value.ToString();
            //Prepared
            savingsEntry.txtPreparedBy.Text = dataGridView1.SelectedRows[0].Cells["Prepared_By"].Value.ToString();


            //Select Method

            if (dataGridView1.SelectedRows[0].Cells["Withdrawal_Mode"].Value.ToString() == "CA")
            {
                savingsEntry.radioCash.Checked = true;
            }
            else if (dataGridView1.SelectedRows[0].Cells["Withdrawal_Mode"].Value.ToString() == "CH")
            {
                savingsEntry.radioCheque.Checked = true;
                //For CHEQUE DETAILS
                if (dataGridView1.SelectedRows[0].Cells["Bank_Code"].Value.ToString() != "")
                {
                    savingsEntry.cmbBankName.Text = clsSavings.returnBankDescription(dataGridView1.SelectedRows[0].Cells["Bank_Code"].Value.ToString());
                    savingsEntry.txtCheque.Text   = dataGridView1.SelectedRows[0].Cells["Check_No"].Value.ToString();
                }
            }
            else if (dataGridView1.SelectedRows[0].Cells["Withdrawal_Mode"].Value.ToString() == "AT")
            {
                savingsEntry.radioATM.Checked   = true;
                savingsEntry.btnRelease.Enabled = false;
            }

            //STATUS INFORMATION
            if (dataGridView1.SelectedRows[0].Cells["ReleaseDate"].Value.ToString() != null && dataGridView1.SelectedRows[0].Cells["ReleaseDate"].Value.ToString() != string.Empty && dataGridView1.SelectedRows[0].Cells["Cancelled"].Value.ToString() != "True" && dataGridView1.SelectedRows[0].Cells["Posted"].Value.ToString() != "True")
            {
                savingsEntry.dtReleaseDate.Text = Convert.ToDateTime(dataGridView1.SelectedRows[0].Cells["ReleaseDate"].Value).ToShortDateString();

                savingsEntry.status.Text    = "RELEASED";
                savingsEntry.status.Visible = true;

                //Enable Cancell Note
                savingsEntry.txtNote.ReadOnly = false;

                //Button to NEW
                savingsEntry.btnSave.Text = "NEW";
            }
            else if (dataGridView1.SelectedRows[0].Cells["Cancelled"].Value.ToString() == "True")
            {
                if (dataGridView1.SelectedRows[0].Cells["ReleaseDate"].Value == DBNull.Value)
                {
                    savingsEntry.dtReleaseDate.Text = "";
                }
                savingsEntry.status.Text    = "CANCELLED";
                savingsEntry.status.Visible = true;

                //Enable Cancell Note
                savingsEntry.txtNote.ReadOnly = true;

                //Button to NEW
                savingsEntry.btnSave.Text = "NEW";
            }
            else if (dataGridView1.SelectedRows[0].Cells["Posted"].Value.ToString() == "True")
            {
                if (dataGridView1.SelectedRows[0].Cells["ReleaseDate"].Value == DBNull.Value)
                {
                    savingsEntry.dtReleaseDate.Text = "";
                }
                else
                {
                    savingsEntry.dtReleaseDate.Text = Convert.ToDateTime(dataGridView1.SelectedRows[0].Cells["ReleaseDate"].Value).ToShortDateString();
                }

                //SET THE CV NUMBER IF CHEQUE
                if (savingsEntry.radioCheque.Checked == true)
                {
                    //IF TRUE THEN
                    //CHECK IF THERES ALREADY A VOUCHER
                    using (SqlConnection con = new SqlConnection(global.connectString()))
                    {
                        con.Open();
                        SqlDataAdapter adapterchck = new SqlDataAdapter("SELECT CV_No FROM Withdrawal_Slip WHERE Withdrawal_Slip_No = '" + dataGridView1.SelectedRows[0].Cells["Withdrawal_Slip_No"].Value.ToString() + "'", con);
                        DataTable      dtchck      = new DataTable();
                        adapterchck.Fill(dtchck);

                        savingsEntry.status.Text        = "POSTED - CV#" + dtchck.Rows[0].ItemArray[0].ToString();
                        savingsEntry.btnRelease.Enabled = false;
                    }
                }
                else
                {
                    savingsEntry.status.Text = "POSTED";
                }

                savingsEntry.status.Visible = true;

                //Enable Cancell Note
                savingsEntry.txtNote.ReadOnly = true;

                //Button to NEW
                savingsEntry.btnSave.Text = "NEW";
            }
            else
            {
                savingsEntry.dtReleaseDate.Text = "";
                savingsEntry.status.Visible     = true;

                //CHECK IF CHEQUE WITHDRAWAL MODE
                if (dataGridView1.SelectedRows[0].Cells["Withdrawal_Mode"].Value.ToString() == "CH")
                {
                    //IF TRUE THEN
                    //CHECK IF THERES ALREADY A VOUCHER
                    using (SqlConnection con = new SqlConnection(global.connectString()))
                    {
                        con.Open();

                        SqlDataAdapter adapterchck = new SqlDataAdapter("SELECT CV_No FROM Withdrawal_Slip WHERE Withdrawal_Slip_No = '" + dataGridView1.SelectedRows[0].Cells["Withdrawal_Slip_No"].Value.ToString() + "'", con);
                        DataTable      dtchck      = new DataTable();
                        adapterchck.Fill(dtchck);

                        if (dtchck.Rows[0].ItemArray[0].ToString() == "")
                        {
                            savingsEntry.status.Text        = "FOR CHEQUE PREPARATION";
                            savingsEntry.btnRelease.Enabled = true;
                        }
                        else
                        {
                            savingsEntry.status.Text        = "FOR RELEASE - CV#" + dtchck.Rows[0].ItemArray[0].ToString();
                            savingsEntry.btnSave.Text       = "NEW";
                            savingsEntry.btnRelease.Enabled = false;
                        }
                    }
                }
                else
                {
                    savingsEntry.status.Text = "FOR RELEASE";

                    if (dataGridView1.SelectedRows[0].Cells["Withdrawal_Mode"].Value.ToString() == "AT")
                    {
                        savingsEntry.btnRelease.Enabled = false;
                    }
                    else
                    {
                        savingsEntry.btnRelease.Enabled = true;
                    }
                }

                //Enable Cancell Note
                savingsEntry.txtNote.ReadOnly           = false;
                savingsEntry.txtAmountWithdrawn.Enabled = true;
            }

            savingsEntry.txtSDDeduction.Text = clsSavings.returnSDMonthly(Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString()));

            if (dataGridView1.SelectedRows[0].Cells["WDFrom"].Value.ToString() == "1" || dataGridView1.SelectedRows[0].Cells["WDFrom"].Value.ToString() == "True")
            {
                //PEREA
                savingsEntry.radioPerea.Checked = true;
            }
            else
            {
                savingsEntry.radioDansalan.Checked = true;
            }



            //Check for last withdrawal Date
            savingsEntry.txtLastDateWithdrawal.Text = clsSavings.returnLastWithdrawalDate(Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString()));
            //if theres a deposited check
            savingsEntry.txtdepositedCheque.Text = clsSavings.returnDepositedChequeAmount(Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString()));
            savingsEntry.txtDepositedDate.Text   = clsSavings.returnDepositedChequeDate(Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString()));


            //MINUS THE CHECK AMOUNT
            if (savingsEntry.txtdepositedCheque.Text != "")
            {
                Decimal widAmnt;
                widAmnt = Convert.ToDecimal(savingsEntry.txtCurrentBalanceBeforeWithdrawal.Text) - Convert.ToDecimal(savingsEntry.txtdepositedCheque.Text);
                savingsEntry.txtWithdrawalBalance.Text = widAmnt.ToString("#,0.00");
            }
            else
            {
                savingsEntry.txtWithdrawalBalance.Text = clsSavingsDataEntry.returnMembersSaving(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString());
            }
        }
コード例 #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            switch (Classes.clsLookUp.whosLookUp)
            {
            case "0":     //Savings
                SavingsDataEntry savingsDataentry = new SavingsDataEntry();

                //Check for hold accounts
                if (clsHoldAccount.checkIfHoldAccount(Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString())) == true)
                {
                    Alert.show("Member's account is on hold.", Alert.AlertType.error);
                    return;
                }

                if (clsHoldAccount.checkIfTHeresADependent(dataGridView1.SelectedRows[0].Cells["EmployeeID"].Value.ToString()) == true)
                {
                    Alert.show("Member's account is on hold.", Alert.AlertType.error);
                    return;
                }
                //for dependent purposes


                //For Resigned Member
                if (clsMembership.isResigned(Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString())) == true)
                {
                    //Already Resigned
                    DialogResult result = MessageBox.Show(this, "This member already resigned, are you sure you want to continue?", "PLDT Credit Cooperative", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (result == DialogResult.No)
                    {
                        return;
                    }
                }

                foreach (Form form in Application.OpenForms)
                {
                    //Start Validation first if selected account is hold

                    if (form.GetType() == typeof(SavingsDataEntry))
                    {
                        //===============================================================================
                        //                      If form is already open
                        //===============================================================================
                        form.Activate();
                        savingsDataentry = (SavingsDataEntry)Application.OpenForms["SavingsDataEntry"];
                        savingsDataentry.txtEmployeeID.Text = dataGridView1.SelectedRows[0].Cells["EmployeeID"].Value.ToString();
                        Classes.clsSavingsDataEntry.userID  = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString());
                        savingsDataentry.txtName.Text       = dataGridView1.SelectedRows[0].Cells["LastName"].Value.ToString() + ", " + dataGridView1.SelectedRows[0].Cells["FirstName"].Value.ToString() + " " + dataGridView1.SelectedRows[0].Cells["MiddleName"].Value.ToString() + dataGridView1.SelectedRows[0].Cells["Suffix"].Value.ToString();

                        if (dataGridView1.SelectedRows[0].Cells["Savings_Deposit"].Value == DBNull.Value)
                        {
                            savingsDataentry.txtSDDeduction.Text = "0.00";
                        }
                        else
                        {
                            savingsDataentry.txtSDDeduction.Text = Convert.ToDecimal(dataGridView1.SelectedRows[0].Cells["Savings_Deposit"].Value).ToString("#,##0.00");
                        }

                        savingsDataentry.txtCurrentBalanceBeforeWithdrawal.Text = clsSavingsDataEntry.returnMembersSaving(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString());

                        //If theres a deposited check
                        savingsDataentry.txtdepositedCheque.Text = clsSavings.returnDepositedChequeAmount(Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString()));
                        savingsDataentry.txtDepositedDate.Text   = clsSavings.returnDepositedChequeDate(Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString()));

                        //MINUS THE CHECK AMOUNT
                        if (savingsDataentry.txtdepositedCheque.Text != "")
                        {
                            Decimal widAmnt;
                            widAmnt = Convert.ToDecimal(savingsDataentry.txtCurrentBalanceBeforeWithdrawal.Text) - Convert.ToDecimal(savingsDataentry.txtdepositedCheque.Text);
                            savingsDataentry.txtWithdrawalBalance.Text = widAmnt.ToString("#,0.00");
                        }
                        else
                        {
                            savingsDataentry.txtWithdrawalBalance.Text = clsSavingsDataEntry.returnMembersSaving(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString());
                        }


                        savingsDataentry.txtCompany.Text            = clsSavingsDataEntry.returnCompanyDescription(dataGridView1.SelectedRows[0].Cells["Company_Code"].Value.ToString());
                        savingsDataentry.txtLastDateWithdrawal.Text = clsSavings.returnLastWithdrawalDate(Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString()));

                        //For Account number and Bank Code
                        savingsDataentry.txtAccntNo.Text  = dataGridView1.SelectedRows[0].Cells["ATM_Account_No"].Value.ToString();
                        savingsDataentry.txtBankCode.Text = dataGridView1.SelectedRows[0].Cells["Bank_Code"].Value.ToString();

                        savingsDataentry.txtAmountWithdrawn.Focus();
                        this.Close();
                        return;
                    }
                }

                savingsDataentry.txtEmployeeID.Text         = dataGridView1.SelectedRows[0].Cells["EmployeeID"].Value.ToString();
                savingsDataentry.txtLastDateWithdrawal.Text = clsSavings.returnLastWithdrawalDate(Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString()));
                Classes.clsSavingsDataEntry.userID          = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString());

                savingsDataentry.txtName.Text = dataGridView1.SelectedRows[0].Cells["LastName"].Value.ToString() + ", " + dataGridView1.SelectedRows[0].Cells["FirstName"].Value.ToString() + " " + dataGridView1.SelectedRows[0].Cells["MiddleName"].Value.ToString() + dataGridView1.SelectedRows[0].Cells["Suffix"].Value.ToString();

                if (dataGridView1.SelectedRows[0].Cells["Savings_Deposit"].Value == DBNull.Value)
                {
                    savingsDataentry.txtSDDeduction.Text = "0.00";
                }
                else
                {
                    savingsDataentry.txtSDDeduction.Text = Convert.ToDecimal(dataGridView1.SelectedRows[0].Cells["Savings_Deposit"].Value).ToString("#,##0.00");
                }

                savingsDataentry.txtCurrentBalanceBeforeWithdrawal.Text = clsSavingsDataEntry.returnMembersSaving(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString());

                //If theres a deposited check
                savingsDataentry.txtdepositedCheque.Text = clsSavings.returnDepositedChequeAmount(Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString()));
                savingsDataentry.txtDepositedDate.Text   = clsSavings.returnDepositedChequeDate(Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString()));

                //MINUS THE CHECK AMOUNT
                if (savingsDataentry.txtdepositedCheque.Text != "")
                {
                    Decimal widAmnt;
                    widAmnt = Convert.ToDecimal(savingsDataentry.txtCurrentBalanceBeforeWithdrawal.Text) - Convert.ToDecimal(savingsDataentry.txtdepositedCheque.Text);
                    savingsDataentry.txtWithdrawalBalance.Text = widAmnt.ToString("#,0.00");
                }
                else
                {
                    savingsDataentry.txtWithdrawalBalance.Text = clsSavingsDataEntry.returnMembersSaving(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString());
                }


                savingsDataentry.txtCompany.Text = clsSavingsDataEntry.returnCompanyDescription(dataGridView1.SelectedRows[0].Cells["Company_Code"].Value.ToString());

                //For Account number and Bank Code
                savingsDataentry.txtAccntNo.Text  = dataGridView1.SelectedRows[0].Cells["ATM_Account_No"].Value.ToString();
                savingsDataentry.txtBankCode.Text = dataGridView1.SelectedRows[0].Cells["Bank_Code"].Value.ToString();


                savingsDataentry.Show();

                this.Close();
                savingsDataentry.txtAmountWithdrawn.Focus();
                savingsDataentry.Show();
                break;


            case "1":
                //==========================================================================================
                //                      DISBURSEMENT CODE
                //==========================================================================================
                DisbursementVoucher disbursement = new DisbursementVoucher();

                foreach (Form form in Application.OpenForms)
                {
                    if (form.GetType() == typeof(DisbursementVoucher))
                    {
                        //===============================================================================
                        //                      If form is already open
                        //===============================================================================
                        form.Activate();
                        disbursement = (DisbursementVoucher)Application.OpenForms["DisbursementVoucher"];
                        Classes.clsDisbursement.userID = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString());
                        LoanLookUpProcess.clsLoanLookUpMember.userid = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString());

                        disbursement.txtLoanNo.Text   = "";
                        disbursement.txtLoanType.Text = "";

                        disbursement.txtPayee.Text     = dataGridView1.SelectedRows[0].Cells["EmployeeID"].Value.ToString();
                        disbursement.txtPayeeName.Text = dataGridView1.SelectedRows[0].Cells["LastName"].Value.ToString() + ", " + dataGridView1.SelectedRows[0].Cells["FirstName"].Value.ToString() + " " + dataGridView1.SelectedRows[0].Cells["MiddleName"].Value.ToString() + dataGridView1.SelectedRows[0].Cells["Suffix"].Value.ToString();
                        this.Close();
                        return;
                    }
                }

                Classes.clsDisbursement.userID = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString());
                LoanLookUpProcess.clsLoanLookUpMember.userid = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString());

                disbursement.txtLoanNo.Text   = "";
                disbursement.txtLoanType.Text = "";

                disbursement.txtPayee.Text     = dataGridView1.SelectedRows[0].Cells["EmployeeID"].Value.ToString();
                disbursement.txtPayeeName.Text = dataGridView1.SelectedRows[0].Cells["LastName"].Value.ToString() + ", " + dataGridView1.SelectedRows[0].Cells["FirstName"].Value.ToString() + " " + dataGridView1.SelectedRows[0].Cells["MiddleName"].Value.ToString() + dataGridView1.SelectedRows[0].Cells["Suffix"].Value.ToString();
                disbursement.Show();
                this.Close();
                break;

            case "2":
                //==========================================================================================
                //                      CASH RECEIPT CODE
                //==========================================================================================
                CashReceiptVoucher cashOR = new CashReceiptVoucher();

                foreach (Form form in Application.OpenForms)
                {
                    if (form.GetType() == typeof(CashReceiptVoucher))
                    {
                        //===============================================================================
                        //                      If form is already open
                        //===============================================================================
                        form.Activate();
                        cashOR = (CashReceiptVoucher)Application.OpenForms["CashReceiptVoucher"];
                        Classes.clsCashReceipt.userID = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString());
                        cashOR.txtPayorID.Text        = dataGridView1.SelectedRows[0].Cells["EmployeeID"].Value.ToString();
                        cashOR.txtPayorName.Text      = dataGridView1.SelectedRows[0].Cells["LastName"].Value.ToString() + ", " + dataGridView1.SelectedRows[0].Cells["FirstName"].Value.ToString() + " " + dataGridView1.SelectedRows[0].Cells["MiddleName"].Value.ToString() + dataGridView1.SelectedRows[0].Cells["Suffix"].Value.ToString();
                        cashOR.txtPayorCompany.Text   = clsCash.returnCompanyDescription(dataGridView1.SelectedRows[0].Cells["Company_Code"].Value.ToString());
                        this.Close();
                        return;
                    }
                }

                Classes.clsCashReceipt.userID = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["userID"].Value.ToString());
                cashOR.txtPayorID.Text        = dataGridView1.SelectedRows[0].Cells["EmployeeID"].Value.ToString();
                cashOR.txtPayorName.Text      = dataGridView1.SelectedRows[0].Cells["LastName"].Value.ToString() + ", " + dataGridView1.SelectedRows[0].Cells["FirstName"].Value.ToString() + " " + dataGridView1.SelectedRows[0].Cells["MiddleName"].Value.ToString() + dataGridView1.SelectedRows[0].Cells["Suffix"].Value.ToString();
                cashOR.txtPayorCompany.Text   = clsCash.returnCompanyDescription(dataGridView1.SelectedRows[0].Cells["Company_Code"].Value.ToString());
                cashOR.Show();
                this.Close();
                break;
            }
        }