Ejemplo n.º 1
0
 public Person(string firstName, string lastName, bool isFriend, SexEnum sex)
 {
     FirstName = firstName;
     LastName  = lastName;
     IsFriend  = isFriend;
     Sex       = sex;
 }
Ejemplo n.º 2
0
 public Shoes(string shoesModel, int size, string brand, SexEnum sex)
 {
     ShoesModel = shoesModel;
     Size       = size;
     Brand      = brand;
     Sex        = sex;
 }
Ejemplo n.º 3
0
        public static SexEnum SexStringToEnum(String sex)
        {
            SexEnum sexEnum = SexEnum.NOT_APPLICABLE;

            if (String.IsNullOrEmpty(sex))
            {
                return(sexEnum);
            }

            if (sex == "Male")
            {
                sexEnum = SexEnum.MALE;
            }
            else if (sex == "Female")
            {
                sexEnum = SexEnum.FEMALE;
            }
            else if (sex == "not known")
            {
                sexEnum = SexEnum.NOT_KNOWN;
            }
            else
            {
                sexEnum = SexEnum.NOT_APPLICABLE;
            }

            return(sexEnum);
        }
Ejemplo n.º 4
0
        private void GetVokativ()
        {
            if (CleanUp)
            {
                LastName = CleanUpText();
            }
            else
            {
                LastName = GetLastWord(OrigFullname);
            }

            this.NameVokativ = LastName;
            this.Sex         = SexEnum.Unknown;

            for (int l = 0; l < vokativDataLength.Count(); l++)
            {
                if (LastName.Length >= vokativDataLength[l])
                {
                    string end = LastName.Substring(LastName.Length - vokativDataLength[l]).ToLower();
                    if (vokativData.ContainsKey(end))
                    {
                        this.NameVokativ = LastName.Substring(0, LastName.Length - vokativDataLength[l]) + vokativData[end].VokativEnd;
                        this.Sex         = vokativData[end].Sex;
                        break;
                    }
                }
            }

            //make name nice, first UpperCase
            if (!string.IsNullOrEmpty(this.NameVokativ))
            {
                this.NameVokativ = this.NameVokativ[0].ToString().ToUpper() + this.NameVokativ.Substring(1).ToLower();
            }
        }
Ejemplo n.º 5
0
    protected long GetNpcEquip(SexEnum sex, string data)
    {
        long hatId = 0;

        if (CheckUtil.StringIsNull(data))
        {
            hatId = -1;
        }
        else
        {
            string[] hatList = StringUtil.SplitBySubstringForArrayStr(data, ',');
            if (hatList.Length >= 2)
            {
                switch (sex)
                {
                case SexEnum.Man:
                    hatId = long.Parse(hatList[0]);
                    break;

                case SexEnum.Woman:
                    hatId = long.Parse(hatList[1]);
                    break;

                default:
                    hatId = long.Parse(hatList[0]);
                    break;
                }
            }
            else
            {
                hatId = long.Parse(npc_hat);
            }
        }
        return(hatId);
    }
 public TomCat(int age, string name, SexEnum sex)
     : base(age, name, sex)
 {
     if (sex != SexEnum.Male)
     {
         throw new ArgumentException("TomCats must be male");
     }
 }
Ejemplo n.º 7
0
Archivo: Kitten.cs Proyecto: kicata/OPP
 public Kitten(string name, int age, SexEnum sex)
     : base(name, age, sex)
 {
     if (sex != SexEnum.Female)
     {
         throw new ArgumentException("Kittens must be female");
     }
 }
Ejemplo n.º 8
0
 public static AnalyticsResult SetUserGender(SexEnum gender)
 {
                 #if UNITY_ANALYTICS_SUPPORTED_PLATFORM
     IUnityAnalyticsSession session = UnityAnalytics.GetSingleton();
     return((AnalyticsResult)session.SetUserGender(gender == SexEnum.M ? "M" : gender == SexEnum.F ? "F" : "U"));
                 #else
     return(AnalyticsResult.UnsupportedPlatform);
                 #endif
 }
