Exemplo n.º 1
0
 public void CreateRoles(IRoles roles)
 {
     using (SqlConnection connection = base.GetConnection())
     {
         SqlCommand command = new SqlCommand("_RolesUpdate", connection) {
             CommandType = CommandType.StoredProcedure
         };
         command.Parameters.AddWithValue("@Type", 0);
         command.Parameters.AddWithValue("@Roles_ID", 1);
         command.Parameters.AddWithValue("@Roles_Name", roles.RolesName);
         command.Parameters.AddWithValue("@Roles_Modules", roles.RolesModules);
         connection.Open();
         if (command.ExecuteNonQuery() <= 0)
         {
             throw new DataAccessException("Lỗi kh\x00f4ng tao moi roles");
         }
         command.Dispose();
     }
 }
Exemplo n.º 2
0
        public IRoles ReceiveHtml()
        {
            IRoles roles = new IRoles();
            roles.RolesID = (hddRoles_ID.Value != "") ? Convert.ToInt32(hddRoles_ID.Value) : 0;
            roles.RolesName = (txtRolesName.Text != "") ? txtRolesName.Text.Trim() : "";
            roles.RolesModules = (CheckedList() != "") ? CheckedList() : "";

            return roles;
        }