示例#1
0
文件: User.cs 项目: johnval990/ISOA
 public static void DeleteAllRolesByUser(string IdUser)
 {
     SubSonic.SqlQuery currentDelete = new SubSonic.Delete()
                 .From(UserByRole.Schema)
                 .Where(UserByRole.IdUserColumn).IsEqualTo(IdUser);
     currentDelete.Execute();
 }
示例#2
0
文件: User.cs 项目: johnval990/ISOA
 public static void DeleteAllCampaignsByUser(int IdUser)
 {
     SubSonic.SqlQuery currentDelete = new SubSonic.Delete()
                 .From(UserByArea.Schema)
                 .Where(UserByArea.IdUserColumn).IsEqualTo(IdUser);
     currentDelete.Execute();
 }
示例#3
0
文件: User.cs 项目: johnval990/ISOA
        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();
            }
        }
示例#4
0
文件: User.cs 项目: johnval990/ISOA
        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();
            }
        }