Ejemplo n.º 9
0
 public Person()
 {
     Name          = string.Empty;
     LastName      = string.Empty;
     PhoneNumber   = string.Empty;
     Email         = string.Empty;
     Accreditation = AccreditationEnum.Especializada;
     Sex           = SexEnum.Femenino;
 }
		public static AnalyticsResult SetUserGender(SexEnum gender)
		{
			#if UNITY_ANALYTICS_SUPPORTED_PLATFORM
			IUnityAnalyticsSession session = UnityAnalytics.GetSingleton();
			return (AnalyticsResult)session.SetUserGender( gender==SexEnum.M ? "M" : gender==SexEnum.F ? "F" : "U" );
			#else
			return AnalyticsResult.UnsupportedPlatform;
			#endif
		}
Ejemplo n.º 11
0
        internal void Update(CharacterSelectedSuccessMessage packet)
        {
            CharacterBaseInformations message = (CharacterBaseInformations)packet.infos;

            ContextualId = message.id;
            Name         = message.name;
            Breed        = (BreedEnum)message.breed;
            Level        = message.level;
            Sex          = (SexEnum)Convert.ToInt16(message.sex);
        }
Ejemplo n.º 12
0
 public Person(string name, string lastName, string phoneNumber, string email,
               AccreditationEnum accreditation, SexEnum sex)
 {
     Name          = name;
     LastName      = lastName;
     PhoneNumber   = phoneNumber;
     Email         = email;
     Accreditation = accreditation;
     Sex           = sex;
 }
Ejemplo n.º 13
0
        private void button1_Click(object sender, EventArgs e)
        {
            userAuth.SetName(this.textBoxName.Text);
            userAuth.SetSureName(this.textBoxSureName.Text);
            userAuth.SetDateOfBirth(this.dateOfBirthTimePicker.Value);
            SexEnum selectedSex = (((int)SexEnum.Male) == this.plec.SelectedIndex) ? SexEnum.Male : SexEnum.Female;

            userAuth.SetSex(selectedSex);

            DbService.Update <User>(userAuth);
        }
Ejemplo n.º 14
0
        //public UserInformation(string firstName, string lastName, string email = "", SexEnum sex = SexEnum.Null, DateTime? date = null)
        //{
        //    MakeDefaults();

        //    FirstName = firstName;
        //    LastName = lastName;
        //    Email = email;
        //    Sex = sex;
        //    BirthDate = date;
        //}
        public UserInformation(string firstName, string lastName, string email = "", SexEnum sex = SexEnum.Null, DateTime?date = null, string nationalCode = "")
        {
            MakeDefaults();

            FirstName    = firstName;
            LastName     = lastName;
            Email        = email;
            Sex          = sex;
            BirthDate    = date;
            NationalCode = nationalCode;
        }
 public StudentStateMessage(int id, string name, string surname, int age, SexEnum sex,
                            DateTime? enrolementDate, int currentClass)
 {
     StudentId = id;
     Name = name;
     Surname = surname;
     Age = age;
     Sex = sex;
     EnrollmentDate = enrolementDate;
     CurrentClass = currentClass;
 }
Ejemplo n.º 16
0
        // Creates Person
        private Person CreatePerson(string personName, SexEnum sex, List <Book> listOfBooks)
        {
            Person person = new Person()
            {
                PersonName = personName,
                Age        = random.Next(5, 80),
                Sex        = sex,
                Books      = GetRandomBooks(listOfBooks)
            };

            return(person);
        }
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (!(value is SexEnum))
        {
            throw new ArgumentException("value not of type StateValue");
        }
        SexEnum sv = (SexEnum)value;

        //sanity checks
        if (sv == SexEnum.Female)
        {
            return(Brushes.Red);
        }
        return(Brushes.Blue);
    }
Ejemplo n.º 18
0
 public Contact(string name, string surname, string lastname, SexEnum sex, double taxId,
                DateTime birthday)
 {
     if ((name == null) ||
         (surname == null) ||
         (lastname == null) ||
         (taxId == 0))
     {
         throw new NullReferenceException();
     }
     Name     = name;
     Surname  = surname;
     LastName = lastname;
     Sex      = sex;
     Birthday = birthday;
 }
Ejemplo n.º 19
0
        public static string TryToStr(this SexEnum sex)
        {
            string str = "未知";

            switch (sex)
            {
            case SexEnum.Man:
                str = "男";
                break;

            case SexEnum.Woman:
                str = "女";
                break;
            }
            return(str);
        }
