protected void approveButton_Click(object sender, EventArgs e) { JournalVoucherBLL journalVoucher = new JournalVoucherBLL(); 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) { journalVoucher.ApproveJournalVoucherByJournal(voucherListGridView.Rows[i].Cells[0].Text.Trim()); count++; } } if (count > 0) { GetApprovalList(); string message = count.ToString() + " Journal Voucher(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 { journalVoucher = null; MyAlertBox("MyOverlayStop();"); } }
protected void approveButton_Click(object sender, EventArgs e) { JournalVoucherBLL journalVoucher = new JournalVoucherBLL(); try { if (drAmtLabel.Text.Trim() == crAmtLabel.Text.Trim()) { journalVoucher.ApproveJournalVoucherByJournal(numberLabel.Text.Trim()); string message = "Journal Voucher <span class='actionTopic'>Approved</span> Successfully."; MyAlertBox("var callbackOk = function () { MyOverlayStart(); window.location = \"/UI/AccUI/JournalVoucher/JournalVoucherApprovalList.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);"); } else { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Total Debit & Credit Amount must be Same."; } } catch (Exception ex) { string message = ex.Message; if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); } finally { journalVoucher = null; } }