Inheritance: MonoBehaviour
Exemplo n.º 1
0
 public void InsertBirthday(Birthday birthday)
 {
     Document.Root.Add(
         new XElement("birthdate",
             new XElement("name", birthday.Name),
             new XElement("date", birthday.Birthdate)));
 }
Exemplo n.º 2
0
 public Person()
 {
     this.birthday = new Birthday();
     this.contactInformation = new ContactInformation();
     this.name = new PersonalName();
     this.healthInformation = new HealthInformation();
 }
Exemplo n.º 3
0
 // END CUT HERE
 // BEGIN CUT HERE
 public static void Main()
 {
     try {
     Birthday ___test = new Birthday();
     ___test.run_test(-1);
     } catch(Exception e) {
     //Console.WriteLine(e.StackTrace);
     Console.WriteLine(e.ToString());
     }
 }
Exemplo n.º 4
0
 public override string ToString()
 {
     return($"{FirstName} {LastName} {Username} {Country} {Birthday.ToString("dd-MMM-yyyy")} {Sex} {Password}");
 }
Exemplo n.º 5
0
 public override int GetHashCode()
 {
     return(Name.GetHashCode() + Breed.GetHashCode() + Birthday.GetHashCode());
 }
Exemplo n.º 6
0
 public override string ToString() => $"\nId: {Id}" +
 $"\nName: {Name}" +
 $"\nBirthday: {Birthday.ToString("MM/dd/yyyy")}" +
 $"\nScore: {Score}";
Exemplo n.º 7
0
 public override string ToString()
 {
     return($"{ID} {Name} {Birthday?.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)}");
 }
Exemplo n.º 8
0
 public void BirtdayFailParseTest(string birthdayString)
 {
     Assert.Throws <FormatException>(() => Birthday.Parse(birthdayString))
     .Message.Should().Be("Expected dd.mm.yyyy or dd.mm");
 }
Exemplo n.º 9
0
 public override string ToString()
 {
     return($"{ConverGenderTo()},  {FirstName}, {LastName}, {Birthday.ToString("dd/MMM/yyyy", new CultureInfo("en-GB"))}");
 }
Exemplo n.º 10
0
        public static AstrologicalSign GetSign(Birthday testDay)
        {
            switch (testDay.Month)
            {
            case 1:
                if (testDay.Day <= 20)
                {
                    return(AstrologicalSign.Capricorn);
                }
                else
                {
                    return(AstrologicalSign.Aquarius);
                }

            case 2:
                if (testDay.Day <= 18)
                {
                    return(AstrologicalSign.Aquarius);
                }
                else
                {
                    return(AstrologicalSign.Pisces);
                }

            case 3:
                if (testDay.Day <= 20)
                {
                    return(AstrologicalSign.Pisces);
                }
                else
                {
                    return(AstrologicalSign.Aries);
                }

            case 4:
                if (testDay.Day <= 20)
                {
                    return(AstrologicalSign.Aries);
                }
                else
                {
                    return(AstrologicalSign.Taurus);
                }

            case 5:
                if (testDay.Day <= 21)
                {
                    return(AstrologicalSign.Taurus);
                }
                else
                {
                    return(AstrologicalSign.Gemini);
                }

            case 6:
                if (testDay.Day <= 21)
                {
                    return(AstrologicalSign.Gemini);
                }
                else
                {
                    return(AstrologicalSign.Cancer);
                }

            case 7:
                if (testDay.Day <= 23)
                {
                    return(AstrologicalSign.Cancer);
                }
                else
                {
                    return(AstrologicalSign.Leo);
                }

            case 8:
                if (testDay.Day <= 23)
                {
                    return(AstrologicalSign.Leo);
                }
                else
                {
                    return(AstrologicalSign.Virgo);
                }

            case 9:
                if (testDay.Day <= 23)
                {
                    return(AstrologicalSign.Virgo);
                }
                else
                {
                    return(AstrologicalSign.Libra);
                }

            case 10:
                if (testDay.Day <= 23)
                {
                    return(AstrologicalSign.Libra);
                }
                else
                {
                    return(AstrologicalSign.Scorpio);
                }

            case 11:
                if (testDay.Day <= 22)
                {
                    return(AstrologicalSign.Scorpio);
                }
                else
                {
                    return(AstrologicalSign.Sagittarius);
                }

            case 12:
                if (testDay.Day <= 22)
                {
                    return(AstrologicalSign.Sagittarius);
                }
                else
                {
                    return(AstrologicalSign.Capricorn);
                }

            default:
                return(AstrologicalSign.Error);
            }
        }
Exemplo n.º 11
0
 public override string ToString()
 => $"{FullName} {Birthday.ToShortDateString()}";
