예제 #1
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;
            }
        }
예제 #2
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();
            }
        }
예제 #3
0
        public void RetreiveImage(ImageAd img, int imgid)
        {
            using (var dbContext = new LinqClassesDataContext())
            {
                var table = from t in dbContext.ImageAds
                            where t.Id == imgid
                            select t;

                img.image = table.Single().image;
            }
        }
예제 #4
0
파일: Voip.cs 프로젝트: leaswis/voip
        public int[] takeListInterest(UserInterest usr, int userId)
        {
            using (var dbContext = new LinqClassesDataContext())
            {
                int[] list_interest = dbContext.UserInterests
                                      .Where(v => v.userID == userId)
                                      .Select(v => v.interestID).ToArray();

                return(list_interest);
            }
        }
예제 #5
0
        public void LoadInterests(Interest intr, int id)
        {
            using (var dbContext = new LinqClassesDataContext())
            {
                var table = from t in dbContext.Interests
                            where t.Id == id
                            select t;

                intr.Id        = table.Single().Id;
                intr.Interest1 = table.Single().Interest1;
            }
        }
예제 #6
0
        public void AddContact(int hostId, int contactId)
        {
            Contact temp = new Contact();

            temp.hostID    = hostId;
            temp.contactID = contactId;
            using (var db = new LinqClassesDataContext())
            {
                db.Contacts.InsertOnSubmit(temp);
                db.SubmitChanges();
            }
        }
예제 #7
0
        public void LoadInterestId(UserInterest intr, int id)
        {
            using (var dbContext = new LinqClassesDataContext())
            {
                var table = from t in dbContext.UserInterests
                            where t.userID == id
                            select t;

                intr.Id         = table.Single().Id;
                intr.interestID = table.Single().interestID;
                intr.userID     = table.Single().userID;
            }
        }
예제 #8
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();
            }
        }
예제 #9
0
        public List <int> GetContacts(int hostID)
        {
            List <int> contacts = new List <int>();

            using (var dbContext = new LinqClassesDataContext())
            {
                var table = from t in dbContext.Contacts
                            where t.hostID == hostID
                            select t;

                for (int i = 0; i < table.Count(); i++)
                {
                    var temp    = table.ToArray()[i].contactID;
                    int contact = (int)temp;
                    contacts.Add(contact);
                }
            }
            return(contacts);
        }
예제 #10
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;
            }
        }
예제 #11
0
파일: Voip.cs 프로젝트: leaswis/voip
        private async void displayAdds(ImageAd img, int[] list)
        {
            //List<int> list = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

            while (true)
            {
                foreach (int i in list)
                {
                    using (var dbContext = new LinqClassesDataContext())
                    {
                        var table = from t in dbContext.ImageAds
                                    where t.Id == i
                                    select t;

                        img.image = table.Single().image;

                        pic.Image = ByteArrayToImage(img.image.ToArray());
                        pic.Refresh();
                        await Task.Delay(1000);
                    }
                }
            }
        }