protected void approveLinkButton_Click(object sender, EventArgs e) { DebitCreditVoucherBLL debitCreditVoucher = new DebitCreditVoucherBLL(); try { debitCreditVoucher.ApproveCreditVoucherByJournal(journalNumberForApproveHiddenField.Value.Trim(), "Cash"); GetApprovalList(); string message = "Credit Voucher Cash <span class='actionTopic'>Approved</span> Successfully."; MyAlertBox("SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", \"\");"); } catch (Exception ex) { string message = ex.Message; if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); } finally { debitCreditVoucher = null; MyAlertBox("MyOverlayStop();"); } }
protected void approveButton_Click(object sender, EventArgs e) { DebitCreditVoucherBLL debitCreditVoucher = new DebitCreditVoucherBLL(); CheckBox selectCheckBox; int count = 0; try { for (int i = 0; i < voucherListGridView.Rows.Count; i++) { selectCheckBox = (CheckBox)voucherListGridView.Rows[i].Cells[5].FindControl("selectCheckBox"); if (selectCheckBox.Checked) { debitCreditVoucher.ApproveCreditVoucherByJournal(voucherListGridView.Rows[i].Cells[0].Text.Trim(), "Cash"); count++; } } if (count > 0) { GetApprovalList(); string message = count.ToString() + " Credit Voucher Cash(s) <span class='actionTopic'>Approved</span> Successfully."; MyAlertBox("SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", \"\");"); } else { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "No Voucher(s) are selected to Approve."; } } catch (Exception ex) { string message = ex.Message; if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); } finally { debitCreditVoucher = null; MyAlertBox("MyOverlayStop();"); } }