コード例 #1
0
 /// Initialises a new instance of the <see cref="AthleteType"/> class.
 /// </summary>
 /// <param name="key">athlete key</param>
 /// <param name="name">athlete name</param>
 /// <param name="club">athlete club</param>
 /// <param name="sex">athlete sex</param>
 /// <param name="runningNumbers">numbers the athlete is registered to run under</param>
 /// <param name="birthYear">athlete birth year</param>
 /// <param name="birthMonth">athlete birth month</param>
 /// <param name="birthDay">athlete birth dat</param>
 /// <param name="signedConsent">
 /// Indicates whether the parental consent form has been signed.
 /// </param>
 /// <param name="active">indicates whether the athlete is currently active</param>
 /// <param name="predeclaredHandicap">user declared handicap</param>
 public AthleteType(
     int key,
     string name,
     string club,
     SexType sex,
     ObservableCollection <string> runningNumbers,
     string birthYear,
     string birthMonth,
     string birthDay,
     bool signedConsent,
     bool active,
     string predeclaredHandicap)
 {
     Key  = key;
     Name = name;
     Club = club;
     Sex  = sex;
     this.runningNumbers      = runningNumbers;
     this.birthYear           = birthYear;
     this.birthMonth          = birthMonth;
     this.birthDay            = birthDay;
     this.signedConsent       = signedConsent;
     this.active              = active;
     this.predeclaredHandicap = predeclaredHandicap;
 }
コード例 #2
0
 public CreateCharacterCommand(Guid userId, string firstName, string lastName, SexType sex)
 {
     UserId    = userId;
     FirstName = firstName;
     LastName  = lastName;
     Sex       = sex;
 }
コード例 #3
0
        public MerchantSettledApply AddApply(string TelNo, string RealName, SexType Sex)
        {
            if (ct.Set <MerchantSettledApply>().Count(x => x.TelNo == TelNo && x.ApplyState == ApplyState.NotAcceptance) > 0)
            {
                this.ErrorStr = "此手机号码已申请";
                return(null);
            }
            if (string.IsNullOrEmpty(RealName))
            {
                this.ErrorStr = "姓名不能为空";
                return(null);
            }
            var add = new MerchantSettledApply()
            {
                Id         = Guid.NewGuid(),
                ApplyDate  = DateTime.Now,
                ApplyState = ApplyState.NotAcceptance,
                RealName   = RealName,
                Sex        = Sex,
                TelNo      = TelNo
            };

            ct.Set <MerchantSettledApply>().Add(add);
            ct.SaveChanges();
            return(add);
        }
コード例 #4
0
 /// <summary>
 /// Initialises a new instance of the <see cref="Row"/> class.
 /// </summary>
 /// <param name="key">the athlete key</param>
 /// <param name="name">the athlete's name</param>
 /// <param name="club">the athlete's club</param>
 /// <param name="handicap">the athlete's handicap</param>
 /// <param name="notes">relevant notes</param>
 /// <param name="extraInformation">extra information</param>
 /// <param name="order">finishing order</param>
 /// <param name="isPersonalBest">indicates whether this is the athlete's personal best</param>
 /// <param name="isYearBest">indicates whether this is the athlete's year best</param>
 /// <param name="mobTrophyPoints">the athlete's points in the Mob Trophy</param>
 /// <param name="teamTrophyPoints">the athlete's points in the Team Trpophy</param>
 /// <param name="number">the athlete's number</param>
 /// <param name="runningOrder">identifies the postion when sharing times</param>
 /// <param name="time">the athlete's time</param>
 /// <param name="sex">the athlete's sex</param>
 public Row(
     int key,
     string name,
     string club,
     string handicap,
     string notes,
     string extraInformation,
     int order,
     bool isPersonalBest,
     bool isYearBest,
     string mobTrophyPoints,
     int teamTrophyPoints,
     string number,
     int runningOrder,
     string time,
     SexType sex)
 {
     this.key              = key;
     this.name             = name;
     this.club             = club;
     this.handicap         = handicap;
     this.notes            = notes;
     this.extraInformation = extraInformation;
     this.order            = order;
     this.personalBest     = isPersonalBest;
     this.yearBest         = isYearBest;
     this.mobTrophypoints  = mobTrophyPoints;
     this.teamTrophyPoints = teamTrophyPoints;
     this.number           = number;
     this.runningOrder     = runningOrder;
     this.time             = time;
     this.sex              = sex;
 }
