Пример #1
0
        public static void inregistreaza_companie(string director, string nume, string adresa, string email, string telefon, string parola)
        {
            string hash = SecurePasswordHasher.Hash(parola);

            char[] delimiters = { ',' };
            string skills     = SignInCompany.get_skillsC();

            string[] words = skills.Split(delimiters);

            var contextC    = new LinkedinEntities5();
            var newCompanie = new Companie()
            {
                Nume_companie     = nume,
                Adresa_companie   = adresa,
                Email_companie    = email,
                Telefon_companie  = telefon,
                UsernameC         = nume,
                ParolaC           = hash,
                Director_companie = director
            };

            foreach (string s in words)
            {
                Aptitudini apt = new Aptitudini {
                    Aptitudine = s
                };
                newCompanie.Aptitudini.Add(apt);
            }

            using (var context = new LinkedinEntities5())
            {
                context.Companie.Add(newCompanie);
                context.SaveChanges();
            }
        }
Пример #2
0
 private void btNextCompany_Click(object sender, EventArgs e)
 {
     if (companyname != null && CEO != null &&
         addressC != null && phoneC != null &&
         emailC != null && skillsC != null &&
         passC != null && checkpassC != null)
     {
         MessageBox.Show("Register successfully",
                         "Information",
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Information);
         this.Close();
         Form form = new Companie();
         form.Show();
     }
     else
     {
         MessageBox.Show("Some empty filled!",
                         "ERROR",
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
     }
 }