Ejemplo n.º 20
0
 /// <summary>
 /// Tworzy nowego użytkownika i umieszcza rekord w bazie danych
 /// </summary>
 public static User createUser(String name, String surname, DateTime birthDate, UserRole role, SexEnum sex, String login, String pass)
 {
     User user = new User();
     List<User> list = SessionFactory.GetNewSession().CreateQuery("from User u WHERE u.login = :login").SetParameter("login", login).List<User>().ToList<User>();
     if (list.Count > 0)
     {
         throw new Exception("User with given login exists");
     }
     user.vlogin = login;
     user.vpassword = EncodePassword(pass);
     user.vRole = role.vid;
     user.vsex = sex;
     user.vname = name;
     user.vSureName = surname;
     user.vDateOfBirth = birthDate;
     return user;
 }
Ejemplo n.º 21
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="subscribe"></param>
 /// <param name="openid"></param>
 /// <param name="nickname"></param>
 /// <param name="sex"></param>
 /// <param name="language"></param>
 /// <param name="city"></param>
 /// <param name="province"></param>
 /// <param name="country"></param>
 /// <param name="headimgurl"></param>
 /// <param name="subscribe_time"></param>
 /// <param name="unionid"></param>
 public UserInfo(bool subscribe, string openid, string nickname, SexEnum sex,
                 LanguageEnum language, string city, string province, string country,
                 string headimgurl, DateTime?subscribe_time, string unionid)
 {
     this.subscribe      = subscribe;
     this.openid         = openid;
     this.nickname       = nickname;
     this.sex            = sex;
     this.language       = language;
     this.city           = city;
     this.province       = province;
     this.country        = country;
     this.headimgurl     = headimgurl;
     this.subscribe_time = subscribe_time;
     this.privilege      = null;
     this.unionid        = unionid;
 }
Ejemplo n.º 22
0
 public static String SexEnumToSex(SexEnum sex)
 {
     if (sex == SexEnum.MALE)
     {
         return("Male");
     }
     else if (sex == SexEnum.FEMALE)
     {
         return("Female");
     }
     else if (sex == SexEnum.NOT_KNOWN)
     {
         return("not known");
     }
     else
     {
         return("NA");
     }
 }
Ejemplo n.º 23
0
        public Contact(string name, string surname, string lastname, SexEnum sex,
                       string phoneNumber, DateTime birthday, double taxId, string post, Organization job)
        {
            if ((name == null) ||
                (surname == null) ||
                (lastname == null) ||
                (taxId == 0))
            {
                throw new NullReferenceException();
            }

            Name        = name;
            Surname     = surname;
            LastName    = lastname;
            Sex         = sex;
            PhoneNumber = phoneNumber;
            Birthday    = birthday;
            TaxId       = taxId;
            Post        = post;
            Job         = job;
        }
Ejemplo n.º 24
0
        private IQueryable <Account> AddSexQuery(IQueryable <Account> accounts, QueryItem queryItem)
        {
            SexEnum sex;

            if (!SexEnum.TryParse(queryItem.Value.ToLower(), out sex))
            {
                throw new Exception($"Wrong value {queryItem.Value}");
            }
            var predicate = queryItem.Predicate ?? Predicate.eq;

            switch (predicate)
            {
            case Predicate.eq:
                return(accounts.Where(a => a.Sex == sex));

            case Predicate.neq:
                return(accounts.Where(a => a.Sex != sex));

            default:
                throw new Exception($"Unsupportend predicate {queryItem.Predicate}");
            }
        }
Ejemplo n.º 25
0
        public static string ToChString(this SexEnum e)
        {
            var result = "";

            switch (e)
            {
            case SexEnum.Male:
                result = "男";
                break;

            case SexEnum.Female:
                result = "女";
                break;

            case SexEnum.Unknown:
                result = "未知";
                break;

            default:
                break;
            }
            return(result);
        }
Ejemplo n.º 26
0
        /// <summary>
        /// Create user and save data to db
        /// </summary>
        /// <param name="name">Name of user</param>
        /// <param name="sex">Sex of user</param>
        /// <returns>Return true if everything is success</returns>
        public async Task <bool> CreateUser(string name, SexEnum sex)
        {
            try
            {
                var user = new User()
                {
                    Nick = name,
                    Sex  = sex
                };

                using (var context = new DefaultContext())
                {
                    context.Add(user);
                    await context.SaveChangesAsync();

                    return(true);
                }
            }
            catch (Exception e)
            {
                return(false);
            }
        }
Ejemplo n.º 27
0
 public static string MapSexEnum(SexEnum v)
 {
     switch (v)
     {
         case SexEnum.Female:
             return "女";
         case SexEnum.Male:
             return "男";
     }
     return "";
 }