コード例 #5
0
        /// <summary>
        ///   Creates a new instance of the AthleteDetails class
        /// </summary>
        /// <param name="key">unique key</param>
        /// <param name="name">athlete's name</param>
        /// <param name="club">athlete's club</param>
        /// <param name="roundedHandicap">rounded handicap</param>
        /// <param name="sex">athlete's sex</param>
        /// <param name="birthYear">birth year, no longer recorded</param>
        /// <param name="birthMonth">birth month, no longer recorded</param>
        /// <param name="birthDay">birth day, no longer recorded</param>
        /// <param name="signedConsent">
        /// indicates whether the parental consent form has been signed
        /// </param>
        /// <param name="active">active</param>
        /// <param name="normalisationConfigManager">normalisation config manager</param>
        public AthleteDetails(
            int key,
            string name,
            string club,
            TimeType roundedHandicap,
            SexType sex,
            string birthYear,
            string birthMonth,
            string birthDay,
            bool signedConsent,
            bool active,
            INormalisationConfigMngr normalisationConfigManager)
        {
            this.Key  = key;
            this.Name = name;
            this.Club = club;
            this.PredeclaredHandicap = roundedHandicap;
            this.Sex           = sex;
            this.SignedConsent = signedConsent;
            this.Active        = active;

            this.RunningNumbers = new List <string>();
            this.Times          = new List <Appearances>();

            this.BirthDate =
                new DateOfBirth(
                    birthYear,
                    birthMonth,
                    birthDay);

            this.normalisationConfigMngr = normalisationConfigManager;
        }
コード例 #6
0
ファイル: Human.cs プロジェクト: EslSuwen/Feat
 internal Human()
 {
     this.Name = "";
     this.ID   = "";
     this.age  = 20;
     this.Sex  = SexType.未知;
 }
コード例 #7
0
ファイル: Body.cs プロジェクト: JoelPlourde/Shore-Squad
        // TODO TEST THIS.
        /// <summary>
        /// Change the sex of this Actor.
        /// </summary>
        /// <param name="sexType">The sex type.</param>
        public void ChangeSex(SexType sexType)
        {
            SexType = sexType;

            // TODO check if the Actor is wearing anything on its chest first. If not, show = true.
            DisplayBodyParts(SlotType.BODY, true);
        }
コード例 #8
0
 /// <summary>
 /// Create a new athlete and add it to the athlete list.
 /// </summary>
 /// <param name="athleteName">name of the athlete</param>
 /// <param name="club">athlete's club</param>
 /// <param name="initialHandicapMinutes">initial handicap (minutes)</param>
 /// <param name="initialHandicapSeconds">initial handicap (seconds)</param>
 /// <param name="sex">athlete's sex</param>
 /// <param name="runningNumbers">collection of registed running numbers</param>
 /// <param name="birthYear">birth year, not used</param>
 /// <param name="birthMonth">birth month, not used</param>
 /// <param name="birthDay">birth day, not used</param>
 /// <param name="signedConsent">
 /// Indicates whether the parental consent form has been signed.
 /// </param>
 /// <param name="active">Indicates whether the athlete is currently active</param>
 public void CreateNewAthlete(
     string athleteName,
     string club,
     int initialHandicapMinutes,
     int initialHandicapSeconds,
     SexType sex,
     List <string> runningNumbers,
     string birthYear,
     string birthMonth,
     string birthDay,
     bool signedConsent,
     bool active)
 {
     Athletes.SetNewAthlete(
         new AthleteDetails(
             Athletes.NextKey,
             athleteName,
             club,
             new TimeType(initialHandicapMinutes, initialHandicapSeconds),
             sex,
             birthYear,
             birthMonth,
             birthDay,
             signedConsent,
             active,
             this.normalisationConfigurationManager)
     {
         RunningNumbers = runningNumbers
     });
 }
