Exemple #1
0
 protected void ButtonAddRole_Click(object sender, EventArgs e)
 {
     try
     {
         if (DropDownListEmployeeRole.Items.Count > 0)
         {
             if (DropDownListEmployeeRole.SelectedValue != "0")
             {
                 EmployeeRole.InsertEmployeeRole(this.employeeId, DropDownListEmployeeRole.SelectedItem.ToString(), this.Master.LoggedOnAccount);
                 BindEmployeeRoleList();
             }
         }
     }
     catch (System.Data.SqlClient.SqlException sqlEx)
     {
         LabelError.Text = "";
         for (int i = 0; i < sqlEx.Errors.Count; i++)
         {
             LabelError.Text += (sqlEx.Errors[i].Message + "<br />");
         }
         PanelError.Visible = true;
     }
 }