Esempio n. 1
0
        protected void GetBankBranchById(string bankBranchId)
        {
            BankBranchBLL bankBranch = new BankBranchBLL();

            try
            {
                DataTable dt = bankBranch.GetBankBranchById(bankBranchId);

                if (dt.Rows.Count > 0)
                {
                    bankBranchNameForUpdateHiddenField.Value = bankBranchNameTextBox.Text = dt.Rows[0]["BranchName"].ToString();
                    descriptionTextBox.Text = dt.Rows[0]["Description"].ToString();
                    bankDropDownList.SelectedValue = dt.Rows[0]["BankId"].ToString();
                }
                else
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Bank Branch Data Not Found!!!"; msgDetailLabel.Text = "";
                    msgbox.Attributes.Add("class", "alert alert-warning");
                }
            }
            catch (Exception ex)
            {
                string message = "Somethings goes wrong in get Branch By ID";
                if (ex.InnerException != null) { message += " --> Somethings goes wrong in get Branch by ID "; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                bankBranch = null;
            }
        }
Esempio n. 2
0
        protected void GetBankBranchList()
        {
            BankBranchBLL bankBranch = new BankBranchBLL();

            try
            {
                DataTable dt = bankBranch.GetBankBranchList();
                bankBranchListGridView.DataSource = dt;
                bankBranchListGridView.DataBind();

                if (bankBranchListGridView.Rows.Count > 0)
                {
                    bankBranchListGridView.UseAccessibleHeader = true;
                    bankBranchListGridView.HeaderRow.TableSection = TableRowSection.TableHeader;
                }
                else
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Bank Branch List Data Not Found!!!"; msgDetailLabel.Text = "";
                    msgbox.Attributes.Add("class", "alert alert-warning");
                }
            }
            catch (Exception ex)
            {
                string message = "Somethings goes wrong in get Brach List";
                if (ex.InnerException != null) { message += " --> Somethings goes wrong in get Branch List"; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                bankBranch = null;
            }
        }
Esempio n. 3
0
        protected void saveButton_Click(object sender, EventArgs e)
        {
            BankBranchBLL bankBranch = new BankBranchBLL();

            try
            {
                if (bankDropDownList.SelectedValue == "")
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Bank Name field is required.";
                }
                else if (bankBranchNameTextBox.Text.Trim() == "")
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Bank Branch Name field is required.";
                }
                else if (descriptionTextBox.Text.Trim() == "")
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Description field is required.";
                }
                else
                {
                    bankBranch.BankId = bankDropDownList.SelectedValue.Trim();
                    bankBranch.BankBranchName = bankBranchNameTextBox.Text.Trim();
                    bankBranch.Description = descriptionTextBox.Text.Trim();

                    if (!bankBranch.CheckDuplicateBankBranch(bankBranch.BankId.Trim(), bankBranch.BankBranchName.Trim()))
                    {
                        DataTable dt = bankBranch.SaveBankBranch();

                        if (dt.Rows.Count > 0)
                        {
                            string message = "Bank Branch <span class='actionTopic'>Created</span> Successfully with Bank Branch ID: <span class='actionTopic'>" + dt.Rows[0][0].ToString() + "</span>.";
                            MyAlertBox("var callbackOk = function () { MyOverlayStart(); window.location = \"/UI/AccUI/BankBranch/List.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);");
                        }
                        else
                        {
                            string message = "<span class='actionTopic'>Failed</span> to Create Bank Branch.";
                            MyAlertBox("ErrorAlert(\"" + "Process Failed" + "\", \"" + message + "\");");
                        }
                    }
                    else
                    {
                        string message = "This Bank Branch Name <span class='actionTopic'>already exist</span>, try another one.";
                        MyAlertBox("WarningAlert(\"" + "Data Duplicate" + "\", \"" + message + "\");");
                    }
                }
            }
            catch (Exception ex)
            {
                string message = "Somethings goes wrong in Save";
                if (ex.InnerException != null) { message += " --> Somethings goes wrong in Page Load"; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                bankBranch = null;
            }
        }
Esempio n. 4
0
        protected void deletedListButton_Click(object sender, EventArgs e)
        {
            BankBranchBLL bankBranch = new BankBranchBLL();

            try
            {
                if (fromDateTextBox.Text.Trim() == "" || LumexLibraryManager.ParseAppDate(fromDateTextBox.Text.Trim()) == "False")
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Date From field is required.";
                }
                else if (toDateTextBox.Text.Trim() == "" || LumexLibraryManager.ParseAppDate(toDateTextBox.Text.Trim()) == "False")
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Date To field is required.";
                }
                else
                {
                    string fromDate = LumexLibraryManager.ParseAppDate(fromDateTextBox.Text.Trim());
                    string toDate = LumexLibraryManager.ParseAppDate(toDateTextBox.Text.Trim());

                    DataTable dt = bankBranch.GetDeletedBankBranchListByDateRangeAll(fromDate, toDate, "");

                    deletedListGridView.DataSource = dt;
                    deletedListGridView.DataBind();

                    if (deletedListGridView.Rows.Count > 0)
                    {
                        deletedListGridView.UseAccessibleHeader = true;
                        deletedListGridView.HeaderRow.TableSection = TableRowSection.TableHeader;
                    }
                    else
                    {
                        msgbox.Visible = true; msgTitleLabel.Text = "Deleted Bank Branch List Data Not Found!!!"; msgDetailLabel.Text = "";
                        msgbox.Attributes.Add("class", "alert alert-info");
                    }
                }
            }
            catch (Exception ex)
            {
                string message = "Somethings goes wrong in Delete";
                if (ex.InnerException != null) { message += " --> Somethings goes wrong in Delete "; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                bankBranch = null;
                MyAlertBox("MyOverlayStop();");
            }
        }