コード例 #9
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.NavigationMode == NavigationMode.Back)
            {
                return;
            }

            SystemTray.IsVisible = true;
            if (NavigationContext.QueryString.ContainsKey("editprofile"))
            {
                editProfile = true;
            }

            Message = "Generate a random cartoon:";

            using (var db = new GrimacizerContext(GrimacizerContext.ConnectionString))
            {
                var settings = db.Settings.FirstOrDefault();
                width  = settings.DefaultImagePixelWidth;
                height = settings.DefaultImagePixelHeight;
                _sex   = settings.Sex;
                _race  = settings.Race;
            }

            ImageSource = LocalImagesHelper.ReadImageFromIsolatedStorage(Constants.DEFAULT_FACE_PHOTO, width, height);
            GenerateRandomCartoon();
        }
コード例 #10
0
        public async Task <QiestionStatisticUsersDto> GetQuestionStatistiсUsers(int userId, int questionId, int minAge, int maxAge,
                                                                                SexType sexType, string city, int offset, int count)
        {
            var cityId = city.IsNullOrEmpty() ? -1 : _db.CityEntities.FirstOrDefault(x => x.Name == city)?.CityId ?? -1;

            var minDate = minAge.WhenBorned();
            var maxDate = maxAge.WhenBorned();

            Expression <Func <Tuple <UserInfoEntity, AnswerEntity>, bool> > predicate =
                x => x.Item1.BirthDate <= minDate && x.Item1.BirthDate >= maxDate &&
                (sexType == SexType.Both || x.Item1.SexType == sexType) && (cityId <= 0 || x.Item1.CityId == cityId);

            if (!_db.QuestionEntities.Any(x => x.QuestionId == questionId))
            {
                throw new NotFoundException("We do not have this question");
            }

            var voters = await _db.AnswerEntities.Where(x => x.QuestionId == questionId)
                         .Join(_db.UserInfoEntities, a => a.UserId, u => u.UserId, (a, u) => new Tuple <UserInfoEntity, AnswerEntity>(u, a))
                         .Where(predicate)
                         .Join(_db.CityEntities, uc => uc.Item1.CityId, c => c.CityId, (f, s) => new { f, s, isYouFollowed = _db.FollowingEntities.Any(x => x.UserId == userId && x.FollowingId == f.Item1.UserId), isHeFollowed = _db.FollowingEntities.Any(x => x.UserId == f.Item1.UserId && x.FollowingId == userId) })
                         .OrderByDescending(x => x.f.Item2.AnsweredDate).Skip(offset).Take(count).ToListAsync();

            var firstUsers  = new List <VoterUserDto>();
            var secondUsers = new List <VoterUserDto>();

            foreach (var voter in voters)
            {
                var user = new VoterUserDto
                {
                    UserId        = voter.f.Item1.UserId,
                    Age           = voter.f.Item1.BirthDate.Age(),
                    IsHeFollowed  = voter.isHeFollowed,
                    IsYouFollowed = voter.isYouFollowed,
                    City          = voter.s.Name,
                    FirstName     = voter.f.Item1.FirstName,
                    LastName      = voter.f.Item1.LastName,
                    SexType       = voter.f.Item1.SexType,

                    OriginalAvatarUrl = voter.f.Item1.OriginalAvatarUrl
                };

                switch (voter.f.Item2.AnswerType)
                {
                case AnswerType.First:
                    firstUsers.Add(user);
                    break;

                case AnswerType.Second:
                    secondUsers.Add(user);
                    break;
                }
            }

            return(new QiestionStatisticUsersDto {
                Voters = new List <List <VoterUserDto> > {
                    firstUsers, secondUsers
                }
            });
        }
