Пример #1
0
        private static User _GetUser(OpenCbsReader pReader)
        {
            User user = new User
                            {
                                Id = pReader.GetInt("user_id"),
                                UserName = pReader.GetString("user_name"),
                                FirstName = pReader.GetString("first_name"),
                                LastName = pReader.GetString("last_name"),
                                Mail = pReader.GetString("mail"),
                                IsDeleted = pReader.GetBool("deleted"),
                                HasContract = (pReader.GetInt("contract_count") != 0),
                                Sex = pReader.GetChar("sex"),
                                Phone = pReader.GetString("phone")
                            };
            user.SetRole(pReader.GetString("role_code"));

            user.UserRole = new Role
                            {
                                RoleName = pReader.GetString("role_name"),
                                Id = pReader.GetInt("role_id")
                            };

            return user;
        }
Пример #2
0
 private static User _AddUser(int pId, string pUserName, string pPassword, string pRole)
 {
     User user = new User {Id = pId, UserName = pUserName, Password = pPassword};
     user.SetRole(pRole);
     return user;
 }