Ejemplo n.º 28
0
Archivo: Cat.cs Proyecto: kicata/OPP
 public Cat(string name, int age, SexEnum sex)
     : base(name,age,sex)
 {
 }
Ejemplo n.º 29
0
    /// <summary>
    /// 刷新场景数据
    /// </summary>
    /// <param name="listData"></param>
    public void RefreshSceneData(List <StoryInfoDetailsBean> listData)
    {
        if (listData == null)
        {
            return;
        }
        if (listStoryTextInfo != null)
        {
            listStoryTextInfo.Clear();
        }
        listStoryTextInfo = null;
        foreach (StoryInfoDetailsBean itemData in listData)
        {
            StoryInfoDetailsBean.StoryInfoDetailsTypeEnum storyInfoDetailsType = itemData.GetStoryInfoDetailsType();
            if (storyInfoDetailsType == StoryInfoDetailsBean.StoryInfoDetailsTypeEnum.NpcPosition)
            {
                GameObject objNpc = GetSceneObjByName("character_" + itemData.num);
                BaseNpcAI  npcAI  = null;
                if (objNpc != null)
                {
                    npcAI = objNpc.GetComponent <BaseNpcAI>();
                }

                if (npcAI == null)
                {
                    NpcInfoBean npcInfoBean;
                    if (itemData.npc_id == 0)
                    {
                        npcInfoBean = new NpcInfoBean();
                    }
                    else if (itemData.npc_id == -1)
                    {
                        npcInfoBean = new NpcInfoBean();
                    }
                    else
                    {
                        if (mapNpcInfo.TryGetValue(itemData.npc_id, out NpcInfoBean npcInfo))
                        {
                            npcInfoBean = npcInfo;
                        }
                        else
                        {
                            npcInfoBean = new NpcInfoBean();
                            LogUtil.LogError("创建NPC失败 找不到ID为" + itemData.npc_id + "的NPC信息");
                        }
                    }
                    objNpc = CreateNpc(npcInfoBean.npc_id, new Vector3(itemData.position_x, itemData.position_y), itemData.num);
                    npcAI  = objNpc.GetComponent <BaseNpcAI>();
                }
                npcAI.transform.localPosition = new Vector3(itemData.position_x, itemData.position_y);
                //设置朝向
                npcAI.SetCharacterFace(itemData.face);
            }
            else if (storyInfoDetailsType == StoryInfoDetailsBean.StoryInfoDetailsTypeEnum.NpcEquip)
            {
                GameObject objNpc = GetSceneObjByName("character_" + itemData.num);
                if (objNpc == null)
                {
                    continue;
                }
                BaseNpcAI npcAI = objNpc.GetComponent <BaseNpcAI>();
                if (npcAI == null)
                {
                    continue;
                }
                SexEnum sex = npcAI.characterData.body.GetSex();
                itemData.GetNpcEquip(sex, out long hatId, out long clothesId, out long shoesId);
                if (hatId != -1)
                {
                    npcAI.characterData.equips.hatTFId = hatId;
                }
                if (clothesId != -1)
                {
                    npcAI.characterData.equips.clothesTFId = clothesId;
                }
                if (shoesId != -1)
                {
                    npcAI.characterData.equips.shoesTFId = shoesId;
                }
                npcAI.SetCharacterData(npcAI.characterData);
            }
            else if (storyInfoDetailsType == StoryInfoDetailsBean.StoryInfoDetailsTypeEnum.PropPosition)
            {
                GameObject objProp = GetSceneObjByName("prop_" + itemData.num);
                if (objProp == null)
                {
                    GameObject objModel = StoryInfoHandler.Instance.manager.GetStoryPropModelByName(itemData.key_name);
                    objProp      = Instantiate(objModel, StoryInfoHandler.Instance.builderForStory.transform);
                    objProp.name = "prop_" + itemData.num;
                }
                //设置位置和朝向
                objProp.transform.localPosition = new Vector3(itemData.position_x, itemData.position_y);
                Vector3 bodyScale = objProp.transform.localScale;
                switch (itemData.face)
                {
                case 1:
                    bodyScale.x = -1;
                    break;

                case 2:
                    bodyScale.x = 1;
                    break;
                }
                objProp.transform.localScale = bodyScale;
            }
            //如果是对话 查询对话数据
            else if (storyInfoDetailsType == StoryInfoDetailsBean.StoryInfoDetailsTypeEnum.Talk)
            {
                listStoryTextInfo = textInfoService.QueryDataByMarkId(TextEnum.Story, itemData.text_mark_id);
            }
            else if (storyInfoDetailsType == StoryInfoDetailsBean.StoryInfoDetailsTypeEnum.NpcDestory)
            {
                int[] numList = StringUtil.SplitBySubstringForArrayInt(itemData.npc_destroy, ',');
                foreach (int num in numList)
                {
                    BaseNpcAI npcAI = CptUtil.GetCptInChildrenByName <BaseNpcAI>(StoryInfoHandler.Instance.builderForStory.gameObject, num + "");
                    DestroyImmediate(npcAI.gameObject);
                }
            }
            else if (storyInfoDetailsType == StoryInfoDetailsBean.StoryInfoDetailsTypeEnum.CameraPosition)
            {
                Vector3 cameraWorldPosition = StoryInfoHandler.Instance.builderForStory.transform.TransformPoint(new Vector3(itemData.position_x, itemData.position_y, -10));

                GameCameraHandler.Instance.manager.camera2D.Follow             = null;
                GameCameraHandler.Instance.manager.camera2D.transform.position = cameraWorldPosition;
            }
            else if (itemData.type == (int)StoryInfoDetailsBean.StoryInfoDetailsTypeEnum.CameraFollowCharacter)
            {
                BaseNpcAI npcAI = CptUtil.GetCptInChildrenByName <BaseNpcAI>(StoryInfoHandler.Instance.builderForStory.gameObject, "character_" + itemData.num);
                GameCameraHandler.Instance.manager.camera2D.Follow = npcAI.transform;
            }
        }
    }