コード例 #11
0
        public IActionResult SetSex([FromQuery(Name = "type")] SexType sexType)
        {
            if (sexType == SexType.Not)
            {
                return(Json(new BaseResponse
                {
                    Status = false,
                    Message = "type не должен быть 0"
                }));
            }

            var user = dbContext.Users
                       .Include(x => x.Person)
                       .FirstOrDefault(x => x.Login == User.Identity.Name);

            if (user == null)
            {
                return(Json(new BaseResponse
                {
                    Status = false,
                    Message = "User not found"
                }));
            }

            user.Person.Sex = sexType;
            dbContext.SaveChanges();

            return(Json(new BaseResponse()));
        }
コード例 #12
0
 public Hesap(System.String pid, string pip, string padi, string psoyadi, string pmail, string psifre, string proller, string ponaykodu, DateTime pdogumtarihi, DateTime pkayittarihi, byte pcinsiyet, byte ptipi, bool pyorum, bool pabonelik, bool paktivasyon, bool paktif, bool isprofilobject)
 {
     this.m_ID          = pid;
     this.m_IP          = pip;
     this.m_Adi         = padi;
     this.m_Soyadi      = psoyadi;
     this.m_Mail        = pmail;
     this.m_Sifre       = psifre;
     this.m_Roller      = proller;
     this.m_OnayKodu    = ponaykodu;
     this.m_DogumTarihi = pdogumtarihi;
     this.m_KayitTarihi = pkayittarihi;
     this.m_Cinsiyet    = Core.GetSexType(pcinsiyet);
     this.m_Tipi        = Core.GetAccountType(ptipi);
     this.m_Yorum       = pyorum;
     this.m_Abonelik    = pabonelik;
     this.m_Aktivasyon  = paktivasyon;
     this.m_Aktif       = paktif;
     switch (isprofilobject)
     {
     case true:
         this.m_ProfilObject = ProfilMethods.GetProfil(this.m_ID);
         break;
     }
 }
コード例 #13
0
ファイル: clsClass.cs プロジェクト: EslSuwen/Feat
        /// <summary>
        /// 增加学生
        /// </summary>
        /// <param name="name">姓名</param>
        /// <param name="id">ID</param>
        /// <param name="age">年龄</param>
        /// <param name="sex">性别</param>
        /// <param name="chinese">语文成绩</param>
        /// <param name="math">数学成绩</param>
        /// <param name="english">英语成绩</param>
        /// <param name="computer">计算机成绩</param>
        /// <returns>成功:true;失败:false</returns>
        internal bool AddStudent(string name, string id, int age, SexType sex,
                                 double chinese, double math, double english, double computer)
        {
            Student pobj = new Student(name, id, age, sex, chinese, english, math, computer);

            return(AddStudent(pobj));
        }
コード例 #14
0
ファイル: Human.cs プロジェクト: EslSuwen/Feat
 internal Human(string name, string id, int age, SexType sex)
 {
     this.Name = name;
     this.ID   = id;
     this.Age  = age;
     this.Sex  = sex;
 }
コード例 #15
0
ファイル: Person.cs プロジェクト: bwosh/csharpqa
 public Person(int age, string name, SexType sex, float weight)
 {
     Age    = age;
     Name   = name;
     Sex    = sex;
     Weight = weight;
 }
コード例 #16
0
        /// <summary>
        /// Updates or creates a resource based on the resource identifier. The PUT operation is used to update or create a resource by identifier.  If the resource doesn't exist, the resource will be created using that identifier.  Additionally, natural key values cannot be changed using this operation, and will not be modified in the database.  If the resource &quot;id&quot; is provided in the JSON body, it will be ignored as well.
        /// </summary>
        /// <param name="id">A resource identifier specifying the resource to be updated.</param>
        /// <param name="IfMatch">The ETag header value used to prevent the PUT from updating a resource modified by another consumer.</param>
        /// <param name="body">The JSON representation of the &quot;sexType&quot; resource to be updated.</param>
        /// <returns>A RestSharp <see cref="IRestResponse"/> instance containing the API response details.</returns>
        public IRestResponse PutSexType(string id, string IfMatch, SexType body)
        {
            var request = new RestRequest("/sexTypes/{id}", Method.PUT);

            request.RequestFormat = DataFormat.Json;

            request.AddUrlSegment("id", id);
            // verify required params are set
            if (id == null || body == null)
            {
                throw new ArgumentException("API method call is missing required parameters");
            }
            request.AddHeader("If-Match", IfMatch);
            request.AddBody(body);
            request.Parameters.First(param => param.Type == ParameterType.RequestBody).Name = "application/json";
            var response = client.Execute(request);

            var location = response.Headers.FirstOrDefault(x => x.Name == "Location");

            if (location != null && !string.IsNullOrWhiteSpace(location.Value.ToString()))
            {
                body.id = location.Value.ToString().Split('/').Last();
            }
            return(response);
        }