Exemplo n.º 12
0
        public static Chemistry PredictChemistry(Birthday leaderBirthday, Birthday playerBirthday)
        {
            AstrologicalSign leaderSign = GetSign(leaderBirthday);
            AstrologicalSign playerSign = GetSign(playerBirthday);

            switch (leaderSign)
            {
            case AstrologicalSign.Aquarius:
                if (playerSign == AstrologicalSign.Libra || playerSign == AstrologicalSign.Capricorn)
                {
                    return(Chemistry.Affinity);
                }
                else if (playerSign == AstrologicalSign.Aries)
                {
                    return(Chemistry.Conflict);
                }
                else
                {
                    return(Chemistry.Neutral);
                }

            case AstrologicalSign.Aries:
                if (playerSign == AstrologicalSign.Scorpio || playerSign == AstrologicalSign.Gemini)
                {
                    return(Chemistry.Affinity);
                }
                else if (playerSign == AstrologicalSign.Aquarius)
                {
                    return(Chemistry.Conflict);
                }
                else
                {
                    return(Chemistry.Neutral);
                }

            case AstrologicalSign.Cancer:
                if (playerSign == AstrologicalSign.Pisces || playerSign == AstrologicalSign.Taurus)
                {
                    return(Chemistry.Affinity);
                }
                else if (playerSign == AstrologicalSign.Sagittarius)
                {
                    return(Chemistry.Conflict);
                }
                else
                {
                    return(Chemistry.Neutral);
                }

            case AstrologicalSign.Capricorn:
                if (playerSign == AstrologicalSign.Libra || playerSign == AstrologicalSign.Aquarius)
                {
                    return(Chemistry.Affinity);
                }
                else if (playerSign == AstrologicalSign.Leo)
                {
                    return(Chemistry.Conflict);
                }
                else
                {
                    return(Chemistry.Neutral);
                }

            case AstrologicalSign.Error:
                return(Chemistry.Neutral);

            case AstrologicalSign.Gemini:
                if (playerSign == AstrologicalSign.Scorpio || playerSign == AstrologicalSign.Aries)
                {
                    return(Chemistry.Affinity);
                }
                else if (playerSign == AstrologicalSign.Virgo)
                {
                    return(Chemistry.Conflict);
                }
                else
                {
                    return(Chemistry.Neutral);
                }

            case AstrologicalSign.Leo:
                if (playerSign == AstrologicalSign.Virgo || playerSign == AstrologicalSign.Sagittarius)
                {
                    return(Chemistry.Affinity);
                }
                else if (playerSign == AstrologicalSign.Capricorn)
                {
                    return(Chemistry.Conflict);
                }
                else
                {
                    return(Chemistry.Neutral);
                }

            case AstrologicalSign.Libra:
                if (playerSign == AstrologicalSign.Aquarius || playerSign == AstrologicalSign.Capricorn)
                {
                    return(Chemistry.Affinity);
                }
                else if (playerSign == AstrologicalSign.Taurus)
                {
                    return(Chemistry.Conflict);
                }
                else
                {
                    return(Chemistry.Neutral);
                }

            case AstrologicalSign.Pisces:
                if (playerSign == AstrologicalSign.Taurus || playerSign == AstrologicalSign.Cancer)
                {
                    return(Chemistry.Affinity);
                }
                else if (playerSign == AstrologicalSign.Scorpio)
                {
                    return(Chemistry.Conflict);
                }
                else
                {
                    return(Chemistry.Neutral);
                }

            case AstrologicalSign.Sagittarius:
                if (playerSign == AstrologicalSign.Leo || playerSign == AstrologicalSign.Virgo)
                {
                    return(Chemistry.Affinity);
                }
                else if (playerSign == AstrologicalSign.Cancer)
                {
                    return(Chemistry.Conflict);
                }
                else
                {
                    return(Chemistry.Neutral);
                }

            case AstrologicalSign.Scorpio:
                if (playerSign == AstrologicalSign.Aries || playerSign == AstrologicalSign.Gemini)
                {
                    return(Chemistry.Affinity);
                }
                else if (playerSign == AstrologicalSign.Pisces)
                {
                    return(Chemistry.Conflict);
                }
                else
                {
                    return(Chemistry.Neutral);
                }

            case AstrologicalSign.Taurus:
                if (playerSign == AstrologicalSign.Pisces || playerSign == AstrologicalSign.Cancer)
                {
                    return(Chemistry.Affinity);
                }
                else if (playerSign == AstrologicalSign.Libra)
                {
                    return(Chemistry.Conflict);
                }
                else
                {
                    return(Chemistry.Neutral);
                }

            case AstrologicalSign.Virgo:
                if (playerSign == AstrologicalSign.Leo || playerSign == AstrologicalSign.Sagittarius)
                {
                    return(Chemistry.Affinity);
                }
                else if (playerSign == AstrologicalSign.Gemini)
                {
                    return(Chemistry.Conflict);
                }
                else
                {
                    return(Chemistry.Neutral);
                }
            }

            return(Chemistry.Neutral);
        }
Exemplo n.º 13
0
        public static Chemistry PredictChemistry(Birthday leaderBirthday, string playerBirthday)
        {
            Birthday playerConverted = Birthday.Parse(playerBirthday);

            return(PredictChemistry(leaderBirthday, playerConverted));
        }
