private void btnSearch_Click(object sender, EventArgs e) { if (tabControl1.SelectedTab == tabPage1) { //Client Code Search if (txtClientID.Text != "" || txtName.Text != "") { clsJournalMemberClient.SearchClient(dataGridView1, txtClientID.Text, txtName.Text); } else { Alert.show("Please enter valid Keyword.", Alert.AlertType.warning); return; } } else { //Member Code Search if (txtEmployeeID.Text != "" || txtFirstName.Text != "" || txtLastName.Text != "") { clsJournalMemberClient.SearchMember(txtEmployeeID.Text, txtFirstName.Text, txtLastName.Text, dataGridView1); } else { Alert.show("Please enter valid Keyword.", Alert.AlertType.warning); return; } } }
private void button6_Click(object sender, EventArgs e) { if (clsAccess.checkForViewingRestriction(lblTitle.Text, Classes.clsUser.Username) != true) { return; } if (txtRangingFrom.Text == "" || txtRangingTo.Text == "") { Alert.show("All fields with (*) are required.", Alert.AlertType.warning); return; } if (Convert.ToInt32(txtRangingFrom.Text) > Convert.ToInt32(txtRangingTo.Text)) { Alert.show("Slip No 'From' must not be greater than Slip No 'To'.", Alert.AlertType.warning); return; } if (Convert.ToDateTime(dtFrom.Text) > Convert.ToDateTime(dtTo.Text)) { Alert.show("Date ' From' must not be greater than Date 'To'.", Alert.AlertType.warning); return; } clsCashReplenishment.loadReplenishment(dataGridView1, Convert.ToInt32(txtRangingFrom.Text), Convert.ToInt32(txtRangingTo.Text), dtFrom.Text, dtTo.Text, txtTotalNoSlips, txtAmount); }
private void button1_Click_1(object sender, EventArgs e) { if (cmbLoanType.Text == "") { Alert.show("Please select Loan type.", Alert.AlertType.error); return; } if (txtLoanAmount.Text == "") { Alert.show("Please enter Loan amount.", Alert.AlertType.error); return; } if (interestRate.Text == "") { Alert.show("Please enter interest rate.", Alert.AlertType.error); return; } if (txtTerminMos.Text == "") { Alert.show("Please enter Loan term in months.", Alert.AlertType.error); return; } computeMonthly(); //call the Report then display to the crystal report viewer loadReport(); }
private void btnSearch_Click(object sender, EventArgs e) { //Load According to Whos Form Trigger switch (Classes.clsLookUp.whosLookUp) { case "0": //Savings if (requiredField() == true) { Alert.show("No keywords to be search!", Alert.AlertType.warning); return; } clsLookUp.SearchSavings(txtEmployeeID.Text, txtFirstName.Text, txtLastName.Text, dataGridView1); break; case "1": //Disbursement if (requiredField() == true) { Alert.show("No keywords to be search!", Alert.AlertType.warning); return; } clsLookUp.SearchMemberDisbursement(txtEmployeeID.Text, txtFirstName.Text, txtLastName.Text, dataGridView1); break; case "2": //Cash Receipt if (requiredField() == true) { Alert.show("No keywords to be search!", Alert.AlertType.warning); return; } clsLookUp.SearchMemberCashReceipt(txtEmployeeID.Text, txtFirstName.Text, txtLastName.Text, dataGridView1); break; } }
private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { try { if (dgvDetails.CurrentRow.IsNewRow) { Alert.show("New row cannot be deleted.", Alert.AlertType.error); return; } if (dgvDetails.SelectedCells.Count >= 1) { string msg = Environment.NewLine + "Are you sure you want to delete this entry?"; DialogResult result = MessageBox.Show(this, msg, "PLDT Credit Cooperative", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { foreach (DataGridViewCell cell in dgvDetails.SelectedCells) { int row = dgvDetails.CurrentCell.RowIndex; dgvDetails.Rows.RemoveAt(row); clsPDCManagement.loadTotals(dgvDetails, lblTotalAmount); } } else { return; } } } catch { } }
public void CreateBDO() { //this code segment write data to file. saveFileDialog1.FileName = "BDO.txt"; // set filters - this can be done in properties as well saveFileDialog1.Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*"; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { FileStream fs1 = new FileStream(saveFileDialog1.FileName, FileMode.OpenOrCreate, FileAccess.Write); StreamWriter writer = new StreamWriter(fs1); using (SqlConnection con = new SqlConnection(global.connectString())) { con.Open(); int cnt = 0; int icount = 0; foreach (ListViewItem lItem in listView1.Items) { if (lItem.Checked == true) { icount = icount + 1; } } for (int i = 0; i < listView1.Items.Count; i++) { if (listView1.Items[i].Checked == true) { purpose += "'" + getBetween(listView1.Items[i].Text, "-") + "'"; if (i != icount - 1) { purpose += " , "; } } } string str = "select distinct account_No,sum(Amount) as total,Name FROM ATM where Bank_Code='" + cmbBank.Text + "' and Deposited is null and purpose in (" + purpose + ") GROUP BY Account_No,Name Order by Name ASC"; adapter = new SqlDataAdapter(str, con); dt = new DataTable(); adapter.Fill(dt); while (cnt != dt.Rows.Count) { writer.Write(dt.Rows[cnt].ItemArray[0].ToString()); writer.Write("\t"); writer.Write(dt.Rows[cnt].ItemArray[1].ToString()); cnt = cnt + 1; writer.Write(Environment.NewLine); } writer.Close(); } Alert.show("BDO Disk successfully created.", Alert.AlertType.success); } }
private void button2_Click(object sender, EventArgs e) { if (clsApproval.returnStatusNo(txtLoanNo.Text) == "2") { //APPROVED Alert.show("This Loan is already approved.", Alert.AlertType.error); return; } if (clsApproval.returnStatusNo(txtLoanNo.Text) == "3") { //DISAPPROVED Alert.show("This Loan is already disapproved.", Alert.AlertType.error); return; } if (clsApproval.returnStatusNo(txtLoanNo.Text) == "5") { //DISAPPROVED Alert.show("This Loan is already released.", Alert.AlertType.error); return; } if (clsApproval.returnStatusNo(txtLoanNo.Text) == "7") { //DISAPPROVED Alert.show("Loan already cancelled.", Alert.AlertType.error); return; } string msg = Environment.NewLine + "Are you sure you want to continue?"; DialogResult result = MessageBox.Show(this, msg, "PLDT Credit Cooperative", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { using (SqlConnection con = new SqlConnection(global.connectString())) { con.Open(); cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "UPDATE LOAN Set Status = '6' WHERE Loan_No ='" + txtLoanNo.Text + "'"; cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); Alert.show("Loan " + txtLoanNo.Text + " Successfully tag as FBA!", Alert.AlertType.success); //Refresh Grid try { Loans frm = new Loans(); frm = (Loans)Application.OpenForms["Loans"]; frm.refreshData(); } catch { } } } }
private void button2_Click(object sender, EventArgs e) { if (clsAccess.checkForEditRestriction("Loan ATM Preparation", Classes.clsUser.Username) != true) { return; } if (dataGridView2.Rows.Count > 0) { if (dataGridView2.SelectedRows.Count == 0) { //No Data to be edit Alert.show("Please select record first.", Alert.AlertType.warning); return; } if (txtReason.Text == "") { Alert.show("Reason is required.", Alert.AlertType.error); return; } string msg = Environment.NewLine + "Are you sure you want to return this loan for approval?"; DialogResult result = MessageBox.Show(this, msg, "PLDT Credit Cooperative", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { using (SqlConnection con = new SqlConnection(global.connectString())) { con.Open(); //Cancelled JV SqlCommand cmdJV = new SqlCommand(); cmdJV.Connection = con; cmdJV.CommandText = "UPDATE Journal_Header SET Posted = '0', Cancelled = '1', Cancelled_By = '" + Classes.clsUser.Username + "', Cancel_Note = '" + txtReason.Text + "' WHERE jv_no = '" + dataGridView2.SelectedRows[0].Cells["jv_no"].Value.ToString() + "'"; cmdJV.CommandType = CommandType.Text; cmdJV.ExecuteNonQuery(); //RETURN TO FOR APPROVAL SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "UPDATE Loan SET Status = '1', jv_no = NULL WHERE loan_no = '" + dataGridView2.SelectedRows[0].Cells["loan_no"].Value.ToString() + "'"; cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); } Alert.show("Loan No " + dataGridView2.SelectedRows[0].Cells["loan_no"].Value.ToString() + " successfully returned for approval.", Alert.AlertType.success); //refresh clsLoanATM.loadATMWithdrawal(dataGridView2); clsLoanATM.loadBank(cmbBank); } } else { Alert.show("No record(s) found.", Alert.AlertType.error); return; } }
private void button2_Click(object sender, EventArgs e) { if (clsAccess.checkForInsertRestriction("ATM Disk / Advice", Classes.clsUser.Username) != true) { return; } if (dgvATM.Rows.Count == 0) { Alert.show("No ATM transaction.", Alert.AlertType.error); return; } if (cmbBank.Text == "") { //Message Alert Alert.show("Bank Code is required.", Alert.AlertType.error); return; } if (txtTrans.Text == "") { //Message Alert Alert.show("Transaction No. is required.", Alert.AlertType.error); return; } //check if theres a selected purpose int icount = 0; foreach (ListViewItem lItem in listView1.Items) { if (lItem.Checked == true) { icount = icount + 1; } } if (icount == 0) { Alert.show("Please check at least 1 transaction at Make Deposit field.", Alert.AlertType.error); return; } if (cmbBank.Text == "BPI") { CreateBPI(); } else if (cmbBank.Text == "MBTC") { createMBTCDisk(); } else if (cmbBank.Text == "BDO") { CreateBDO(); } }
private void btnCancel_Click(object sender, EventArgs e) { if (dataGridView2.Rows.Count > 0) { if (dataGridView2.SelectedRows.Count == 0) { //No Data to be edit Alert.show("Please select record first.", Alert.AlertType.warning); return; } if (txtReason.Text == "") { Alert.show("Reason is required for cancellation of loan.", Alert.AlertType.error); return; } string msg = Environment.NewLine + "Are you sure you want to cancel this loan?"; DialogResult result = MessageBox.Show(this, msg, "PLDT Credit Cooperative", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { /* * cancel loan * cancel journal * task to cancel */ using (SqlConnection con = new SqlConnection(global.connectString())) { con.Open(); //Cancelled Loan SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "UPDATE Loan SET Status = '7', Note ='" + txtReason.Text + "' WHERE Loan_No = '" + dataGridView2.SelectedRows[0].Cells["Loan_No"].Value.ToString() + "'"; cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); //Cancelled JV SqlCommand cmdJV = new SqlCommand(); cmdJV.Connection = con; cmdJV.CommandText = "UPDATE Journal_Header SET Posted = '0', Cancelled = '1', Cancelled_By = '" + Classes.clsUser.Username + "', Cancel_Note = '" + txtReason.Text + "' WHERE jv_no = '" + dataGridView2.SelectedRows[0].Cells["jv_no"].Value.ToString() + "'"; cmdJV.CommandType = CommandType.Text; cmdJV.ExecuteNonQuery(); } Alert.show("Loan successfully cancelled.", Alert.AlertType.success); //refresh clsLoanATM.loadATMWithdrawal(dataGridView2); clsLoanATM.loadBank(cmbBank); } } else { Alert.show("No records found.", Alert.AlertType.error); return; } }
private void btnDelete_Click(object sender, EventArgs e) { if (clsAccess.checkForDeleteRestriction(lblTitle.Text, Classes.clsUser.Username) != true) { return; } if (txtCode.Text == "") //Check if code is empty { if (dataGridView1.SelectedRows.Count > 0) // make sure user select at least 1 row { string code = dataGridView1.SelectedRows[0].Cells[0].Value + string.Empty; string description = dataGridView1.SelectedRows[0].Cells[1].Value + string.Empty; string remarks = dataGridView1.SelectedRows[0].Cells[2].Value + string.Empty; txtCode.Text = code; txtDescription.Text = description; txtRemarks.Text = remarks; } } //ASK FIRST IF YOU WANT TO TAGGED AS INACTIVE[WIll not reflect on table and in syste] string msg = Environment.NewLine + "Are you sure you want to delete this Payroll Code?"; DialogResult result = MessageBox.Show(this, msg, "PLDT Credit Cooperative", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { //Delete or Tagged as Inactive goes here //CONNECTION TO SQL SERVER AND STORED PROCEDURE using (SqlConnection con = new SqlConnection(global.connectString())) { con.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "sp_InactivePayrollGroup"; cmd.Parameters.AddWithValue("@Payroll_Code", txtCode.Text); cmd.ExecuteNonQuery(); } txtCode.Text = ""; txtDescription.Text = ""; txtRemarks.Text = ""; //Load Real Time global.loadDataForFileMaintenance(dataGridView1, "Payroll_Group"); //Message Alert.show("Payroll Code successfully deleted.", Alert.AlertType.success); } else { return; } }
private void btnSearch_Click(object sender, EventArgs e) { if (txtSearchText.Text == "") { Alert.show("Please enter a valid keyword!", Alert.AlertType.error); return; } clsATMReject.searchInvalidAccount(txtSearchText, txtSearchText.Text.Trim(), dataGridView1); }
private void btnSearch_Click(object sender, EventArgs e) { if (txtEmployeeID.Text == "" && txtLastName.Text == "" && txtFirstName.Text == "") { Alert.show("No keywords to be search!", Alert.AlertType.warning); return; } clsLookUp.searchPrincipal(txtEmployeeID.Text, txtFirstName.Text, txtLastName.Text, dataGridView1); }
private void button3_Click_1(object sender, EventArgs e) { if (clsAccess.checkForInsertRestriction("ATM Disk / Advice", Classes.clsUser.Username) != true) { return; } if (txtTrans.Text == "") { Alert.show("Transaction No. is required.", Alert.AlertType.error); return; } //check if theres a selected purpose int icount = 0; foreach (ListViewItem lItem in listView1.Items) { if (lItem.Checked == true) { icount = icount + 1; } } if (icount == 0) { Alert.show("Please check at least 1 transaction at Make Deposit field.", Alert.AlertType.error); return; } if (cmbBank.Text == "BPI") { //delete first atm temp BPI using (SqlConnection con = new SqlConnection(global.connectString())) { con.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "Delete tempBPI"; cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); } //Print Report loadBPIReport(); } else if (cmbBank.Text == "BDO") { loadBDOReport(); } else if (cmbBank.Text == "MBTC") { loadMBTCRepor(); } }
private void btnCancel_Click(object sender, EventArgs e) { if (dataGridView1.Rows.Count == 0) { Alert.show("No records found", Alert.AlertType.error); return; } string msg = Environment.NewLine + "Are you sure you want to remove this item(s)?"; DialogResult result = MessageBox.Show(this, msg, "PLDT Credit Cooperative", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { var selectedRows = dataGridView1.SelectedRows .OfType <DataGridViewRow>() .Where(row => !row.IsNewRow) .ToArray(); //Cancel Status if Remove using (SqlConnection con = new SqlConnection(global.connectString())) { con.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "sp_CancellationOfWithdrawal"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Withdrawal_Slip_No", dataGridView1.SelectedRows[0].Cells["Withdrawal_Slip_No"].Value.ToString()); cmd.Parameters.AddWithValue("@CancelledlNote", "Cancel From Replenishment"); cmd.Parameters.AddWithValue("@Cancelled_By", Classes.clsUser.Username); cmd.ExecuteNonQuery(); foreach (var row in selectedRows) { dataGridView1.Rows.Remove(row); } dataGridView1.ClearSelection(); txtTotalNoSlips.Text = dataGridView1.Rows.Count.ToString(); //Compute Amount if (dataGridView1.Rows.Count >= 1) { for (int i = 0; i < dataGridView1.Rows.Count; ++i) { sum += Convert.ToDecimal(dataGridView1.Rows[i].Cells["AmtWithdrawn"].Value); } } txtAmount.Text = sum.ToString(); } } }
private void button6_Click(object sender, EventArgs e) { using (SqlConnection con = new SqlConnection()) { con.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "sp_SearchMemberForApproval"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Keyword", txtSearch.Text); SqlDataAdapter adapter = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); adapter.Fill(dt); if (dt.Rows.Count > 0) { dataGridView1.DataSource = dt; int colCnt = dt.Columns.Count; int x = 0; while (x != colCnt) { dataGridView1.Columns[x].Visible = false; x = x + 1; } dataGridView1.Columns["EmployeeID"].Visible = true; dataGridView1.Columns["EmployeeID"].HeaderText = "Employee ID"; dataGridView1.Columns["LastName"].Visible = true; dataGridView1.Columns["LastName"].HeaderText = "Last Name"; dataGridView1.Columns["FirstName"].Visible = true; dataGridView1.Columns["FirstName"].HeaderText = "First Name"; dataGridView1.Columns["MiddleName"].Visible = true; dataGridView1.Columns["MiddleName"].HeaderText = "Middle Name"; dataGridView1.Columns["Date_Of_Birth"].Visible = true; dataGridView1.Columns["Date_Of_Birth"].HeaderText = "Birthday"; dataGridView1.Columns["IsApprove"].Visible = true; dataGridView1.Columns["IsApprove"].FillWeight = 60; dataGridView1.Columns["IsApprove"].HeaderText = "Approve"; dataGridView1.Columns["IsApprove"].ReadOnly = false; } else { Alert.show("No record found.", Alert.AlertType.error); } } }
private void btnPost_Click(object sender, EventArgs e) { if (dataGridView2.Rows.Count > 0) { string msg = Environment.NewLine + "Are you sure you want to continue?"; DialogResult result = MessageBox.Show(this, msg, "PLDT Credit Cooperative", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { using (SqlConnection con = new SqlConnection(global.connectString())) { con.Open(); foreach (DataGridViewRow row in dataGridView2.Rows) { cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "sp_InsertLoanToATM"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@userID", row.Cells["userID"].Value); cmd.Parameters.AddWithValue("@EmployeeID", row.Cells["EmployeeID"].Value); cmd.Parameters.AddWithValue("@Account_No", row.Cells["Atm_Account_No"].Value); cmd.Parameters.AddWithValue("@Bank_Code", row.Cells["Bank_Code"].Value); cmd.Parameters.AddWithValue("@Amount", row.Cells["NetProceeds"].Value); cmd.Parameters.AddWithValue("@Purpose", row.Cells["Loan_Type"].Value); cmd.Parameters.AddWithValue("@Name", row.Cells["LastName"].Value + ", " + row.Cells["FirstName"].Value + " " + row.Cells["MiddleName"].Value + " " + row.Cells["Suffix"].Value); cmd.Parameters.AddWithValue("@Loan_No", row.Cells["Loan_No"].Value); cmd.Parameters.AddWithValue("@jv_no", row.Cells["jv_no"].Value); cmd.ExecuteNonQuery(); SqlCommand cmd2 = new SqlCommand(); cmd2.Connection = con; cmd2.CommandText = "UPDATE Loan SET Status = '5' WHERE Loan_No = '" + row.Cells["Loan_No"].Value + "'"; cmd2.CommandType = CommandType.Text; cmd2.ExecuteNonQuery(); //UPDATE JOURNAL = POSTED SqlCommand cmd3 = new SqlCommand(); cmd3.Connection = con; cmd3.CommandType = CommandType.Text; cmd3.CommandText = "UPDATE Journal_Header SET Posted = '1', Posted_By = '" + Classes.clsUser.Username + "' WHERE JV_No = '" + row.Cells["jv_no"].Value + "'"; cmd3.ExecuteNonQuery(); } } Alert.show("Loan Successfully Posted", Alert.AlertType.success); //refresh clsLoanATM.loadATMWithdrawal(dataGridView2); clsLoanATM.loadBank(cmbBank); } } else { Alert.show("No record/s for posting.", Alert.AlertType.error); return; } }
private void btnSearch_Click(object sender, EventArgs e) { if (txtSearchLoanNo.Text == "") { Alert.show("Please enter valid Loan number.", Alert.AlertType.error); return; } clsLoanComputation.SearchLoanNo(dataGridView1, lblTotalCount, txtSearchLoanNo.Text, txtSearchLoanNo); }
private void btnCancel_Click(object sender, EventArgs e) { if (clsAccess.checkForDeleteRestriction("ATM Preparation", Classes.clsUser.Username) != true) { return; } if (dataGridView2.Rows.Count == 0) { Alert.show("No record(s) found.", Alert.AlertType.error); return; } //Check if cancel note is null if (txtCancelNote.Text == "") { Alert.show("Cancel note is required.", Alert.AlertType.error); return; } string msg = Environment.NewLine + "Are you sure you want to remove this transaction?"; DialogResult result = MessageBox.Show(this, msg, "PLDT Credit Cooperative", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { var selectedRows = dataGridView2.SelectedRows .OfType <DataGridViewRow>() .Where(row => !row.IsNewRow) .ToArray(); //Cancel Status if Remove using (SqlConnection con = new SqlConnection(global.connectString())) { con.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "sp_CancellationOfWithdrawal"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Withdrawal_Slip_No", dataGridView2.SelectedRows[0].Cells["Slip_No"].Value.ToString()); cmd.Parameters.AddWithValue("@CancelledlNote", txtCancelNote.Text); cmd.Parameters.AddWithValue("@Cancelled_By", Classes.clsUser.Username); cmd.ExecuteNonQuery(); } foreach (var row in selectedRows) { dataGridView2.Rows.Remove(row); } dataGridView2.ClearSelection(); txtCancelNote.Text = ""; } }
private void btnSearchLoan_Click(object sender, EventArgs e) { if (txtEmployeeID.Text == "") { Alert.show("Please select Member first.", Alert.AlertType.error); return; } PDCFolder.loanPerMember frm = new PDCFolder.loanPerMember(); frm.ShowDialog(); }
private void button2_Click(object sender, EventArgs e) { if (dgvATM.Rows.Count == 0) { Alert.show("No ATM transaction.", Alert.AlertType.error); return; } if (cmbBank.Text == "") { //Message Alert Alert.show("Bank Code is required!", Alert.AlertType.error); return; } if (txtTrans.Text == "") { //Message Alert Alert.show("Transaction Number is required!", Alert.AlertType.error); return; } //check if theres a selected purpose int icount = 0; foreach (ListViewItem lItem in listView1.Items) { if (lItem.Checked == true) { icount = icount + 1; } } if (icount == 0) { Alert.show("Please check at least 1 purpose!", Alert.AlertType.error); return; } if (cmbBank.Text == "BPI") { CreateBPI(); } else if (cmbBank.Text == "MBTC") { createMBTCDisk(); } else if (cmbBank.Text == "BDO") { CreateBDO(); } }
private void button1_Click(object sender, EventArgs e) { if (txtEmployeeID.Text == "" && txtFirstName.Text == "" && txtLastName.Text == "") { Alert.show("Please enter valid keyword to be searched.", Alert.AlertType.warning); return; } else { clsMembership.SearchMembers(dataGridView1, txtEmployeeID.Text, txtLastName.Text, txtFirstName.Text, chckPrincipal, chckDependent); } }
private void btnAddCategory_Click(object sender, EventArgs e) { if (cmbCategory.Text == "") { Alert.show("Please select Category.", Alert.AlertType.error); return; } if (cmbCategory.Text == "Loan") { if (txtLoanType.Text == "") { Alert.show("Please select Loan.", Alert.AlertType.error); return; } } if (txtAmount.Text == "") { Alert.show("Please enter Amount.", Alert.AlertType.error); return; } //======================================================= // ADD CATEGORY FIRST //======================================================= string typ; if (cmbCategory.Text == "Loan") { typ = txtLoanType.Text; } else if (cmbCategory.Text == "Savings") { typ = "SD"; } else { typ = "SC"; } dgvDetails.Rows.Add( cmbCategory.Text, typ, txtLoanNumber.Text, txtAmount.Text ); clsPDCManagement.loadTotals(dgvDetails, lblTotalAmount); }
private void btnDelete_Click(object sender, EventArgs e) { if (clsAccess.checkForDeleteRestriction(lblTitle.Text, Classes.clsUser.Username) != true) { return; } if (txtCode.Text == "") { //No Data to be edit Alert.show("Please select bank you want to delete.", Alert.AlertType.warning); return; } //ASK FIRST IF YOU WANT TO TAGGED AS INACTIVE[WIll not reflect on table and in syste] string msg = Environment.NewLine + "Are you sure you want to delete this Bank?"; DialogResult result = MessageBox.Show(this, msg, "PLDT Credit Cooperative", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { //Delete or Tagged as Inactive goes here //CONNECTION TO SQL SERVER AND STORED PROCEDURE using (SqlConnection con = new SqlConnection(global.connectString())) { con.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "sp_InactiveBank"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Bank_Code", txtCode.Text); cmd.ExecuteNonQuery(); } //Message Alert.show("Company successfully deleted.", Alert.AlertType.success); //load Banks clsbank.loadBanks(dataGridView1, "Bank"); cleartxtField(); restoreBtn(); disabletxtField(); } else { return; } }
private void btnSearch_Click(object sender, EventArgs e) { if (txtClientID.Text != "" || txtName.Text != "") { using (SqlConnection con = new SqlConnection(global.connectString())) { con.Open(); adapter = new SqlDataAdapter("SELECT * FROM Client WHERE isActive = 1 and Client_Code like '%" + txtClientID.Text + "%' and Name like '%" + txtName.Text + "%'", con); DataTable dt = new DataTable(); adapter.Fill(dt); dataGridView1.DataSource = dt; if (dt.Rows.Count > 0) { int colCnt = dt.Columns.Count; int x = 0; while (x != colCnt) { dataGridView1.Columns[x].Visible = false; x = x + 1; } dataGridView1.Columns["Client_Code"].Visible = true; dataGridView1.Columns["Client_Code"].HeaderText = "Code"; dataGridView1.Columns["Client_Code"].FillWeight = 30; dataGridView1.Columns["Name"].Visible = true; dataGridView1.Columns["Name"].HeaderText = "Client Name"; dataGridView1.Columns["Name"].FillWeight = 100; } else { Alert.show("No record/s found.", Alert.AlertType.warning); return; } } } else { Alert.show("No keywords to be search!", Alert.AlertType.warning); return; } }
private void btnSelectAll_Click(object sender, EventArgs e) { if (dataGridView1.Rows.Count > 0) { //if theres a data foreach (DataGridViewRow row in dataGridView1.Rows) { // This will check the cell. row.Cells["IsApprove"].Value = "true"; } } else { Alert.show("No record found.", Alert.AlertType.error); return; } }
private void button4_Click(object sender, EventArgs e) { if (dataGridView1.Rows.Count > 0) { //if theres a data foreach (DataGridViewRow row in dataGridView1.Rows) { // This will check the cell. row.Cells["isCheck"].Value = "false"; } } else { Alert.show("No record(s) found.", Alert.AlertType.error); return; } }
private void btnSave_Click(object sender, EventArgs e) { if (cmbLessType.Text == "") { Alert.show("Please enter Description.", Alert.AlertType.error); return; } if (txtAmountLESS.Text == "") { Alert.show("Please enter Amount to be deducted.", Alert.AlertType.error); return; } txtAmountLESS.Text = Convert.ToDecimal(txtAmountLESS.Text).ToString("#,0.00"); string[] row = { cmbLessType.SelectedValue.ToString(), txtAmountLESS.Text }; dataGridView1.Rows.Add(row); txtAmountLESS.Text = ""; }
private void button1_Click(object sender, EventArgs e) { if (txtSearch.Text != "") { using (SqlConnection con = new SqlConnection(global.connectString())) { con.Open(); SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM Client where isActive = 1 and Client_Code like '%" + txtSearch.Text + "%' or Name like '%" + txtSearch.Text + "%'", con); DataTable dt = new DataTable(); adapter.Fill(dt); dataGridView1.DataSource = dt; //Check if we got nothing if (dt.Rows.Count == 0) { Alert.show("No record/s found. Please search again.", Alert.AlertType.error); loadClient(); //Load default data } int colCnt = dt.Columns.Count; int x = 1; while (x != colCnt) { if (x != 1) { dataGridView1.Columns[x].Visible = false; } x = x + 1; } } //Search field remove txtSearch.Text = ""; } else { Alert.show("Please enter valid keyword in search box.", Alert.AlertType.error); } }
private void btnDelete_Click(object sender, EventArgs e) { if (txtCode.Text == "") { //No Data to be deleted Alert.show("Please select client you want to delete.", Alert.AlertType.error); return; } //ASK FIRST IF YOU WANT TO TAGGED AS INACTIVE[WIll not reflect on table and in syste] string msg = Environment.NewLine + "Are you sure you want to delete this Client?"; DialogResult result = MessageBox.Show(this, msg, "PLDT Credit Cooperative", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { //Delete or Tagged as Inactive goes here //CONNECTION TO SQL SERVER AND STORED PROCEDURE using (SqlConnection con = new SqlConnection(global.connectString())) { con.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "sp_InactiveClient"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Client_Code", txtCode.Text); cmd.ExecuteNonQuery(); } //Message Alert.show("Company Successfully Deleted", Alert.AlertType.success); loadClient(); clearTextField(); } else { return; } }