コード例 #17
0
 /// <summary>
 /// Create a new entry in the results table.
 /// </summary>
 /// <param name="name">Athlete's name</param>
 /// <param name="time">Total time</param>
 /// <param name="handicap">handicap for event</param>
 /// <param name="club">Athlete's club</param>
 /// <param name="raceNumber">Number used in event</param>
 /// <param name="date">event date</param>
 /// <param name="age">age of the athlete</param>
 /// <param name="position">the position of the current entry</param>
 /// <param name="teamTrophyPoints">points associated with the Team Trophy</param>
 public ResultsTableEntry(
     int key,
     string name,
     RaceTimeType time,
     int order,
     RaceTimeType handicap,
     string club,
     SexType sex,
     string raceNumber,
     DateType date,
     int?age,
     int position,
     int teamTrophyPoints)
 {
     this.Key              = key;
     this.Club             = club;
     this.Handicap         = handicap;
     this.Name             = name;
     this.Order            = order;
     this.Points           = new CommonPoints(date);
     this.TeamTrophyPoints = teamTrophyPoints;
     this.RaceNumber       = raceNumber;
     this.Sex              = sex;
     this.Time             = time;
     this.Position         = position;
     this.ExtraInfo        = string.Empty;
 }
コード例 #18
0
 public Admin(SqlConnection conn,
              int id,
              string name  = "",
              SexType sex  = SexType.Unknown,
              string phone = "") : base(conn, id, name, sex, phone)
 {
 }
コード例 #19
0
        /// <summary>
        /// Update all the number statistics.
        /// </summary>
        /// <param name="sex">athlete sex</param>
        /// <param name="firstTimer">indicates if the athlete is a first timer</param>
        private void ReduceNumberStatistics(
            SexType sex,
            bool firstTimer)
        {
            this.Model.CurrentEvent.Summary.UpdateSummary(
                sex == SexType.Male ? this.Model.CurrentEvent.Summary.MaleRunners - 1 : this.Model.CurrentEvent.Summary.MaleRunners,
                sex == SexType.Female ? this.Model.CurrentEvent.Summary.FemaleRunners - 1 : this.Model.CurrentEvent.Summary.FemaleRunners,
                this.Model.CurrentEvent.Summary.SBs,
                this.Model.CurrentEvent.Summary.PBs,
                firstTimer ? this.Model.CurrentEvent.Summary.FirstTimers - 1 : this.Model.CurrentEvent.Summary.FirstTimers);

            this.Model.CurrentSeason.Summary.UpdateSummary(
                sex == SexType.Male ? this.Model.CurrentSeason.Summary.MaleRunners - 1 : this.Model.CurrentSeason.Summary.MaleRunners,
                sex == SexType.Female ? this.Model.CurrentSeason.Summary.FemaleRunners - 1 : this.Model.CurrentSeason.Summary.FemaleRunners,
                this.Model.CurrentSeason.Summary.SBs,
                this.Model.CurrentSeason.Summary.PBs,
                firstTimer ? this.Model.CurrentSeason.Summary.FirstTimers - 1 : this.Model.CurrentSeason.Summary.FirstTimers);

            this.Model.GlobalSummary.UpdateSummary(
                sex == SexType.Male ? this.Model.GlobalSummary.MaleRunners - 1 : this.Model.GlobalSummary.MaleRunners,
                sex == SexType.Female ? this.Model.GlobalSummary.FemaleRunners - 1 : this.Model.GlobalSummary.FemaleRunners,
                this.Model.GlobalSummary.SBs,
                this.Model.GlobalSummary.PBs,
                firstTimer ? this.Model.GlobalSummary.FirstTimers - 1 : this.Model.GlobalSummary.FirstTimers);
        }
