private bool DeleteAction() { bool result = false; switch (this.SelectedTypeCode) { case "DT": DepartmentBO department = new DepartmentBO(); department.DepartmentCD = this.RequestCode; result = DeptDesigAndFinInstitutionBusController.RemoveDepartment(department); if (result) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Department Deleted Successfully')", true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Department Not Deleted. Some Problem Occurred')", true); } this.SelectedTypeCode = null; break; case "DS": DesignationBO designation = new DesignationBO(); designation.DesignationCD = this.RequestCode; result = DeptDesigAndFinInstitutionBusController.RemoveDesignation(designation); if (result) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Designation Deleted Successfully')", true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Designation Not Deleted. Some Problem Occurred')", true); } this.SelectedTypeCode = null; break; case "FI": FinancialInstitutionBO financialInstitution = new FinancialInstitutionBO(); financialInstitution.FinancialInstitutionCD = this.RequestCode; result = DeptDesigAndFinInstitutionBusController.RemoveFinancialInstitution(financialInstitution); if (result) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Financial Institution Deleted Successfully')", true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Financial Institution Not Deleted. Some Problem Occurred')", true); } this.SelectedTypeCode = null; break; default: ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Bad Request.')", true); break; } return(result); }
protected void uc_btn_submit_Click(object sender, EventArgs e) { DepartmentBO department = new DepartmentBO(); department.DepartmentName = uc_txt_Name.Text; department.DepartmentBankAccount = uc_txt_BankAcc.Text; bool result = DeptDesigAndFinInstitutionBusController.AddDepartment(department); if (result) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Department Added Successfully')", true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Department Not Added. Some Problem Occurred')", true); } }
private void EditAction() { string postbackurl = ResourceTable("PageURL"); switch (this.SelectedTypeCode) { case "DT": DepartmentBO department = new DepartmentBO(); department.DepartmentCD = this.RequestCode; department = DeptDesigAndFinInstitutionBusController.GetDepartmentBO(department); lbl_Dept_title.Text = ResourceTable("EditDept"); this.txtDeptName.Text = department.DepartmentName; this.txtBankAcc.Text = department.DepartmentBankAccount; postbackurl += "?CD=" + StringUtil.Encode(department.DepartmentCD); this.btnAddDept.PostBackUrl = postbackurl; this.btnAddDept.Text = ResourceTable("StringUpdate"); break; case "DS": DesignationBO designation = new DesignationBO(); designation.DesignationCD = this.RequestCode; designation = DeptDesigAndFinInstitutionBusController.GetDesignationBO(designation); lbl_Desig_title.Text = ResourceTable("EditDesig"); this.txtDesigName.Text = designation.DesignationName; postbackurl += "?CD=" + StringUtil.Encode(designation.DesignationCD); this.btnDesigAdd.PostBackUrl = postbackurl; this.btnDesigAdd.Text = ResourceTable("StringUpdate"); break; case "FI": FinancialInstitutionBO financialInstitution = new FinancialInstitutionBO(); financialInstitution.FinancialInstitutionCD = this.RequestCode; financialInstitution = DeptDesigAndFinInstitutionBusController.GetFinancialInstitutionBO(financialInstitution); lbl_Fin_title.Text = ResourceTable("EditFin"); this.txtFinInstName.Text = financialInstitution.FinancialInstitutionName; this.txtFinInstAddress.Text = financialInstitution.FinancialInstitutionAddress; postbackurl += "?CD=" + StringUtil.Encode(financialInstitution.FinancialInstitutionCD); this.btnFinInstAdd.PostBackUrl = postbackurl; this.btnFinInstAdd.Text = ResourceTable("StringUpdate"); break; default: ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Bad Request.')", true); break; } }
protected void btnAddDept_Click(object sender, EventArgs e) { DepartmentBO department = new DepartmentBO(); if (this.RequestCode != null) { department.DepartmentCD = this.RequestCode; if (DeptDesigAndFinInstitutionBusController.IsDepartmentPresent(department)) { department.DepartmentName = this.txtDeptName.Text; department.DepartmentBankAccount = this.txtBankAcc.Text; bool result = DeptDesigAndFinInstitutionBusController.UpdateDepartment(department); if (result) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Department Updated Successfully')", true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Department Not Updated. Some Problem Occurred')", true); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Bad Request.')", true); } } else { department.DepartmentName = this.txtDeptName.Text; department.DepartmentBankAccount = this.txtBankAcc.Text; bool result = DeptDesigAndFinInstitutionBusController.AddDepartment(department); if (result) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Department Added Successfully')", true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Department Not Added. Some Problem Occurred')", true); } } this.SelectedTypeCode = null; ShowDiv(); }
protected void btnFinInstAdd_Click(object sender, EventArgs e) { FinancialInstitutionBO financialInstitution = new FinancialInstitutionBO(); if (this.RequestCode != null) { financialInstitution.FinancialInstitutionCD = this.RequestCode; if (DeptDesigAndFinInstitutionBusController.IsFinancialInstitutionPresent(financialInstitution)) { financialInstitution.FinancialInstitutionName = this.txtFinInstName.Text; financialInstitution.FinancialInstitutionAddress = this.txtFinInstAddress.Text; bool result = DeptDesigAndFinInstitutionBusController.UpdateFinancialInstitution(financialInstitution); if (result) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Financial Institution Updated Successfully')", true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Financial Institution Not Updated. Some Problem Occurred')", true); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Bad Request.')", true); } } else { financialInstitution.FinancialInstitutionName = this.txtFinInstName.Text; financialInstitution.FinancialInstitutionAddress = this.txtFinInstAddress.Text; bool result = DeptDesigAndFinInstitutionBusController.AddFinancialInstitution(financialInstitution); if (result) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Financial Institution Added Successfully')", true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Financial Institution Not Added. Some Problem Occurred')", true); } } }