protected void DepartmentSaveButton_Click(object sender, EventArgs e)
 {
     if (IdHiddenField.Value == "")
     {
         Departments _Department = new Departments();
         _Department.DeptCode = txtDepartmentCode.Text;
         decimal countcode = _DepartmentManager.AlreadyExitCode(_Department);
         if (countcode >= 1)
         {
             ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('This Code Already Exist');", true);
         }
         else
         {
             _Department.DeptName = txtDepartmentName.Text;
             decimal countname = _DepartmentManager.AlreadyExitName(_Department);
             if (countname >= 1)
             {
                 ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('This Name Already Exist');", true);
             }
             else
             {
                 int success = _DepartmentManager.Add(_Department);
                 if (success > 0)
                 {
                     ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Successefully Save Department');", true);
                     txtDepartmentCode.Text = "";
                     txtDepartmentName.Text = "";
                 }
                 else
                 {
                     ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Failed Department Saved');", true);
                 }
             }
         }
     }
 }