コード例 #20
0
ファイル: frmModifyStudent.cs プロジェクト: EslSuwen/Feat
        /// <summary>
        /// 初始化窗体控件里的值
        /// </summary>
        private void InitForm()
        {
            foreach (Department p in pData.DepList)
            {
                combDepartment.Items.Add(p.Name);
            }
            combDepartment.Text          = OldDepName;
            combClass.Text               = this.OldClassName;
            txtStudentName.Text          = this.StuObj.Name;
            this.txtStudentID.Text       = StuObj.ID;
            this.numericStudentAge.Value = StuObj.Age;
            switch (StuObj.Sex)
            {
            case SexType.男:
                this.radioBtnMale.Checked = true;
                this.sex = SexType.男;
                break;

            case SexType.女:
                this.radioBtnFemale.Checked = true;
                this.sex = SexType.女;
                break;

            case SexType.未知:
                this.radioBtnUnkown.Checked = true;
                this.sex = SexType.未知;
                break;
            }
            this.txtStudentChinese.Text  = StuObj.Chinese.ToString();
            this.txtStudentEnglish.Text  = StuObj.English.ToString();
            this.txtStudentComputer.Text = StuObj.Computer.ToString();
            this.txtStudentMath.Text     = StuObj.Math.ToString();
        }
コード例 #21
0
ファイル: Person.cs プロジェクト: davidbedok/oeprog1
 public Person(string name, int cardNumber, SexType sexType, int numberOfMatchStick)
 {
     this.name = name;
     this.cardNumber = cardNumber;
     this.sexType = sexType;
     this.numberOfMatchStick = numberOfMatchStick;
 }
コード例 #22
0
        public static int Register(
            string password,
            string name,
            string college,
            SexType sex,
            string phone)
        {
            if (password == null)
                throw new ArgumentNullException(nameof(password));
            if (name == null)
                throw new ArgumentNullException(nameof(name));
            if (college == null)
                throw new ArgumentNullException(nameof(college));

            using (var conn = SqlHelper.OpenDatabase(
                BLLConfig.AdminUserName,
                BLLConfig.AdminPassword,
                BLLConfig.DefaultSource,
                BLLConfig.DbName))
            {
                var cmd = @"INSERT INTO StudentAccount (password,name,college,sex,phone) OUTPUT Inserted.id VALUES (@pw,@n,@c,@s,@p)";
                var result = SqlHelper.ExecuteScalar(conn, cmd, new SqlParameter[] {
                    new SqlParameter("@pw", SqlDbType.NVarChar, 50) { Value = Utilities.EncryptPassword(password) },
                    new SqlParameter("@n", SqlDbType.NVarChar, 50) { Value = name },
                    new SqlParameter("@c", SqlDbType.NVarChar, 50) { Value = college },
                    new SqlParameter("@s", SqlDbType.Int) { Value = (int)sex },
                    new SqlParameter("@p", SqlDbType.NVarChar, 50) { Value = phone }
                });
                return result != null ? (int)result : -1;
            }
        }
コード例 #23
0
 public Aspirant(string name, int age, SexType sex, string faculty, string diplomWork)
 {
     Name       = name;
     Age        = age;
     Sex        = sex;
     Faculty    = faculty;
     DiplomWork = diplomWork;
 }
コード例 #24
0
 internal Student(string name, string id, int age, SexType sex,
                  double chinese, double english, double math, double computer) : base(name, id, age, sex)
 {
     this.Chinese  = chinese;
     this.English  = english;
     this.Computer = computer;
     this.Math     = math;
 }