Exemplo n.º 14
0
        public override bool Encode(ref byte[] buffer)
        {
            /* First : determine the total number of characters	*/
            int NbBytes = count_nb_bytes();

            /* Second : create the whole byte array                         */
            int index = 0;
            int new_index;

            byte[] pl = new byte[NbBytes];

            new_index = AddLine(pl, pl.Length, index, "BEGIN:VCARD", "");
            if (new_index < 0)
            {
                Trace.WriteLine("Error generating 'VCard' object: after 'BEGIN'");
                return(false);
            }
            index = new_index;

            new_index = AddLine(pl, pl.Length, index, "VERSION:3.0", "");
            if (new_index < 0)
            {
                Trace.WriteLine("Error generating 'VCard' object: after 'VERSION'");
                return(false);
            }
            index = new_index;

            string name = _first_name + " " + _family_name;

            new_index = AddLine(pl, pl.Length, index, "FN:", name);
            if (new_index < 0)
            {
                Trace.WriteLine("Error generating 'VCard' object: after 'FN'");
                return(false);
            }
            index = new_index;


            if (!Nickname.Equals(""))
            {
                new_index = AddLine(pl, pl.Length, index, "NICKNAME:", Nickname);
                if (new_index < 0)
                {
                    Trace.WriteLine("Error generating 'VCard' object: after 'Nickname'");
                    return(false);
                }
                index = new_index;
            }

            DateTime dateBirthday;

            if ((!Birthday.Equals("")) && (DateTime.TryParse(Birthday, out dateBirthday)))
            {
                string Bday = convert_into_vcard_date(Birthday);
                new_index = AddLine(pl, pl.Length, index, "BDAY:", Bday);
                if (new_index < 0)
                {
                    Trace.WriteLine("Error generating 'VCard' object: after 'Birthday'");
                    return(false);
                }
                index = new_index;
            }

            if (!(Address1.Equals("")) ||
                !(Address2.Equals("")) ||
                !(Town.Equals("")) ||
                !(Region_State.Equals("")) ||
                !(Post_Code.Equals("")) ||
                !(Country.Equals(""))
                )
            {
                string addr_line = Address1 + ";" + Address2 + ";" + Town + ";"
                                   + Region_State + ";" + Post_Code + ";" + Country;
                new_index = AddLine(pl, pl.Length, index, "ADR:;", addr_line);
                if (new_index < 0)
                {
                    Trace.WriteLine("Error generating 'VCard' object: after 'Address'");
                    return(false);
                }
                index = new_index;
            }

            if (!(Pro_Address1.Equals("")) ||
                !(Pro_Address2.Equals("")) ||
                !(Pro_Town.Equals("")) ||
                !(Pro_Region_State.Equals("")) ||
                !(Pro_Post_Code.Equals("")) ||
                !(Pro_Country.Equals(""))
                )
            {
                string pro_addr_line = Pro_Address1 + ";" + Pro_Address2 + ";" + Pro_Town + ";"
                                       + Pro_Region_State + ";" + Pro_Post_Code + ";" + Pro_Country;
                new_index = AddLine(pl, pl.Length, index, "ADR;TYPE=work:;", pro_addr_line);
                if (new_index < 0)
                {
                    Trace.WriteLine("Error generating 'VCard' object: after 'Professional Address'");
                    return(false);
                }
                index = new_index;
            }

            if (!Home_phone.Equals(""))
            {
                new_index = AddLine(pl, pl.Length, index, "TEL;TYPE=home:", Home_phone);
                if (new_index < 0)
                {
                    Trace.WriteLine("Error generating 'VCard' object: after 'TEL;TYPE=home'");
                    return(false);
                }
                index = new_index;
            }


            if (!Business_phone.Equals(""))
            {
                new_index = AddLine(pl, pl.Length, index, "TEL;TYPE=work:", Business_phone);
                if (new_index < 0)
                {
                    Trace.WriteLine("Error generating 'VCard' object: after 'TEL;TYPE=work'");
                    return(false);
                }
                index = new_index;
            }

            if (!Cell_phone.Equals(""))
            {
                new_index = AddLine(pl, pl.Length, index, "TEL;TYPE=cell:", Cell_phone);
                if (new_index < 0)
                {
                    Trace.WriteLine("Error generating 'VCard' object: after 'TEL;TYPE=cell'");
                    return(false);
                }
                index = new_index;
            }

            if (!Pager.Equals(""))
            {
                new_index = AddLine(pl, pl.Length, index, "TEL;TYPE=pager:", Pager);
                if (new_index < 0)
                {
                    Trace.WriteLine("Error generating 'VCard' object: after 'TEL;TYPE=pager'");
                    return(false);
                }
                index = new_index;
            }

            if (!Fax.Equals(""))
            {
                new_index = AddLine(pl, pl.Length, index, "TEL;TYPE=fax:", Fax);
                if (new_index < 0)
                {
                    Trace.WriteLine("Error generating 'VCard' object: after 'TEL;TYPE=fax'");
                    return(false);
                }
                index = new_index;
            }

            if (!Email.Equals(""))
            {
                if (Email_alternative.Equals(""))
                {
                    new_index = AddLine(pl, pl.Length, index, "EMAIL:", Email);
                    if (new_index < 0)
                    {
                        Trace.WriteLine("Error generating 'VCard' object: after 'EMAIL'");
                        return(false);
                    }
                    index = new_index;
                }
                else
                {
                    /*	Two E-mails to add */
                    new_index = AddLine(pl, pl.Length, index, "EMAIL;PREF=1:", Email);
                    if (new_index < 0)
                    {
                        Trace.WriteLine("Error generating 'VCard' object: after 'EMAIL;PREF=1'");
                        return(false);
                    }
                    index = new_index;

                    new_index = AddLine(pl, pl.Length, index, "EMAIL;PREF=2:", Email_alternative);
                    if (new_index < 0)
                    {
                        Trace.WriteLine("Error generating 'VCard' object: after 'EMAIL;PREF=2'");
                        return(false);
                    }
                    index = new_index;
                }
            }

            if (!Title.Equals(""))
            {
                new_index = AddLine(pl, pl.Length, index, "TITLE:", Title);
                if (new_index < 0)
                {
                    Trace.WriteLine("Error generating 'VCard' object: after 'TITLE'");
                    return(false);
                }
                index = new_index;
            }

            if (!Role.Equals(""))
            {
                new_index = AddLine(pl, pl.Length, index, "ROLE:", Role);
                if (new_index < 0)
                {
                    Trace.WriteLine("Error generating 'VCard' object: after 'ROLE'");
                    return(false);
                }
                index = new_index;
            }

            if (!Company.Equals(""))
            {
                new_index = AddLine(pl, pl.Length, index, "ORG:", Company);
                if (new_index < 0)
                {
                    Trace.WriteLine("Error generating 'VCard' object: after 'ORG'");
                    return(false);
                }
                index = new_index;
            }

            if (!_photo.Equals(""))
            {
                new_index = AddLine(pl, pl.Length, index, "PHOTO;ENCODING=BASE64;TYPE=JPEG:", _photo);

                if (new_index < 0)
                {
                    Trace.WriteLine("Error generating 'VCard' object: after 'PHOTO'");
                    return(false);
                }

                index = new_index;
            }

            new_index = AddLine(pl, pl.Length, index, "END:VCARD", "");
            _payload  = pl;

            return(base.Encode(ref buffer));
        }