Esempio n. 5
0
        public DataTable SaveBankBranch(BankBranchBLL bankBranch, LumexDBPlayer db)
        {
            try
            {
                db.AddParameters("@BankId", bankBranch.BankId.Trim());
                db.AddParameters("@BankBranchName", bankBranch.BankBranchName.Trim());
                db.AddParameters("@Description", bankBranch.Description.Trim());
                db.AddParameters("@CreatedBy", LumexSessionManager.Get("ActiveUserId").ToString());
                db.AddParameters("@CreatedFrom", LumexLibraryManager.GetTerminal());

                DataTable dt = db.ExecuteDataTable("INSERT_BANK_BRANCH", true);
                return dt;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                bankBranch = null;
            }
        }
Esempio n. 6
0
        protected void activateLinkButton_Click(object sender, EventArgs e)
        {
            try
            {
                LinkButton lnkBtn = (LinkButton)sender;
                GridViewRow row = (GridViewRow)lnkBtn.NamingContainer;

                BankBranchBLL bankBranch = new BankBranchBLL();
                bankBranch.UpdateBankBranchActivation(bankBranchListGridView.Rows[row.RowIndex].Cells[0].Text.ToString(), "True");

                bankBranchListGridView.Rows[row.RowIndex].Cells[4].Text = "True";
                string message = "Bank Branch <span class='actionTopic'>Activated</span> Successfully.";
                MyAlertBox("SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", \"\");");
            }
            catch (Exception ex)
            {
                string message = "Somethings goes wrong in Activate";
                if (ex.InnerException != null) { message += " --> Somethings goes wrong in Activate "; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
        }
Esempio n. 7
0
        public void UpdateBankBranch(BankBranchBLL bankBranch, LumexDBPlayer db)
        {
            try
            {
                db.AddParameters("@BankBranchId", bankBranch.BankBranchId.Trim());
                db.AddParameters("@BankBranchName", bankBranch.BankBranchName.Trim());
                db.AddParameters("@Description", bankBranch.Description.Trim());
                db.AddParameters("@ModifiedBy", LumexSessionManager.Get("ActiveUserId").ToString());
                db.AddParameters("@ModifiedFrom", LumexLibraryManager.GetTerminal());

                db.ExecuteNonQuery("UPDATE_BANK_BRANCH_BY_ID", true);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                bankBranch = null;
            }
        }
Esempio n. 8
0
        protected void updateButton_Click(object sender, EventArgs e)
        {
            BankBranchBLL bankBranch = new BankBranchBLL();

            try
            {
                if (bankBranchIdForUpdateHiddenField.Value.Trim() == "")
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = "Bank Branch not found to update.";
                }
                else if (bankBranchNameTextBox.Text.Trim() == "")
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Bank Branch Name field is required.";
                }
                else if (descriptionTextBox.Text.Trim() == "")
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Description field is required.";
                }
                else
                {
                    bankBranch.BankId = bankDropDownList.SelectedValue.Trim();
                    bankBranch.BankBranchId = bankBranchIdForUpdateHiddenField.Value.Trim();
                    bankBranch.BankBranchName = bankBranchNameTextBox.Text.Trim();
                    bankBranch.Description = descriptionTextBox.Text.Trim();

                    if (!bankBranch.CheckDuplicateBankBranch(bankBranch.BankId, bankBranchNameTextBox.Text.Trim()))
                    {
                        bankBranch.UpdateBankBranch();

                        bankBranchNameForUpdateHiddenField.Value = "";
                        bankBranchIdForUpdateHiddenField.Value = "";

                        string message = "Bank Branch <span class='actionTopic'>Updated</span> Successfully.";
                        MyAlertBox("var callbackOk = function () { MyOverlayStart(); window.location = \"/UI/AccUI/BankBranch/List.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);");
                    }
                    else
                    {
                        if (bankBranchNameForUpdateHiddenField.Value == bankBranchNameTextBox.Text.Trim())
                        {
                            bankBranch.BankBranchName = "WithOut";
                            bankBranch.UpdateBankBranch();

                            bankBranchNameForUpdateHiddenField.Value = "";
                            bankBranchIdForUpdateHiddenField.Value = "";

                            string message = "Bank Branch <span class='actionTopic'>Updated</span> Successfully.";
                            MyAlertBox("var callbackOk = function () { MyOverlayStart(); window.location = \"/UI/AccUI/BankBranch/List.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);");
                        }
                        else
                        {
                            string message = "This Bank Branch Name <span class='actionTopic'>already exist</span>, try another one.";
                            MyAlertBox("WarningAlert(\"" + "Data Duplicate" + "\", \"" + message + "\");");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                string message = "Somethings goes wrong in Update";
                if (ex.InnerException != null) { message += " --> Somethings goes wrong in Update"; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                bankBranch = null;
            }
        }