Exemplo n.º 1
0
 //Add New Role
 public JsonResult InsertRole(Roles role)
 {
     if (ModelState.IsValid)
     {
         try
         {
             if (RoleManagementTables.InsertNewRole(role) > 0)
             {
                 return(Json(new { isError = "F", message = "New role has been added!" }));
             }
             else
             {
                 return(Json(new { isError = "T", message = "Role already exist." }));
             }
         }
         catch (Exception ex)
         {
             return(Json(new { isError = "T", message = "Could not insert data." }));
         }
     }
     else
     {
         return(Json(new { isError = "T", message = "Could not insert data." }));
     }
 }