Example #1
0
        public void AddUserInfo(User_info info)
        {
            User_info temp = new User_info();

            temp.Id           = info.Id;
            temp.Sex          = info.Sex;
            temp.Localization = info.Localization;
            temp.Birthdate    = info.Birthdate;
            temp.Name         = info.Name;
            temp.Surname      = info.Surname;
            temp.City         = info.City;
            // temp.Avatar = info.Avatar;
            temp.Email       = info.Email;
            temp.Password    = info.Password;
            temp.isBusy      = info.isBusy;
            temp.isConnected = info.isConnected;

            //do rejs.
            //temp.interestID = info.interestID;

            using (var db = new LinqClassesDataContext())
            {
                db.User_infos.InsertOnSubmit(temp);
                db.SubmitChanges();
            }
        }
Example #2
0
        public Rozmowa(int dataReceived)
        {
            User_info info = new User_info();

            InitializeComponent();

            loggedUser = dataReceived;

            logic.DisplayUserInfo(info, loggedUser);
            string name = info.Name;

            labelName.Text = "Witaj " + name + "!";


            int[] list = takeListInterest(user_interest, loggedUser);

            displayAdds(obraz, list);

            List <int>    contacts = logic.GetContacts(loggedUser);
            List <string> names    = new List <string>();

            foreach (int i in contacts)
            {
                User_info temp_userinfo = new User_info();
                logic.DisplayUserInfo(temp_userinfo, i);
                comboBox1.Items.Add(temp_userinfo.Name + " " + temp_userinfo.Surname);
            }
            comboBox1.SelectedIndex = 0;
            InitializeComponent();
        }
Example #3
0
        public void DisplayUserInfo(User_info info, int logid)
        {
            using (var dbContext = new LinqClassesDataContext())
            {
                var table = from t in dbContext.User_infos
                            where t.Id == logid
                            select t;

                info.Id           = table.Single().Id;
                info.Sex          = table.Single().Sex;
                info.Localization = table.Single().Localization;
                info.Birthdate    = table.Single().Birthdate;
                info.Name         = table.Single().Name;
                info.Surname      = table.Single().Surname;
                info.City         = table.Single().City;
                //info.Avatar = table.Single().Avatar;
                info.Email       = table.Single().Email;
                info.Password    = table.Single().Password;
                info.isBusy      = table.Single().isBusy;
                info.isConnected = table.Single().isConnected;


                //do rejes.
                //info.interestID = table.Single().interestID;
            }
        }
Example #4
0
        /* public void AddInterest(User_info info, List<int> interestid)
         * {
         *   UserInterest u = new UserInterest();
         *
         *
         *   foreach (int x in interestid)
         *   {
         *       using (var dbContext = new LinqClassesDataContext())
         *       {
         *
         *           u.interestID = x;
         *           u.userID = info.Id;
         *
         *           dbContext.UserInterests.InsertOnSubmit(u);
         *           dbContext.SubmitChanges();
         *       }
         *   }
         *
         * }*/


        public void AddInterest(User_info info, int interestid)
        {
            UserInterest u = new UserInterest();


            using (var dbContext = new LinqClassesDataContext())
            {
                u.interestID = interestid;
                u.userID     = info.Id;

                dbContext.UserInterests.InsertOnSubmit(u);
                dbContext.SubmitChanges();
            }
        }
Example #5
0
File: Voip.cs Project: leaswis/voip
        public Voip(int dataReceived)
        {
            InitializeComponent();
            User_info info = new User_info();

            InitializeComponent();

            loggedUser = dataReceived;

            logic.DisplayUserInfo(info, loggedUser);
            string name = info.Name;

            labelName.Text = name + ",";

            int[] list = takeListInterest(user_interest, loggedUser);

            displayAdds(obraz, list);
        }
Example #6
0
        private void LoginButton_Click(object sender, EventArgs e)
        {
            User_info temp = new User_info();

            temp.Email    = this.textBoxEmail2.Text;
            temp.Password = this.textBoxHaslo.Text;

            User_info userLogin = new User_info();

            logic.LoadUserInfo(userLogin, temp.Email);
            if (userLogin.Password == temp.Password)
            {
                int         userLogged = userLogin.Id;
                Komunikator okno       = new Komunikator(userLogged);
                okno.Show();
                this.Hide();
            }
        }