Exemplo n.º 15
0
        private int count_nb_bytes()
        {
            /* All the ASCII strings in the VCard must be separated by 0x0D0A, which represent 2 characters */
            int NbBytes = 0;

            NbBytes  = "BEGIN:VCARD".Length + 2 + "VERSION:3.0".Length + 2;
            NbBytes += "FN:".Length + First_name.Length + 1 + Family_name.Length + 2;                           /* 1 is for "space"	*/

            if (!Nickname.Equals(""))
            {
                NbBytes += "NICKNAME:".Length + Nickname.Length + 2;
            }

            /* Birthday with 8 characters: yyyymmdd	*/
            DateTime dateBirthday;

            if ((!Birthday.Equals("")) && (DateTime.TryParse(Birthday, out dateBirthday)))
            {
                NbBytes += "BDAY:".Length + 8 + 2;
            }

            /* Home address in 6 fields, separated by a ';'						*/
            /* The PO Box is discarded, which explains the first ';'	*/
            if (!(Address1.Equals("")) ||
                !(Address2.Equals("")) ||
                !(Town.Equals("")) ||
                !(Region_State.Equals("")) ||
                !(Post_Code.Equals("")) ||
                !(Country.Equals(""))
                )
            {
                NbBytes += "ADR:;".Length
                           + Address1.Length + 1
                           + Address2.Length + 1
                           + Town.Length + 1
                           + Region_State.Length + 1
                           + Post_Code.Length + 1
                           + Country.Length + 2;
            }

            /* Work address in 6 fields, separated by a ';'						*/
            /* The PO Box is discarded, which explains the first ';'	*/
            if (!(Pro_Address1.Equals("")) ||
                !(Pro_Address2.Equals("")) ||
                !(Pro_Town.Equals("")) ||
                !(Pro_Region_State.Equals("")) ||
                !(Pro_Post_Code.Equals("")) ||
                !(Pro_Country.Equals(""))
                )
            {
                NbBytes += "ADR;TYPE=work:;".Length
                           + Pro_Address1.Length + 1
                           + Pro_Address2.Length + 1
                           + Pro_Town.Length + 1
                           + Pro_Region_State.Length + 1
                           + Pro_Post_Code.Length + 1
                           + Pro_Country.Length + 2;
            }

            if (!Home_phone.Equals(""))
            {
                NbBytes += "TEL;TYPE=home:".Length + Home_phone.Length + 2;
            }

            if (!Business_phone.Equals(""))
            {
                NbBytes += "TEL;TYPE=work:".Length + Business_phone.Length + 2;
            }

            if (!Cell_phone.Equals(""))
            {
                NbBytes += "TEL;TYPE=cell:".Length + Cell_phone.Length + 2;
            }

            if (!Fax.Equals(""))
            {
                NbBytes += "TEL;TYPE=fax:".Length + Fax.Length + 2;
            }

            if (!Pager.Equals(""))
            {
                NbBytes += "TEL;TYPE=pager:".Length + Pager.Length + 2;
            }

            if (!Email.Equals(""))
            {
                if (Email_alternative.Equals(""))
                {
                    NbBytes += "EMAIL:".Length + Email.Length + 2;
                }
                else
                {
                    /* TWO EMAILS : PREF=1 and PREF=2	*/
                    NbBytes += "EMAIL;PREF=1:".Length + Email.Length + 2 + "EMAIL;PREF=2:".Length + Email_alternative.Length + 2;
                }
            }

            if (!Title.Equals(""))
            {
                NbBytes += "TITLE:".Length + Title.Length + 2;
            }

            if (!Role.Equals(""))
            {
                NbBytes += "ROLE:".Length + Role.Length + 2;
            }

            if (!Company.Equals(""))
            {
                NbBytes += "ORG:".Length + Company.Length + 2;
            }

            if (!_photo.Equals(""))
            {
                NbBytes += "PHOTO;ENCODING=BASE64;TYPE=JPEG:".Length + _photo.Length + 2;
            }

            NbBytes += "END:VCARD".Length + 2;

            return(NbBytes);
        }
Exemplo n.º 16
0
 public override string ToString()
 {
     return($"{ConvertGenderToText()} {FirstName} {LastName} was born in {Birthday.ToString("dd/MMM/yyyy", new CultureInfo("en-GB"))}");
 }
