public static void DeleteAllRolesByUser(string IdUser) { SubSonic.SqlQuery currentDelete = new SubSonic.Delete() .From(UserByRole.Schema) .Where(UserByRole.IdUserColumn).IsEqualTo(IdUser); currentDelete.Execute(); }
public static void DeleteAllCampaignsByUser(int IdUser) { SubSonic.SqlQuery currentDelete = new SubSonic.Delete() .From(UserByArea.Schema) .Where(UserByArea.IdUserColumn).IsEqualTo(IdUser); currentDelete.Execute(); }
public static void SaveRolesByUser(int IdUser, List<int> itemList) { SubSonic.SqlQuery currentDelete = new SubSonic.Delete() .From(UserByRole.Schema) .Where(UserByRole.IdUserColumn).IsEqualTo(IdUser); currentDelete.Execute(); foreach (int item in itemList) { UserByRole newUserRole = new UserByRole(); newUserRole.IdUserByRole = IdUser; newUserRole.IdAplicationRole = item; newUserRole.Save(); } }
public static void SaveAreasByUser(int IdUser, List<int> itemList) { SubSonic.SqlQuery currentDelete = new SubSonic.Delete() .From(UserByArea.Schema) .Where(UserByArea.IdUserColumn).IsEqualTo(IdUser); currentDelete.Execute(); foreach (int item in itemList) { UserByArea newUserArea = new UserByArea(); newUserArea.IdUser = IdUser; newUserArea.IdArea = item; newUserArea.Save(); } }