Ejemplo n.º 30
0
 public Frog(string name, byte age, SexEnum gender)
     : base(name, age, gender)
 {
 }
Ejemplo n.º 31
0
 private static Person CreatePersona(string name, string lastName, string phoneNumber, string email,
                                     AccreditationEnum accreditation, SexEnum sex)
 {
     return(new Person(name, lastName, phoneNumber, email, accreditation, sex));
 }
Ejemplo n.º 32
0
 public virtual void SetSex(SexEnum sex)
 {
     this.sex = sex;
 }
 protected Animals(int age, string name, SexEnum sex)
 {
     this.Age = age;
     this.Name = name;
     this.sex = sex;
 }
Ejemplo n.º 34
0
 internal vokativDef(string normalend, string vokativend, SexEnum sex)
 {
     this.NormalEnd  = normalend;
     this.VokativEnd = vokativend;
     this.Sex        = sex;
 }
Ejemplo n.º 35
0
 public Animal(string name, byte age, SexEnum gender)
 {
     this.name   = name;
     this.age    = age;
     this.gender = gender;
 }
Ejemplo n.º 36
0
Archivo: Animal.cs Proyecto: kicata/OPP
 public Animal(string name, int age, SexEnum sex)
 {
     this.name = name;
     this.age = age;
     this.sex = sex;
 }
Ejemplo n.º 37
0
 public void SetSex(SexEnum sex)
 {
     throw new System.Exception("Not implemented");
 }
Ejemplo n.º 38
0
 public Cat(string name, byte age, SexEnum sex)
     : base(name, age, sex)
 {
 }
Ejemplo n.º 39
0
 public Dog(string name, byte age, SexEnum sex) : base(name, age, sex)
 {
 }
Ejemplo n.º 40
0
 public static Sex From(SexEnum sexEnum)
 {
     return(new Sex(sexEnum));
 }
Ejemplo n.º 41
0
 public Animal(string name, byte age, SexEnum sex)
 {
     this.Name = name;
     this.Age  = age;
     this.Sex  = sex;
 }