コード例 #25
0
ファイル: Kitten.cs プロジェクト: JivkoKostadinov/OOP-CSharp
 public Kitten(int age, string name, SexType sex)
     : base(age, name, sex)
 {
     if (sex != SexType.Female)
     {
         throw new ArgumentException("Kittens can only be female");
     }
 }
コード例 #26
0
 /// <summary>
 /// 带参数的构造函数
 /// </summary>
 /// <param name="name">姓名</param>
 /// <param name="age">年龄</param>
 /// <param name="sex">性别</param>
 /// <param name="height">身高</param>
 /// <param name="weight">体重</param>
 public Student(string name, int age, SexType sex, double height, double weight)
 {
     Name   = name;
     Sex    = sex;
     Age    = age;
     Height = height;
     Weight = weight;
 }
コード例 #27
0
 /// <summary>
 /// 不带参数构造函数
 /// </summary>
 public Student()
 {
     Name   = "";
     Sex    = SexType.未知;
     Age    = 20;
     Height = 165.0;
     Weight = 65.0;
 }
コード例 #28
0
 public Manager(string name, int age, SexType sex, string position, int salary)
 {
     Name     = name;
     Age      = age;
     Sex      = sex;
     Position = position;
     Salary   = salary;
 }
コード例 #29
0
 protected User(SqlConnection conn, int id, string name, SexType sex, string phone)
 {
     Connection = conn;
     Id         = id;
     Name       = name;
     Sex        = sex;
     Phone      = phone;
 }
コード例 #30
0
ファイル: Tomcat.cs プロジェクト: apomarinov/Telerik-Academy
 public Tomcat(int age, string name, SexType sex)
     : base(age, name, sex)
 {
     if (sex != SexType.Male)
     {
         throw new ArgumentException("Tomcats can only be male");
     }
 }
コード例 #31
0
ファイル: People.cs プロジェクト: davidbedok/oeprog1
 public Person getRelevantParent(Person actPerson, SexType sexType)
 {
     Person iPerson = null;
     do
     {
         iPerson = this.people[rand.Next(0, People.N)];
     } while ((iPerson.Equals(actPerson)) || (!iPerson.SexType.Equals(sexType)));
     return iPerson;
 }
コード例 #32
0
ファイル: TradeController.cs プロジェクト: yxandam/BabyPlan
 //
 // GET: /Trade/
 public ActionResult List(ItemType category, ItemSort sort, SexType sex, PriceRange range, int age)
 {
     ViewBag.ItemType   = category;
     ViewBag.ItemSort   = sort;
     ViewBag.SexType    = sex;
     ViewBag.Age        = age;
     ViewBag.PriceRange = range;
     return(View("~/Views/Trade/Index.cshtml", GetGoods(0, 20, category, sort, range, sex, age).Data));
 }
コード例 #33
0
ファイル: User.cs プロジェクト: Appacts/appacts-sdk-wp7
 /// <summary>
 /// Initializes a new instance of the <see cref="User"/> class.
 /// </summary>
 /// <param name="age">The age.</param>
 /// <param name="sexType">Type of the sex.</param>
 /// <param name="statusType">Type of the status.</param>
 /// <param name="applicationId">The application id.</param>
 /// <param name="version">The version.</param>
 public User(int age, SexType sexType,
     StatusType statusType, Guid applicationId, Guid sessionId, String version)
 {
     this.ApplicationId = applicationId;
     this.Version = version;
     this.Age = age;
     this.Sex = sexType;
     this.Status = statusType;
     this.DateCreated = DateTime.Now;
     this.SessionId = sessionId;
 }
コード例 #34
0
ファイル: People.cs プロジェクト: davidbedok/oeprog1
 public int getAllNumberOfMatchStick(SexType sexType)
 {
     int ret = 0;
     for (int i = 0; i < People.N; i++)
     {
         if (people[i].SexType.Equals(sexType))
         {
             ret += people[i].NumberOfMatchStick;
         }
     }
     return ret;
 }
