Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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();
        }