예제 #1
0
        public void UppdateLanguage_cv(int id, List <string> name)
        {
            int           language_ID = GetLanguageID(id);
            int           nr          = 0;
            List <string> L           = new List <string>();

            L = name;
            foreach (var item in L)
            {
                if (item == "Swedish")
                {
                    nr = 1;
                }
                else if (item == "English")
                {
                    nr = 2;
                }
                else if (item == "Spanish")
                {
                    nr = 3;
                }
                else if (item == "French")
                {
                    nr = 4;
                }
            }

            var query =
                from sc in pgfe.language_cv
                where sc.language_id == language_ID && sc.cv_id == id
                select sc;

            foreach (language_cv sc in query)
            {
                if (sc.language_id == nr)
                {
                    sc.language_id = nr;
                }
                else
                {
                    sc.language_id = nr;
                }
            }
            pgfe.SaveChanges();
        }
        public void DeleteFreeFromCus(int cusID, int FreeID)
        {
            var query = (from c_f in pg.customer_freelancer
                         where c_f.customer_id == cusID && c_f.freelancer_id == FreeID
                         select c_f).FirstOrDefault();

            pg.customer_freelancer.Remove(query);
            pg.SaveChanges();
        }
        public void SavefreeToCus(int cusID, int freeID)
        {
            customer_freelancer cf = new customer_freelancer
            {
                freelancer_id = freeID,
                customer_id   = cusID
            };

            pgfe.customer_freelancer.Add(cf);
            pgfe.SaveChanges();
        }