示例#1
0
 /// <summary>This method deletes the selected roles.</summary>
 /// <param name="deletedRolesWithAdminUser">The DeletedRolesWithAdminUser Object.</param>
 /// <returns>List of Roles Object.</returns>
 public List <AdminRoles> DeleteRoles(DeletedRolesWithAdminUser deletedRolesWithAdminUser)
 {
     Logging.LogDebugMessage("Method: DeleteRoles, MethodType: Post, Layer: RolesController, Parameters: DeletedUsersWithAdminUser = " + JsonConvert.SerializeObject(deletedRolesWithAdminUser));
     using (RolesBL roleBL = new RolesBL())
     {
         return(roleBL.DeleteRoles(deletedRolesWithAdminUser));
     }
 }
示例#2
0
 /// <summary>This method deletes the selected roles.</summary>
 /// <param name="deletedRolesWithAdminUser">The DeletedRolesWithAdminUser Object.</param>
 /// <returns>List of Roles Object.</returns>
 public List <AdminRoles> DeleteRoles(DeletedRolesWithAdminUser deletedRolesWithAdminUser)
 {
     Logging.LogDebugMessage("Method: DeleteRoles, MethodType: Post, Layer: RolesBL, Parameters: DeletedRolesWithAdminUser = "******"Method: DeleteRoles, Layer: RolesBL, Stack Trace: " + sqlEx.ToString());
             throw;
         }
         catch (Exception ex)
         {
             Logging.LogErrorMessage("Method: DeleteRoles, Layer: UserBL, Stack Trace: " + ex.ToString());
             throw;
         }
     }
 }
示例#3
0
        /// <summary>This method deletes the selected roles.</summary>
        /// <param name="deletedRolesWithAdminUser">The DeletedRolesWithAdminUser Object.</param>
        /// <returns>List of Roles Object.</returns>
        public List <AdminRoles> DeleteRoles(DeletedRolesWithAdminUser deletedRolesWithAdminUser)
        {
            Logging.LogDebugMessage("Method: DeleteUsers, MethodType: Post, Layer: RolesDAL, Parameters: DeletedRolesWithAdminUser = "******"USP_RoleDelete";
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.Add(new SqlParameter()
                    {
                        ParameterName = "@RoleIDs", Value = deletedRolesWithAdminUser.RoleIds
                    });
                    command.Parameters.Add(new SqlParameter()
                    {
                        ParameterName = "@AdminUserID", Value = deletedRolesWithAdminUser.AdminUserId
                    });

                    using (SqlDataAdapter adapter = new SqlDataAdapter(command))
                    {
                        adapter.Fill(dataSet);
                    }
                }
            }
            catch (SqlException sqlEx)
            {
                Logging.LogErrorMessage("Method: DeleteRoles, Layer: RolesDAL, Stack Trace: " + sqlEx.ToString());
                throw;
            }
            catch (Exception ex)
            {
                Logging.LogErrorMessage("Method: DeleteRoles, Layer: RolesDAL, Stack Trace: " + ex.ToString());
                throw;
            }

            return(this.GetAllRoles());
        }