Exemple #1
0
 public static void DeleteAllRolesByUser(string IdUser)
 {
     SubSonic.SqlQuery currentDelete = new SubSonic.Delete()
                 .From(UserByRole.Schema)
                 .Where(UserByRole.IdUserColumn).IsEqualTo(IdUser);
     currentDelete.Execute();
 }
Exemple #2
0
 public static void DeleteAllCampaignsByUser(int IdUser)
 {
     SubSonic.SqlQuery currentDelete = new SubSonic.Delete()
                 .From(UserByArea.Schema)
                 .Where(UserByArea.IdUserColumn).IsEqualTo(IdUser);
     currentDelete.Execute();
 }
Exemple #3
0
        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();
            }
        }
Exemple #4
0
        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();
            }
        }