Ejemplo n.º 42
0
        private void Init(int id)
        {
            _id = id;
            _name = "";
            _playerId = 0;
            _sex = SexEnum.Male;
            _level = 1;
            _experience = 0;

            _basicAttack = 0;
            _basicDefense = 0;
            _basicPower = 0;
            _basicKnowledge = 0;

            _attack = 0;
            _defense = 0;
            _power = 0;
            _knowledge = 0;
            _speed = 0;
            _health = 0;

            _maxSpellPoint = 0;
            _spellPointLeft = 0;

            _movementPoint = 0;
            _movementPointLeft = 0;

            _skills = new Hashtable();

            _spells = new Hashtable();
            _spellDmgKEles = new Hashtable();

            _artifacts = new Hashtable();
            _artifactKEquips = new Hashtable();
            _artifactKEquips.Add(Heroes.Core.Heros.EquipPartEnum.LeftHand, new Heroes.Core.Heros.Artifact[1]);
            _artifactKEquips.Add(Heroes.Core.Heros.EquipPartEnum.RightHand, new Heroes.Core.Heros.Artifact[1]);
            _artifactKEquips.Add(Heroes.Core.Heros.EquipPartEnum.Head, new Heroes.Core.Heros.Artifact[1]);
            _artifactKEquips.Add(Heroes.Core.Heros.EquipPartEnum.Torso, new Heroes.Core.Heros.Artifact[1]);
            _artifactKEquips.Add(Heroes.Core.Heros.EquipPartEnum.Ring, new Heroes.Core.Heros.Artifact[2]);
            _artifactKEquips.Add(Heroes.Core.Heros.EquipPartEnum.Neck, new Heroes.Core.Heros.Artifact[1]);
            _artifactKEquips.Add(Heroes.Core.Heros.EquipPartEnum.Shoulder, new Heroes.Core.Heros.Artifact[1]);
            _artifactKEquips.Add(Heroes.Core.Heros.EquipPartEnum.Feet, new Heroes.Core.Heros.Artifact[1]);
            _artifactKEquips.Add(Heroes.Core.Heros.EquipPartEnum.Misc, new Heroes.Core.Heros.Artifact[6]);
            _artifactUnequips = new ArrayList();

            _armyKSlots = new Hashtable();
            _player = null;
        }
Ejemplo n.º 43
0
 //获取NPC装备
 public void GetNpcEquip(SexEnum sex, out long hatId, out long clothesId, out long shoesId)
 {
     hatId     = GetNpcEquip(sex, npc_hat);
     clothesId = GetNpcEquip(sex, npc_clothes);
     shoesId   = GetNpcEquip(sex, npc_shoes);
 }
Ejemplo n.º 44
0
 public Animal(string name, byte age, SexEnum gender)
 {
     this.name = name;
     this.age = age;
     this.gender = gender;
 }
Ejemplo n.º 45
0
        public void CopyFrom(Hero hero)
        {
            this._id = hero._id;
            this._playerId = hero._playerId;
            this._name = hero._name;
            this._description = hero._description;
            this._sex = hero._sex;
            this._heroType = hero._heroType;

            this._basicAttack = hero._basicAttack;
            this._basicDefense = hero._basicDefense;
            this._basicPower = hero._basicPower;
            this._basicKnowledge = hero._basicKnowledge;

            this._attack = hero._attack;
            this._defense = hero._defense;
            this._power = hero._power;
            this._knowledge = hero._knowledge;
            this._speed = hero._speed;
            this._health = hero._health;

            this._experience = hero._experience;
            this._level = hero._level;
            this._maxSpellPoint = hero._maxSpellPoint;
            this._spellPointLeft = hero._spellPointLeft;
            this._infoImgFileName = hero._infoImgFileName;

            this._movementPoint = hero._movementPoint;
            this._movementPointLeft = hero._movementPointLeft;
        }
Ejemplo n.º 46
0
        /// <summary>
        /// Tworzy nowego użytkownika i umieszcza rekord w bazie danych
        /// </summary>
        public static User createUser(String name, String surname, DateTime birthDate, UserRole role, SexEnum sex, String login, String pass)
        {
            User        user = new User();
            List <User> list = SessionFactory.GetNewSession().CreateQuery("from User u WHERE u.login = :login").SetParameter("login", login).List <User>().ToList <User>();

            if (list.Count > 0)
            {
                throw new Exception("User with given login exists");
            }
            user.vlogin       = login;
            user.vpassword    = EncodePassword(pass);
            user.vRole        = role.vid;
            user.vsex         = sex;
            user.vname        = name;
            user.vSureName    = surname;
            user.vDateOfBirth = birthDate;
            return(user);
        }
Ejemplo n.º 47
0
 public Animal(string name, byte age, SexEnum sex)
 {
     this.Name = name;
     this.Age = age;
     this.Sex = sex;
 }
 public Frog(int age, string name, SexEnum sex)
     : base(age, name, sex)
 {
 }