Example #7
0
        public void LoadUserInfo(User_info info, string email)
        {
            using (var dbContext = new LinqClassesDataContext())
            {
                var table = from t in dbContext.User_infos
                            where t.Email == email
                            select t;

                info.Id           = table.Single().Id;
                info.Sex          = table.Single().Sex;
                info.Localization = table.Single().Localization;
                info.Birthdate    = table.Single().Birthdate;
                info.Name         = table.Single().Name;
                info.Surname      = table.Single().Surname;
                info.City         = table.Single().City;
                info.Email        = table.Single().Email;
                info.Password     = table.Single().Password;
                info.isBusy       = table.Single().isBusy;
                info.isConnected  = table.Single().isConnected;
            }
        }
Example #8
0
 public void RetreiveAds(User_info info, int userid)
 {
 }
Example #9
0
        private void buttonRegister_Click(object sender, EventArgs e)
        {
            User_info info = new User_info();

            try
            {
                List <string> birth = new List <string>();
                birth.Add(textBoxR.Text);
                birth.Add(textBoxM.Text);
                birth.Add(textBoxD.Text);
                string bdate = string.Join("-", birth);


                DateTime dt = DateTime.Parse(bdate);

                info.Name      = this.textBoxName.Text;
                info.Surname   = this.textBoxSurname.Text;
                info.City      = this.textBoxCity.Text;
                info.Email     = this.textBoxEmail.Text;
                info.Password  = this.textBoxPassword.Text;
                info.Birthdate = dt;
                //+ this.comboBoxMonth.SelectedText + this.comboBoxYear.SelectedText;
                info.isBusy      = false;
                info.isConnected = false;
                if (radioButtonFemale.Checked)
                {
                    info.Sex = this.radioButtonFemale.Text;
                }
                else if (radioButtonMale.Checked)
                {
                    info.Sex = this.radioButtonMale.Text;
                }
                if (radioButtonUndefined.Checked)
                {
                    info.Sex = "inny";
                }
            } catch (Exception ex)
            {
                throw ex;
            }

            logic.AddUserInfo(info);

            logic.LoadUserInfo(info, info.Email);

            try{
                if (checkBoxAnimals.Checked)
                {
                    logic.AddInterest(info, 4);
                }
                if (checkBoxBlogs.Checked)
                {
                    logic.AddInterest(info, 8);
                }
                if (checkBoxCuisine.Checked)
                {
                    logic.AddInterest(info, 2);
                }
                if (checkBoxEntertaiment.Checked)
                {
                    logic.AddInterest(info, 5);
                }
                if (checkBoxFashion.Checked)
                {
                    logic.AddInterest(info, 3);
                }
                if (checkBoxGames.Checked)
                {
                    logic.AddInterest(info, 7);
                }
                if (checkBoxMovies.Checked)
                {
                    logic.AddInterest(info, 12);
                }
                if (checkBoxMusic.Checked)
                {
                    logic.AddInterest(info, 10);
                }
                if (checkBoxRecreation.Checked)
                {
                    logic.AddInterest(info, 14);
                }
                if (checkBoxSport.Checked)
                {
                    logic.AddInterest(info, 1);
                }
                if (checkBoxTechnology.Checked)
                {
                    logic.AddInterest(info, 6);
                }
                if (checkBoxTheatre.Checked)
                {
                    logic.AddInterest(info, 13);
                }
                if (checkBoxTravels.Checked)
                {
                    logic.AddInterest(info, 15);
                }
                if (checkBoxTV.Checked)
                {
                    logic.AddInterest(info, 11);
                }

                /*if (checkBoxAnimals.Checked == false &&
                 *  checkBoxBlogs.Checked == false &&
                 *  checkBoxCuisine.Checked == false &&
                 *  checkBoxEntertaiment.Checked == false &&
                 *  checkBoxFashion.Checked == false &&
                 *  checkBoxGames.Checked == false &&
                 *  checkBoxMovies.Checked == false &&
                 *  checkBoxMusic.Checked == false &&
                 *  checkBoxPersonalGrowth.Checked == false &&
                 *  checkBoxRecreation.Checked == false &&
                 *  checkBoxSport.Checked == false &&
                 *  checkBoxTechnology.Checked == false &&
                 *  checkBoxTheatre.Checked == false &&
                 *  checkBoxTravels.Checked == false &&
                 *  checkBoxTV.Checked == false)
                 * {
                 *  MessageBox.Show("Zaznacz CO NAJMNIEJ jedno");
                 * }
                 */

                MessageBox.Show("Zarejestrowano pomyślnie");
                loggedUser = info.Id;
                Komunikator okno = new Komunikator(loggedUser);
                okno.Show();
                this.Hide();
            }
            catch (Exception exc)
            {
                throw exc;
            }
        }
Example #10
0
 partial void DeleteUser_info(User_info instance);
Example #11
0
 partial void UpdateUser_info(User_info instance);
Example #12
0
 partial void InsertUser_info(User_info instance);