예제 #1
0
파일: NAW.cs 프로젝트: aeonxberg/Alg1
        public int CompareTo(NAW andereNaw)
        {
            // signal compare to Logger
            Logger.Instance.LogCompare();

            if (andereNaw.Naam == Naam && andereNaw.Adres == Adres && andereNaw.Woonplaats == Woonplaats)
            {
                return(0);
            }
            else
            {
                if (andereNaw.Woonplaats != Woonplaats)
                { // woonplaatsen zijn verschillend
                    return(Woonplaats.CompareTo(andereNaw.Woonplaats));
                }
                else if (andereNaw.Naam != Naam)
                { // woonplaatsen zijn verschillend en namen zijn verschillend
                    return(Naam.CompareTo(andereNaw.Naam));
                }
                else
                { // woonplaatsen en namen zijn gelijk
                    return(Adres.CompareTo(andereNaw.Adres));
                }
            }
        }
        private string GenereerLogin()
        {
            string fullName = "";

            fullName += voornaam.ToLower().Substring(0, 4) + Naam.ToLower().Substring(0, 4);
            return(fullName + "@student.arteveldehs.be");
        }
        private string GenereerGebruikersnaam()
        {
            string fullName = "";

            fullName += voornaam.ToLower().Substring(0, 4) + Naam.ToLower().Substring(0, 4);
            return(fullName);
        }
예제 #4
0
 public override bool Equals(object obj)
 {
     return(obj is Speler speler &&
            Naam.Equals(speler.Naam) &&
            RugNummer == speler.RugNummer &&
            TransferWaarde == speler.TransferWaarde);
 }
예제 #5
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string Naam, Surname, userName;
            int    passWord;
            bool   isAdmin = false;

            if (rdbAdminYes.Checked)
            {
                isAdmin = true;
            }
            else if (rdbAdminNo.Checked)
            {
                isAdmin = false;
            }

            if (!Validation.EmployeeName(txtName.Text))
            {
                lblNaam.ForeColor = Color.Red;
            }
            else
            {
                lblNaam.ForeColor = Color.Black;
            }

            if (!Validation.EmployeeSurname(txtSurname.Text))
            {
                lblSurname.ForeColor = Color.Red;
            }
            else
            {
                lblSurname.ForeColor = Color.Black;
            }
            var oleDbConnection = new OleDbConnection(Global.connString);

            if (Validation.EmployeeName(txtName.Text) && Validation.EmployeeSurname(txtSurname.Text))
            {
                Naam     = txtName.Text;
                Surname  = txtSurname.Text;
                userName = Naam.Substring(0, 1) + Surname.Substring(0, 3);
                passWord = passRandom.Next(1000, 9999);
                oleDbConnection.Open();
                var myCommand = new OleDbCommand();
                myCommand.Connection  = oleDbConnection;
                myCommand.CommandText =
                    "INSERT INTO Users (Employee_Name,Employee_Surname,Employee_Id,Admin_rights,Employee_Password) Values ('" +
                    Naam + "','" + Surname + "','" + userName + "'," + isAdmin + "," + passWord + ")";
                myCommand.ExecuteNonQuery();
                MessageBox.Show("Data inserted successfully", "Inserted Data", MessageBoxButtons.OK, MessageBoxIcon.Information);
                oleDbConnection.Close();

                Hide();
                var form = new AddandRemoveUser();
                form.Show();
            }
            else
            {
                MessageBox.Show("Please enter values into all field", "Error in field", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }
        public bool Contains(string zoekterm)
        {
            if (Naam.IndexOf(zoekterm, StringComparison.OrdinalIgnoreCase) >= 0)
            {
                return(true);
            }

            return(false);
        }
예제 #7
0
        public string GetCode()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(Merk.Substring(0, 3).ToUpper());
            stringBuilder.Append(Naam.Substring(0, 3).ToUpper());
            stringBuilder.Append(Volume.Replace(' ', '_'));
            return(stringBuilder.ToString());
        }
예제 #8
0
 public void SetAllIdentifyingNames(string search, string replace)
 {
     Naam   = Naam.Replace(search, replace);
     Define = Define.Replace(search, replace);
     foreach (ITemplatable templdp in Detectoren)
     {
         templdp.SetAllIdentifyingNames(search, replace);
     }
 }
예제 #9
0
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 23 + Naam.GetHashCode();
            hash = hash * 23 + Adres.GetHashCode();
            hash = hash * 23 + Woonplaats.GetHashCode();
            return(hash);
        }