Exemplo n.º 17
0
 public void UpdateBirthday(Birthday birthday)
 {
     _entities.Entry(birthday).State = EntityState.Modified;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="T:StatusQuoBaseball.Loaders.PersonBasicInformation"/> struct.
 /// </summary>
 /// <param name="id">Identifier.</param>
 /// <param name="lName">L name.</param>
 /// <param name="fName">F name.</param>
 /// <param name="number">Number.</param>
 /// <param name="naturalPosition">Natural position.</param>
 /// <param name="race">Race.</param>
 /// <param name="handedness">Handedness.</param>
 /// <param name="bats">Bats.</param>
 /// <param name="height">Height.</param>
 /// <param name="weight">Weight.</param>
 /// <param name="birthday">Birthday</param>
 /// <param name="deathday">Deathday</param>
 public PersonBasicInformation(string id, string lName, string fName, string number, string naturalPosition, Race race, Handedness handedness, Handedness bats, Height height, Weight weight, Birthday birthday, Deathday deathday)
 {
     this.id              = id;
     this.lName           = lName;
     this.fName           = fName;
     this.number          = number;
     this.naturalPosition = naturalPosition;
     this.race            = race;
     this.handedness      = handedness;
     this.bats            = bats;
     this.height          = height;
     this.weight          = weight;
     this.birthday        = birthday;
     this.deathday        = deathday;
 }
Exemplo n.º 19
0
 public override int GetHashCode()
 {
     return(base.GetHashCode() + Birthday.GetHashCode() + Name.GetHashCode() + Surname.GetHashCode());
 }
Exemplo n.º 20
0
 public override string ToString()
 {
     return(String.Format("    |{0,-14}|{1,-16}|{2,-10}|{3,-8}|{4,7}|{5,-11}|", Firstname,
                          Lastname, Birthday.ToString("dd-MM-yyyy"), NumberOfPassport, Sex, Nationality));
 }
Exemplo n.º 21
0
 public void BirtdaySuccessfulParseTest(string birthdayString, Birthday expectedBirthday)
 {
     Birthday.Parse(birthdayString).Should().Be(expectedBirthday);
 }
Exemplo n.º 22
0
        public bool Equals(IAccount other)
        {
            if (!AccountID.Equals(other.AccountID))
            {
                Error.AddMessage("Account " + UID + " AccountID: " + AccountID + " is not equal to other: " + other.AccountID);
                return(false);
            }

            if (!BirthCountry.Equals(other.BirthCountry))
            {
                Error.AddMessage("Account " + UID + " BirthCountry: " + BirthCountry + " is not equal to other: " + other.BirthCountry);
                return(false);
            }

            if (!Birthday.Equals(other.Birthday))
            {
                Error.AddMessage("Account " + UID + " Birthday: " + Birthday + " is not equal to other: " + other.Birthday);
                return(false);
            }

            if (!BirthPlace.Equals(other.BirthPlace))
            {
                Error.AddMessage("Account " + UID + " BirthPlace: " + BirthPlace + " is not equal to other: " + other.BirthPlace);
                return(false);
            }

            if (!City.Equals(other.City))
            {
                Error.AddMessage("Account " + UID + " City: " + City + " is not equal to other: " + other.City);
                return(false);
            }

            if (!Country.Equals(other.Country))
            {
                Error.AddMessage("Account " + UID + " Country: " + Country + " is not equal to other: " + other.Country);
                return(false);
            }

            if (!ExtraNames.Equals(other.ExtraNames))
            {
                Error.AddMessage("Account " + UID + " ExtraNames: " + ExtraNames + " is not equal to other: " + other.ExtraNames);
                return(false);
            }

            if (!Fax.Equals(other.Fax))
            {
                Error.AddMessage("Account " + UID + " Fax: " + Fax + " is not equal to other: " + other.Fax);
                return(false);
            }

            if (!Gender.Equals(other.Gender))
            {
                Error.AddMessage("Account " + UID + " Gender: " + Gender + " is not equal to other: " + other.Gender);
                return(false);
            }

            if (!GivenName.Equals(other.GivenName))
            {
                Error.AddMessage("Account " + UID + " GivenName: " + GivenName + " is not equal to other: " + other.GivenName);
                return(false);
            }

            if (!Group.Equals(other.Group))
            {
                Error.AddMessage("Account " + UID + " Group: " + Group + " is not equal to other: " + other.Group);
                return(false);
            }

            if (!HomePhone.Equals(other.HomePhone))
            {
                Error.AddMessage("Account " + UID + " HomePhone: " + HomePhone + " is not equal to other: " + other.HomePhone);
                return(false);
            }

            if (!HouseNumber.Equals(other.HouseNumber))
            {
                Error.AddMessage("Account " + UID + " HouseNumber: " + HouseNumber + " is not equal to other: " + other.HouseNumber);
                return(false);
            }

            if (!HouseNumberAdd.Equals(other.HouseNumberAdd))
            {
                Error.AddMessage("Account " + UID + " HouseNumberAdd: " + HouseNumberAdd + " is not equal to other: " + other.HouseNumberAdd);
                return(false);
            }

            if (!Initials.Equals(other.Initials))
            {
                Error.AddMessage("Account " + UID + " Initials: " + Initials + " is not equal to other: " + other.Initials);
                return(false);
            }

            if (!Mail.Equals(other.Mail))
            {
                Error.AddMessage("Account " + UID + " Mail: " + Mail + " is not equal to other: " + other.Mail);
                return(false);
            }

            if (!MailAlias.Equals(other.MailAlias))
            {
                Error.AddMessage("Account " + UID + " MailAlias: " + MailAlias + " is not equal to other: " + other.MailAlias);
                return(false);
            }

            if (!MobilePhone.Equals(other.MobilePhone))
            {
                Error.AddMessage("Account " + UID + " MobilePhone: " + MobilePhone + " is not equal to other: " + other.MobilePhone);
                return(false);
            }

            if (!PostalCode.Equals(other.PostalCode))
            {
                Error.AddMessage("Account " + UID + " PostalCode: " + PostalCode + " is not equal to other: " + other.PostalCode);
                return(false);
            }

            if (!RegisterID.Equals(other.RegisterID))
            {
                Error.AddMessage("Account " + UID + " RegisterID: " + RegisterID + " is not equal to other: " + other.RegisterID);
                return(false);
            }

            if (!Role.Equals(other.Role))
            {
                Error.AddMessage("Account " + UID + " Role: " + Role + " is not equal to other: " + other.Role);
                return(false);
            }

            if (!StemID.Equals(other.StemID))
            {
                Error.AddMessage("Account " + UID + " StemID: " + StemID + " is not equal to other: " + other.StemID);
                return(false);
            }

            if (!Street.Equals(other.Street))
            {
                Error.AddMessage("Account " + UID + " Street: " + Street + " is not equal to other: " + other.Street);
                return(false);
            }

            if (!SurName.Equals(other.SurName))
            {
                Error.AddMessage("Account " + UID + " SurName: " + SurName + " is not equal to other: " + other.SurName);
                return(false);
            }

            if (!UID.Equals(other.UID))
            {
                Error.AddMessage("Account " + UID + " UID: " + UID + " is not equal to other: " + other.UID);
                return(false);
            }

            if (!UntisID.Equals(other.UntisID))
            {
                Error.AddMessage("Account " + UID + " UntisID: " + UntisID + " is not equal to other: " + other.UntisID);
                return(false);
            }

            return(true);
        }
Exemplo n.º 23
0
 public override string ToString()
 {
     return($"{Id}\t{FirstName}\t{LastName, 15}\t\t{Birthday.ToString("D")}\t{Gender.ToString()}\t{Type.ToString()}");
 }
    private void BindData(int classfiy)
    {
        PM_Promotor p = new PM_PromotorBLL((int)ViewState["PromotorID"]).Model;

        #region 获取当前导购标准薪资、保底薪资、导购管理费
        if ((int)ViewState["PromotorID"] > 0)
        {
            decimal basepay = 0, minumumwage = 0, rtmanagecost = 0;
            new PM_PromotorBLL((int)ViewState["PromotorID"]).GetStdPay(out basepay, out minumumwage, out rtmanagecost);
            ViewState["BasePay"]      = basepay;
            ViewState["MinumumWage"]  = minumumwage;
            ViewState["RTManageCost"] = rtmanagecost;
        }
        #endregion

        PM_PromotorSalary m = new PM_PromotorSalary();
        m.Promotor              = (int)ViewState["PromotorID"];
        m.State                 = 1;
        m.InsertStaff           = (int)Session["UserID"];
        m.RTManageCost          = (decimal)ViewState["RTManageCost"];
        ddl_BasePayMode.Enabled = false;
        if (classfiy == 1 || classfiy == 2)
        {
            m.BasePayMode = 3;
        }
        else
        {
            m.SeniorityPayMode            = 1;
            ddl_BankType.Items[3].Enabled = false;

            #region 抓取固定底薪标准
            decimal basepay = (decimal)ViewState["BasePay"];
            m.BasePay = basepay;
            #endregion
            Addr_OrganizeCityBLL _bll = new Addr_OrganizeCityBLL(p.OrganizeCity);
            if (_bll.IsChildOrganizeCity(7))//判断是否为华南区
            {
                ddl_BasePayMode.Items.Remove(new ListItem("浮动底薪(非华南)", "4"));
                ddl_BasePayMode.Items.Remove(new ListItem("兼职底薪", "3"));
                ddl_BasePayMode.Enabled = true;
                ddl_SalesType.Enabled   = true;
                txt_BaseFeeRate.Enabled = true;
            }
            else
            {
                m.BasePayMode = 1;
            }
        }
        UC_DetailView1.BindData(m);

        if (m.RTManageCost > 0 && (decimal)ViewState["RTManageCost"] == m.RTManageCost)
        {
            TextBox tbx = (TextBox)UC_DetailView1.FindControl("PM_PromotorSalary_RTManageCost");
            if (tbx != null)
            {
                tbx.Enabled = false;
            }
        }
        if (m.State < 3)
        {
            #region 兼职导购的限定
            try
            {
                if (classfiy != 1 && classfiy != 2)   //非专职、非流导,认为是兼职导购
                {
                    DateTime Birthday;
                    if (DateTime.TryParse(p["Birthday"], out Birthday) && Birthday.AddYears(49) < DateTime.Now)
                    {
                        foreach (ListItem item in ddl_InsuranceMode.Items)
                        {
                            if (item.Value != "5" && item.Value != "8" && item.Value != "0")
                            {
                                item.Enabled = false;
                            }
                        }
                    }
                    SetControlsEnable(true);
                }
                else
                {
                    SetControlsEnable(false);
                }
            }
            catch { }
            #endregion


            ddl_BasePaySubsidyMode_SelectedIndexChanged(null, null);
            ddl_InsuranceMode_SelectedIndexChanged(null, null);
            ddl_MinimumWageMode_SelectedIndexChanged(null, null);
            ddl_BankType_SelectedIndexChanged(null, null);
        }
    }
Exemplo n.º 25
0
 public override string ToString()
 {
     return("ID=" + Id + " FullName=" + Full_Name + " Birhday=" + Birthday.ToString());
 }
Exemplo n.º 26
0
 protected bool Equals(NopePet other)
 {
     return(string.Equals(PetName, other.PetName) && Equals(Species, other.Species) &&
            Equals(PetHealth, other.PetHealth) && Equals(Owner, other.Owner) &&
            Birthday.Equals(other.Birthday) && PetId == other.PetId);
 }
Exemplo n.º 27
0
 public override string ToString()
 {
     return($" {Name} _ {Surname} _ {Birthday.ToShortDateString()} _ {Gender} _ {Hobby}");
 }
Exemplo n.º 28
0
        public override string ToString()
        {
            string passangersString = String.Format(" {0,-10} {1,-15} {2,-8} {3,-14} {4,-12} {5, -12} {6, -8} {7,6}$", FirstName, LastName, Gender, Nationality, Passport, Birthday.ToString("dd.MM.yyyy"), ticket.ticketClass, ticket.price.ToString("#.##"));

            return(passangersString);
        }
Exemplo n.º 29
0
 public override string ToString()
 {
     return(string.Format("Клiєнт: {0} {1}, День народження: {2}, Тип: {3}", LastName, FirstName, Birthday.ToShortDateString(), ClientType));
 }
Exemplo n.º 30
0
 public override string ToString()
 {
     return $"{Name} <{Email}> {Birthday.ToString("yyyy-MM-dd")}";
 }
Exemplo n.º 31
0
Arquivo: User.cs Projeto: Galiks/EPAM
 public override int GetHashCode()
 {
     return(Name.GetHashCode() ^ Birthday.GetHashCode() ^ Age.GetHashCode());
 }
Exemplo n.º 32
0
            /// <summary>
            /// Returns the NPC for the day
            /// </summary>
            /// <param name="season">Season</param>
            /// <param name="day">Day</param>
            /// <param name="nextInCycle">Get next available sprite</param>
            internal Texture2D GetSprite(string season, int day, bool nextInCycle)
            {
                Birthday birthday = GetBirthday(season, day);

                return(birthday.GetSprite(nextInCycle));
            }
Exemplo n.º 33
0
 public override string ToString()
 {
     return(string.Format("| {0,-20}| {1,-20}| {2,-20}| {3,-13}| {4,-12: dd-mm-yyyy}| {5,-10}| {6, -22} |",
                          FirstName, LastName, Nationality, PassportPassenger, Birthday.ToString("dd:MM:yyyy"), PassengerGender, FlightTicket));
 }
Exemplo n.º 34
0
 public override string ToString()
 {
     return($"Student\t{Id}\t{FirstName}\t{Birthday.ToShortDateString()}\t{FavoriteSubject}\t{NumberOfOwnedBooks}");
 }
Exemplo n.º 35
0
        public Event(DateTime ClockStart, DateTime ClockEnd, int ClockRunTime, System.Xml.Linq.XDocument XMLEvents, ref CrashHandler Crash)
        {
            ch = Crash;
            events = new Dictionary<string, List<EventItem>>();
            clock = new PartyClock(ClockStart, ClockEnd, ClockRunTime);
            Util.ShowClock = true;
            sound = new Sound(true);
            text = new Text2D();
            chess = new Chess();
            sf = new Starfield(150);

            intro = new Intro(ref sound, ref text);
            outro = new Outro(ref sound);

            advent = new Advent(ref sound);
            birthday = new Birthday(ref sound, ref text, ref chess);
            xmas = new Christmas(ref sound);
            smurf = new Datasmurf(ref sound, ref text); // random
            dif = new Dif(ref chess, ref sound); // random
            fbk = new Fbk(ref sound); // random
            hw = new Halloween(ref chess, ref sound, 25);
            lucia = new Lucia(ref chess, ref sound);
            newyear = new NewYear();
            richard = new RMS(ref sound, ref text); // random
            scroller = new Scroller(ref chess, ref sf, ref text); // random
            semla = new Semla();
            sune = new SuneAnimation(ref sound, ref text);
            tl = new TurboLogo(ref sound, ref chess, (OpenGL.Util.SpringOrFall.Equals("Spring")? true:false)/*((ClockStart.Month >= 1 && ClockStart.Month <= 8)? false:true)*/ ); // vilken termin är det? jan till början av augusti VT, resten HT... random
            valentine = new Valentine(ref sound);
            wl = new WinLinux(ref chess); //random
            creators = new Self(ref sound); // random
            bb = new BB(ref sound); // random
            GM = new GummiBears(ref sound);
            NDay = new National(ref chess, ref sound);
            easter = new Easter(ref sound);
            hajk = new Hajk(ref sound);
            mid = new Midsummer(ref sound);
            vaf = new Vaffla();
            wp = new Walpurgis();
            crayfish = new CrayFish();

            ts = new TeknatStyle(ref chess, ref sound, ref text);
            m = new Matrix(ref text);
            q = new Quiz(ref text, false, ref sound);
            talepsin = new Talespin(ref sound);
            cd = new ChipAndDale(ref sound, ref chess);
            nerd = new Nerdy(ref chess, ref sound);
            trex = new Trex(ref sound);
            sailormoon = new Sailormoon(ref sound,ref chess);
            gb = new GhostBusters(ref sound);
            zelda = new Zelda(ref sound, ref chess);
            tardis = new Tardis(ref sound);
            f**k = new F**k(ref sound, ref chess);

            silverFang = new SilverFang(ref sound);
            mt = new MoraT(ref sound);

            swine = new Swine(ref chess, ref text);
            tjall = new Tjall(ref chess, ref text);

            ronja = new Ronja(ref sound);
            emil = new Emil(ref sound);
            djungelboken = new Djungelboken(ref sound);
            fabbe = new Fabbe(ref sound);
            drink = new Drink(ref sound);
            frozen = new Frozen(ref sound);

            eventCurrent = null; // event item for events to be triggerd in clock_NewDate
            //randomEvent = new List<string>(new string[] { "starfield", "SuneAnimation", "TurboLogo", "Datasmurf", "WinLinux", "Scroller", "BB", "GummiBears", "TeknatStyle", "Matrix"});
            randomEvent = new List<string>(new string[] { "starfield", "Nerdy", "Talespin", "Sailormoon", "GhostBusters", "Zelda", "Tardis", "F**k", "SilverFang", "MoraT" });
            //new stuff
             List<UtilXML.EventData> ed = UtilXML.Loadeffectdata();

            // TODO: Make a clean list with all events allowed to be used implement so that it is actaully usable instead of a switch at the bottom of this file.
            Dictionary<string, Effect> effects = new Dictionary<string, Effect>()
            {
                {"SuneAnimation", new Effect(sune, ed.Find(e => e.Name == "SuneAnimation"))},
                {"Dif",new Effect(dif, ed.Find(e => e.Name == "Dif"))},
                {"Fbk",new Effect(fbk, ed.Find(e => e.Name == "Fbk"))},
                {"TurboLogo",new Effect(tl, ed.Find(e => e.Name == "TurboLogo"))},
                {"Datasmurf", new Effect(smurf, ed.Find(e => e.Name == "Datasmurf"))},
                {"RMS",new Effect(richard, ed.Find(e => e.Name == "RMS"))},
                {"WinLinux",new Effect(wl, ed.Find(e => e.Name == "WinLinux"))},
                {"Scroller",new Effect(scroller, ed.Find(e => e.Name == "Scroller"))},
                {"Self",new Effect(creators, ed.Find(e => e.Name == "Self"))},
                {"BB",new Effect(bb, ed.Find(e => e.Name == "BB"))},
                {"GummiBears",new Effect(GM, ed.Find(e => e.Name == "GummiBears"))},
                {"Hajk",new Effect(hajk, ed.Find(e => e.Name == "Hajk"))},
                {"TeknatStyle",new Effect(ts, ed.Find(e => e.Name == "TeknatStyle"))},
                {"Matrix",new Effect(m, ed.Find(e => e.Name == "Matrix"))},
                {"Quiz",new Effect(q, ed.Find(e => e.Name == "Quiz"))},
                {"Talespin",new Effect(talepsin, ed.Find(e => e.Name == "Talespin"))},
                {"ChipDale",new Effect(cd, ed.Find(e => e.Name == "ChipDale"))},
                {"Nerdy",new Effect(nerd, ed.Find(e => e.Name == "Nerdy"))},
              /*  {"Trex",new Effect(trex, ed.Find(e => e.Name == "Trex"))},*/
                {"Sailormoon",new Effect(sailormoon, ed.Find(e => e.Name == "Sailormoon"))},
                {"GhostBusters",new Effect(gb, ed.Find(e => e.Name == "GhostBusters"))},
                {"Zelda",new Effect(zelda, ed.Find(e => e.Name == "Zelda"))},
                {"Tardis",new Effect(tardis, ed.Find(e => e.Name == "Tardis"))},
                {"F**k",new Effect(f**k, ed.Find(e => e.Name == "F**k"))},
                {"SilverFang",new Effect(silverFang, ed.Find(e => e.Name == "SilverFang"))},
                {"MoraT",new Effect(mt, ed.Find(e => e.Name == "MoraT"))},
                {"Ronja",new Effect(ronja, ed.Find(e => e.Name == "Ronja"))},
                {"Emil",new Effect(emil, ed.Find(e => e.Name == "Emil"))},
                {"Djungelboken",new Effect(djungelboken, ed.Find(e => e.Name == "Djungelboken"))},
                {"Fabbe",new Effect(fabbe, ed.Find(e => e.Name == "Fabbe"))},
                {"Drink",new Effect(drink, ed.Find(e => e.Name == "Drink"))},
                {"Frozen",new Effect(drink, ed.Find(e => e.Name == "Frozen"))}
            };

            runEffectInMonth = new Dictionary<string, List<objdata>>();

            string[] months = Util.monthlist();
            int counter;
            foreach (KeyValuePair<string, Effect> pair in effects)
            {
                counter = 0;
                foreach (bool b in pair.Value.RunAllowedlist)
                {
                    if (b == true)
                    {
                        if (!runEffectInMonth.ContainsKey(months[counter]))
                        {
                            runEffectInMonth.Add(months[counter], new List<objdata>());
                        }

                        runEffectInMonth[months[counter]].Add(new objdata(pair.Key, pair.Value.Vetolist[counter], pair.Value.Priolist[counter], pair.Value.Runslist[counter]));
                    }
                    counter++;
                }
            }

            clock.NewDate += clock_NewDate; // Event listener

            if (ch.CrashDialogResult == System.Windows.Forms.DialogResult.Yes)
            {
                clock.clock = ch.CrashClock;
            }

            string name, date, type;
            // Event dates setup
            foreach (var item in XMLEvents.Descendants("event"))
            {
                name = item.Element("name").Value;
                date = item.Element("date").Value;
                type = item.Element("type").Value.ToLower();
                EventItem ei = new EventItem(name, type, date);
                if (!events.ContainsKey(date))
                {
                    List<EventItem> list = new List<EventItem>(); // seems most bad in my eyes...
                    events.Add(date, list);
                }

                for (int i = 0; i < events[date].Count; i++)
                {
                    EventItem e = events[date][i];
                    if ("birthday".Equals(e.Type) && "birthday".Equals(ei.Type))
                    {
                        e.Name += "\n\n" + ei.Name;
                        events[date][i] = e;
                    }
                }
                events[date].Add(ei);
                name = date = type = string.Empty;
            }

            // this needs to be fixed nicer...
            if (events.ContainsKey(ClockEnd.ToShortDateString()))
            {
                events[ClockEnd.ToShortDateString()].Clear(); // force this to be top..
                events[ClockEnd.ToShortDateString()].Add( new EventItem("outro", "outro", ClockEnd.ToShortDateString()) );
            }
            else
            {
                events.Add(ClockEnd.ToShortDateString(), new List<EventItem>() { new EventItem("outro", "outro", ClockEnd.ToShortDateString()) });
            }

            // Random effects on dates with no effects and check against new list of allowed things for them...
            DateTime dt = ClockStart;
            bool star = (Util.Rnd.Next(0, 1000) < 500 ? true:false); // make this random at the start too?
            int num = 0;

            while (dt <= ClockEnd)
            {
                date = dt.ToShortDateString();
                if (!events.ContainsKey(date))
                {
                    EventItem ei;

                    if (num == 0 || num == 1)
                    {
                        ei = new EventItem("starfield", "random", date);
                    }
                    else
                    {
                        //ei = new EventItem(randomEvent[Util.Rnd.Next(1, randomEvent.Count)], "random", date);

                        string month = "";
                        if (dt != null)
                            month = dt.Month.ToString();

                        switch (month)
                        {
                            case "1": month = "jan"; break;
                            case "2": month = "feb"; break;
                            case "3": month = "mar"; break;
                            case "4": month = "apr"; break;
                            case "5": month = "maj"; break;
                            case "6": month = "jun"; break;
                            case "7": month = "jul"; break;
                            case "8": month = "aug"; break;
                            case "9": month = "sep"; break;
                            case "10": month = "okt"; break;
                            case "11": month = "nov"; break;
                            case "12": month = "dec"; break;
                        }//switch

                        if (runEffectInMonth.ContainsKey(month))
                        {
                            List<objdata> mobj = runEffectInMonth[month];

                            List<objdata> vetolist = new List<objdata>();
                            List<objdata> novetolist = new List<objdata>();

                            foreach (objdata n in mobj)
                            {

                                if ("Quiz".Equals(n.Name) && eventnum == 4)
                                {
                                    n.vetoAgain();
                                    eventnum = 0;
                                }

                                if (n.Veto == true)
                                {
                                    if (n.Runs > 0)
                                        vetolist.Add(n);
                                }
                                else
                                {
                                    if (n.Runs > 0)
                                        novetolist.Add(n);
                                }
                            }

                            vetolist.Sort();
                            novetolist.Sort();

                            if (vetolist.Count > 0)
                            {
                                ei = new EventItem(vetolist[0].Name, "random", date);
                                vetolist[0].noMoreVeto();
                            }
                            else if (novetolist.Count > 0)
                            {
                                ei = new EventItem(novetolist[0].Name, "random", date);
                                novetolist[0].decRuns();
                                if (eventnum < 4)
                                    eventnum++;
                            }
                            else
                            {
                                ei = new EventItem(randomEvent[Util.Rnd.Next(1, randomEvent.Count)], "random", date);
                            }
                        }
                        else
                        {
                            ei = new EventItem(randomEvent[Util.Rnd.Next(1, randomEvent.Count)], "random", date);
                        }
                    }

                    num++;
                    if (num == 3)
                    {
                        num = 0;
                    }
                    ei = new EventItem("Self", "random", date); // this is for debuging new events
                    events.Add(date, new List<EventItem>());
                    events[date].Add(ei);
                }

                dt = dt.AddDays(1);
                date = string.Empty;
            }
        }
Exemplo n.º 36
0
 public void InsertBirthday(Birthday birthday)
 {
     _entities.Birthdays.Add(birthday);
 }