コード例 #35
0
 private UserInformation(string roomLabel, int roomSeatNo,
     int age, SexType sex, int prefecture, string nickname,
     bool premium, int userId, bool join)
 {
     this.age = age;
     this.join = join;
     this.nickname = nickname;
     this.prefecture = prefecture;
     this.premium = premium;
     this.roomLabel = roomLabel;
     this.roomSeatNo = roomSeatNo;
     this.sex = sex;
 }
コード例 #36
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.NavigationMode == NavigationMode.Back)
                return;

            SystemTray.IsVisible = true;
            if (NavigationContext.QueryString.ContainsKey("editprofile"))
                editProfile = true;

            Message = "Generate a random cartoon:";

            using (var db = new GrimacizerContext(GrimacizerContext.ConnectionString))
            {
                var settings = db.Settings.FirstOrDefault();
                width = settings.DefaultImagePixelWidth;
                height = settings.DefaultImagePixelHeight;
                _sex = settings.Sex;
                _race = settings.Race;
            }

            ImageSource = LocalImagesHelper.ReadImageFromIsolatedStorage(Constants.DEFAULT_FACE_PHOTO, width, height);
            GenerateRandomCartoon();
        }
コード例 #37
0
ファイル: Cat.cs プロジェクト: deskuuu/TelerikAcademy
 public Cat(int age, string name, SexType sex)
     : base(age, name, sex)
 {
 }
コード例 #38
0
ファイル: Kitten.cs プロジェクト: tvmarinov/Homework
 public Kitten(string name, int age, SexType sex)
     : base(name, age, sex)
 {
 }
コード例 #39
0
ファイル: Analytics.cs プロジェクト: Appacts/appacts-sdk-wp7
        /// <summary>
        /// Sets the user information.
        /// </summary>
        /// <param name="age">The age.</param>
        /// <param name="sexType">Type of the sex.</param>
        public void SetUserInformation(int age, SexType sexType)
        {
            try
            {
                User user = new User(age, sexType, StatusType.Pending, this.applicationId, this.sessionId, this.applicationVersion);
                this.iStorageDal.Save(user);

                this.setItemsWaitingToBeUploaded();
                if (this.uploadType == UploadType.WhileUsingAsync)
                {
                    this.uploadIntelligent();
                }
            }
            catch (ExceptionDatabaseLayer ex)
            {
                this.logSystemError(ex);
                throw ex;
            }
        }
コード例 #40
0
ファイル: Cat.cs プロジェクト: K-Iliev/OOP-C-Sharp
 public Cat(string name, int age,SexType sex)
     : base(name, age,sex)
 {
 }
コード例 #41
0
ファイル: Animal.cs プロジェクト: deskuuu/TelerikAcademy
 public Animal(int age, string name, SexType sex)
 {
     this.Age = age;
     this.Name = name;
     this.Sex = sex;
 }
コード例 #42
0
ファイル: Out.ascx.cs プロジェクト: davelondon/dontstayin
		string sexString(SexType sex)
		{
			switch (sex)
			{
				case SexType.All: return "all";
				case SexType.Boys: return "boys";
				case SexType.Girls: return "girls";
				default: return "";
			}
		}
コード例 #43
0
ファイル: Out.ascx.cs プロジェクト: davelondon/dontstayin
		public string GetUrl(SexType sex, LocationType location, int usrK)
		{
			return "/pages/out" +
				(sex != SexType.NoneSpecified ? ("/" + sexString(sex)) : "") +
				(location != LocationType.NoneSpecified ? ("/" + locationString(location)) : "") +
				(usrK > 0 ? ("/" + usrK.ToString()) : "");

		}
コード例 #44
0
 public void User(SexType sexType, int age)
 {
     deviceService.Log
         (
             new AppUser()
             {
                 ApplicationId = applicationId,
                 DeviceId = this.DeviceId,
                 Age = age,
                 Sex = sexType,
                 SessionId = Guid.NewGuid(),
                 DateCreated = DateCreated,
                 Date = DateCreated.Date,
                 DateCreatedOnDevice = DateCreated
             }
         );
 }