예제 #10
0
 public bool Equals(Tuin t)
 {
     if (Id == t.Id && Straat.Equals(t.Straat) && Nummer.Equals(t.Nummer) && Naam.Equals(t.Naam) && Stad.Equals(t.Stad))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #11
0
        private void btnOpslaan_Click(object sender, RoutedEventArgs e)
        {
            Naam deNaam = new Naam();

            deNaam.Naam = txtboxnaam.Text

                          db.items.InsertOnSubmit(deNaam);

            db.SubmitChanges();

            dgItems.ItemsSource = db.items.ToList();
        }
예제 #12
0
        public string GetCode()
        {
            string result = null;

            if (true)
            {
                result = Merk.Substring(1, 3) + Naam.Substring(1, 3);
            }



            return(result);
        }
예제 #13
0
        private string GenereerLogin()
        {
            string fullName = "";

            if (voornaam.Length < 4)
            {
                fullName += voornaam.ToLower() + Naam.ToLower().Substring(0, 2);
            }
            else
            {
                fullName += voornaam.ToLower().Substring(0, 4) + Naam.ToLower().Substring(0, 2);
            }
            return(fullName + "@arteveldehs.be");
        }
예제 #14
0
        // GenereerLogin
        private string GenereerLogin()
        {
            string naam = "";

            if (voornaam.Length < 4)
            {
                naam += voornaam.ToLower() + Naam.ToLower().Substring(0, 4);
            }
            else
            {
                naam += voornaam.ToLower().Substring(0, 4) + Naam.ToLower().Substring(0, 4);
            }
            return(naam + "@student.arteveldehs.be");
        }
예제 #15
0
        private string GenereerGebruikersnaam()
        {
            string fullName = "";

            if (voornaam.Length < 4)
            {
                fullName += voornaam.ToLower() + Naam.ToLower().Substring(0, 2);
            }
            else
            {
                fullName += voornaam.ToLower().Substring(0, 4) + Naam.ToLower().Substring(0, 2);
            }
            return(fullName);
        }
예제 #16
0
        //	Methodes
        //	GenereerGebruikersnaam
        private string GenereerGebruikersnaam()
        {
            string naam = "";

            if (voornaam.Length < 4)
            {
                naam += voornaam.ToLower() + Naam.ToLower().Substring(0, 4);
            }
            else
            {
                naam += voornaam.ToLower().Substring(0, 4) + Naam.ToLower().Substring(0, 4);
            }
            return(naam);
        }
예제 #17
0
 public override int GetHashCode()
 {
     // gegenereerde code
     unchecked
     {
         var hashCode = (Naam != null ? Naam.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Straat != null ? Straat.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Nummer.GetHashCode();
         hashCode = (hashCode * 397) ^ (Bus != null ? Bus.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Postcode;
         hashCode = (hashCode * 397) ^ (Gemeente != null ? Gemeente.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ AantalWerkuren.GetHashCode();
         return(hashCode);
     }
 }
예제 #18
0
 public int CompareTo(Straatnaam straatnaam)
 {
     if (!ReferenceEquals(straatnaam, null))
     {
         int compareTo = Naam.CompareTo(straatnaam.Naam);
         if (compareTo == 0)
         {
             compareTo = ID.CompareTo(straatnaam.ID);
         }
         return(compareTo);
     }
     else
     {
         return(+1);
     }
 }
예제 #19
0
        private bool Valid()
        {
            ValidateLocations();

            if (Naam == null || Naam.Equals(""))
            {
                MessageBox.Show("Vul een naam in");
                return(false);
            }
            else if (SelectedGebruiker == null)
            {
                MessageBox.Show("Vul een inspecteur in");
                return(false);
            }
            else if (SelectedKlant == null)
            {
                MessageBox.Show("Vul een evenement in");
                return(false);
            }
            else if (SelectedOfferte == null)
            {
                MessageBox.Show("Vul een offerte in");
                return(false);
            }
            else if (PostCode == null || PostCode.Equals(""))
            {
                MessageBox.Show("Vul een postcode in");
                return(false);
            }
            else if (Datum == null)
            {
                MessageBox.Show("Vul een datum in");
                return(false);
            }
            else if (huisnummer == 0 || huisnummer.Equals(""))
            {
                MessageBox.Show("Vul een huisnummer in");
                return(false);
            }
            else if (SelectedStatus == null)
            {
                MessageBox.Show("Vul een status in");
                return(false);
            }

            return(true);
        }
예제 #20
0
        public int CompareTo(object obj)
        {
            if (obj == null)
            {
                return(1);
            }
            Product p = obj as Product;

            if (p == null)
            {
                return(1);
            }
            int result = Naam.CompareTo(p.Naam);

            if (result == 0)
            {
                result = Prijs.CompareTo(p.Prijs);
            }
            return(result);
        }
예제 #21
0
        private void button1_Click(object sender, EventArgs e)
        {
            string userName;
            string passWord;
            //int admin = 0;
            //if (rdbAdminYes.Checked)
            //{
            //     admin = -1 ;
            //}

            var oleDbConnection = new OleDbConnection(Global.connString);

            if (txtNaam.Text != "" && txtSurname.Text != "")
            {
                Naam     = txtNaam.Text;
                Surname  = txtSurname.Text;
                userName = Naam.Substring(0, 1) + Surname.Substring(0, 3);
                Random passRandom = new Random();
                passWord = (passRandom.Next(1000, 9000)).ToString();
                oleDbConnection.Open();
                var myCommand = new OleDbCommand();
                myCommand.Connection  = oleDbConnection;
                myCommand.CommandText =
                    "INSERT INTO Users (Employee_Name,Employee_Surname,Employee_Id,Admin_rights) values('" +
                    Naam + "','" + Surname + "','" + userName + "'," + rdbAdminYes.Checked + ")";

                myCommand.ExecuteNonQuery();
                MessageBox.Show("Data inserted successfully");
                oleDbConnection.Close();

                Hide();
                AddandRemoveUser form = new AddandRemoveUser();
                form.Show();
            }
            else
            {
                MessageBox.Show("Invalid fields", "Invalid Fields", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #22
0
 public int CompareTo(Schip schip)
 {
     if (!ReferenceEquals(schip, null))
     {
         int compareteTo = Naam.CompareTo(schip.Naam);
         if (compareteTo == 0)
         {
             compareteTo = Tonnage.CompareTo(schip.Tonnage);
         }
         if (compareteTo == 0)
         {
             compareteTo = Breedte.CompareTo(schip.Breedte);
         }
         if (compareteTo == 0)
         {
             compareteTo = Lengte.CompareTo(schip.Lengte);
         }
         return(compareteTo);
     }
     else
     {
         return(+1);
     }
 }
예제 #23
0
 public override int GetHashCode()
 {
     return(SpelerID.GetHashCode() ^ Naam.GetHashCode());
 }
예제 #24
0
 public override int GetHashCode()
 {
     return(Naam.GetHashCode());
 }
예제 #25
0
        private bool Valid()
        {
            LocationEntryVM locTo;
            LocationEntryVM locFrom;

            try
            {
                locTo   = apiConnector.getAdresLocation(this.PostCode + ", " + this.huisnummer);
                locFrom = apiConnector.getAdresLocation(SelectedGebruiker.Postcode + ", " + SelectedGebruiker.Huisnummer);

                return(true);
            }
            catch (Exception e)
            {
                MessageBox.Show("Postcode en huisnummer combinatie is incorrect!");
                return(false);
            }

            if (Naam == null || Naam.Equals(""))
            {
                MessageBox.Show("Vul een naam in");
                return(false);
            }
            else if (SelectedGebruiker == null)
            {
                MessageBox.Show("Vul een inspecteur in");
                return(false);
            }
            else if (SelectedKlant == null)
            {
                MessageBox.Show("Vul een evenement in");
                return(false);
            }
            else if (SelectedOfferte == null)
            {
                MessageBox.Show("Vul een offerte in");
                return(false);
            }
            else if (PostCode == null || PostCode.Equals(""))
            {
                MessageBox.Show("Vul een postcode in");
                return(false);
            }
            else if (Datum == null)
            {
                MessageBox.Show("Vul een datum in");
                return(false);
            }
            else if (huisnummer == 0 || huisnummer.Equals(""))
            {
                MessageBox.Show("Vul een huisnummer in");
                return(false);
            }
            else if (SelectedStatus == null)
            {
                MessageBox.Show("Vul een status in");
                return(false);
            }

            return(true);
        }
예제 #26
0
 public string GetCode()
 {
     return((Merk.Substring(0, 3) + Naam.Substring(0, 3) + Volume.Replace(' ', '_')).ToUpper());
 }
예제 #27
0
 public void SetAllIdentifyingNames(string search, string replace)
 {
     Naam   = Naam.Replace(search, replace);
     Define = Define.Replace(search, replace);
 }
예제 #28
0
 //Functie method TOONNAAM.
 public string ToonNaam()
 {
     return($"Lector {Voornaam} {Naam.ToUpper()}");
 }
예제 #29
0
 public override int GetHashCode()
 {
     return(Stamnummer.GetHashCode() ^ Naam.GetHashCode());
 }
 public string GetCode()
 {
     return $"{Merk.Substring(0, 3).ToUpper()}{Naam.Substring(0, 3).ToUpper()}{Volume.Replace(" ", "_")}";
 }