コード例 #1
0
 public domain.Korisnik Update(domain.Korisnik domainObject)
 {
     using (model.LearnByPracticeDataContext context = CreateContext())
     {
         IQueryable <model.Korisnik> query = context.Korisniks.Where(p => p.ID == domainObject.Id);
         model.Korisnik modelObject        = query.Single();
         modelObject.Korisnichko_Ime = domainObject.Username;
         modelObject.Lozinka         = domainObject.PasswordOdNiza;
         modelObject.Ime             = domainObject.Ime;
         modelObject.Prezime         = domainObject.Prezime;
         modelObject.Pol             = ToModel(domainObject.Pol);
         modelObject.Organizacija_ID = domainObject.organizacija.Id;
         modelObject.Email           = domainObject.Email;
         modelObject.Telefonski_Broj = domainObject.Mobilen;
         modelObject.Mentor          = domainObject.Mentor;
         modelObject.Student         = domainObject.Student;
         if (modelObject.Student == true)
         {
             modelObject.Studiska_Programa_ID = domainObject.studiskaPrograma.Id;
         }
         else
         {
             modelObject.Studiska_Programa_ID = null;
         }
         modelObject.Administrator = domainObject.Administrator;
         context.SubmitChanges();
         domain.Korisnik result = ToDomain(modelObject);
         return(result);
     }
 }
コード例 #2
0
 public domain.StudiskaPrograma Update(domain.StudiskaPrograma domainObject)
 {
     using (model.LearnByPracticeDataContext context = CreateContext())
     {
         IQueryable <model.Studiska_Programa> query = context.Studiska_Programas.Where(p => p.ID == domainObject.Id);
         model.Studiska_Programa modelObject        = query.Single();
         modelObject.Ime = domainObject.Ime;
         context.SubmitChanges();
         domain.StudiskaPrograma result = ToDomain(modelObject);
         return(result);
     }
 }
コード例 #3
0
 public domain.Prijava Update(domain.Prijava domainObject)
 {
     using (model.LearnByPracticeDataContext context = CreateContext())
     {
         IQueryable <model.Prijava> query = context.Prijavas.Where(p => p.ID == domainObject.Id);
         model.Prijava modelObject        = query.Single();
         modelObject.Organizacija_ID = domainObject.organizacija.Id;
         context.SubmitChanges();
         domain.Prijava result = ToDomain(modelObject);
         return(result);
     }
 }
コード例 #4
0
 public domain.Oblast Update(domain.Oblast domainObject)
 {
     using (model.LearnByPracticeDataContext context = CreateContext())
     {
         IQueryable <model.Oblast> query = context.Oblasts.Where(p => p.ID == domainObject.Id);
         model.Oblast modelObject        = query.Single();
         modelObject.Ime = domainObject.Ime;
         context.SubmitChanges();
         domain.Oblast result = ToDomain(modelObject);
         return(result);
     }
 }
コード例 #5
0
 public domain.VidOrganizacija Insert(domain.VidOrganizacija domainObject)
 {
     using (model.LearnByPracticeDataContext context = CreateContext())
     {
         model.Vid_Organizacija modelObject = new model.Vid_Organizacija();
         modelObject.Ime = domainObject.Ime;
         context.Vid_Organizacijas.InsertOnSubmit(modelObject);
         context.SubmitChanges();
         domain.VidOrganizacija result = ToDomain(modelObject);
         return(result);
     }
 }
コード例 #6
0
 public domain.VidOrganizacija Update(domain.VidOrganizacija domainObject)
 {
     using (model.LearnByPracticeDataContext context = CreateContext())
     {
         IQueryable <model.Vid_Organizacija> query = context.Vid_Organizacijas.Where(p => p.ID == domainObject.Id);
         model.Vid_Organizacija modelObject        = query.Single();
         modelObject.Ime = domainObject.Ime;
         context.SubmitChanges();
         domain.VidOrganizacija result = ToDomain(modelObject);
         return(result);
     }
 }
コード例 #7
0
 public domain.Ocena Update(domain.Ocena domainObject)
 {
     using (model.LearnByPracticeDataContext context = CreateContext())
     {
         IQueryable <model.Ocenka> query = context.Ocenkas.Where(p => p.Korisnik_ID == domainObject.student.Id && p.Predmet_ID == domainObject.predmet.Id);
         model.Ocenka modelObject        = query.Single();
         modelObject.Ocenka1 = domainObject.Ocenka;
         context.SubmitChanges();
         domain.Ocena result = ToDomain(modelObject);
         return(result);
     }
 }
コード例 #8
0
        public domain.Oblast Insert(domain.Oblast domainObject)
        {
            using (model.LearnByPracticeDataContext context = CreateContext())
            {
                model.Oblast modelObject = new model.Oblast();
                modelObject.Ime = domainObject.Ime;
                context.Oblasts.InsertOnSubmit(modelObject);
                context.SubmitChanges();
                domain.Oblast result = ToDomain(modelObject);

                return(result);
            }
        }
コード例 #9
0
 public domain.PrijavaStudent Update(domain.PrijavaStudent domainObject)
 {
     using (model.LearnByPracticeDataContext context = CreateContext())
     {
         IQueryable <model.Prijava_Korisnik> query = context.Prijava_Korisniks.Where(p => p.Korisnik_ID == domainObject.student.Id);
         model.Prijava_Korisnik modelObject        = query.Single();
         modelObject.Korisnik_ID = domainObject.student.Id;
         modelObject.Prijava_ID  = domainObject.prijava.Id;
         context.SubmitChanges();
         domain.PrijavaStudent result = ToDomain(modelObject);
         return(result);
     }
 }
コード例 #10
0
 public domain.Predmet Update(domain.Predmet domainObject)
 {
     using (model.LearnByPracticeDataContext context = CreateContext())
     {
         IQueryable <model.Predmet> query = context.Predmets.Where(p => p.ID == domainObject.Id);
         model.Predmet modelObject        = query.Single();
         modelObject.Shifra_Na_Predmet = domainObject.ShifraNaPredmet;
         modelObject.Ime = domainObject.Ime;
         context.SubmitChanges();
         domain.Predmet result = ToDomain(modelObject);
         return(result);
     }
 }
コード例 #11
0
 public domain.PrijavaTehnologija Update(domain.PrijavaTehnologija domainObject)
 {
     using (model.LearnByPracticeDataContext context = CreateContext())
     {
         IQueryable <model.Prijava_Tehnologija> query = context.Prijava_Tehnologijas.Where(p => p.Prijava_ID == domainObject.prijava.Id);
         model.Prijava_Tehnologija modelObject        = query.Single();
         modelObject.Tehnologija_ID = domainObject.tehnologija.Id;
         modelObject.Prijava_ID     = domainObject.prijava.Id;
         context.SubmitChanges();
         domain.PrijavaTehnologija result = ToDomain(modelObject);
         return(result);
     }
 }
コード例 #12
0
        public domain.StudiskaPrograma Insert(domain.StudiskaPrograma domainObject)
        {
            using (model.LearnByPracticeDataContext context = CreateContext())
            {
                model.Studiska_Programa modelObject = new model.Studiska_Programa();
                modelObject.Ime = domainObject.Ime;
                context.Studiska_Programas.InsertOnSubmit(modelObject);
                context.SubmitChanges();
                domain.StudiskaPrograma result = ToDomain(modelObject);

                return(result);
            }
        }
コード例 #13
0
        public domain.Prijava Insert(domain.Prijava domainObject)
        {
            using (model.LearnByPracticeDataContext context = CreateContext())
            {
                model.Prijava modelObject = new model.Prijava();
                modelObject.Organizacija_ID       = domainObject.organizacija.Id;
                modelObject.Datum_Na_Prijavuvanje = domainObject.Datum;
                context.Prijavas.InsertOnSubmit(modelObject);
                context.SubmitChanges();
                domain.Prijava result = ToDomain(modelObject);

                return(result);
            }
        }
コード例 #14
0
        public domain.PrijavaTehnologija Insert(domain.PrijavaTehnologija domainObject)
        {
            using (model.LearnByPracticeDataContext context = CreateContext())
            {
                model.Prijava_Tehnologija modelObject = new model.Prijava_Tehnologija();
                modelObject.Tehnologija_ID = domainObject.tehnologija.Id;
                modelObject.Prijava_ID     = domainObject.prijava.Id;
                context.Prijava_Tehnologijas.InsertOnSubmit(modelObject);
                context.SubmitChanges();
                domain.PrijavaTehnologija result = ToDomain(modelObject);

                return(result);
            }
        }
コード例 #15
0
        public domain.PrijavaStudent Insert(domain.PrijavaStudent domainObject)
        {
            using (model.LearnByPracticeDataContext context = CreateContext())
            {
                model.Prijava_Korisnik modelObject = new model.Prijava_Korisnik();
                modelObject.Prijava_ID  = domainObject.prijava.Id;
                modelObject.Korisnik_ID = domainObject.student.Id;
                context.Prijava_Korisniks.InsertOnSubmit(modelObject);
                context.SubmitChanges();
                domain.PrijavaStudent result = ToDomain(modelObject);

                return(result);
            }
        }
コード例 #16
0
        public domain.Predmet Insert(domain.Predmet domainObject)
        {
            using (model.LearnByPracticeDataContext context = CreateContext())
            {
                model.Predmet modelObject = new model.Predmet();
                modelObject.Shifra_Na_Predmet = domainObject.ShifraNaPredmet;
                modelObject.Ime = domainObject.Ime;
                context.Predmets.InsertOnSubmit(modelObject);
                context.SubmitChanges();
                domain.Predmet result = ToDomain(modelObject);

                return(result);
            }
        }
コード例 #17
0
        public domain.Tehnologija Insert(domain.Tehnologija domainObject)
        {
            using (model.LearnByPracticeDataContext context = CreateContext())
            {
                model.Tehnologija modelObject = new model.Tehnologija();
                modelObject.Ime       = domainObject.Ime;
                modelObject.Oblast_ID = domainObject.oblast.Id;
                context.Tehnologijas.InsertOnSubmit(modelObject);
                context.SubmitChanges();
                domain.Tehnologija result = ToDomain(modelObject);

                return(result);
            }
        }
コード例 #18
0
        public domain.Ocena Insert(domain.Ocena domainObject)
        {
            using (model.LearnByPracticeDataContext context = CreateContext())
            {
                model.Ocenka modelObject = new model.Ocenka();
                modelObject.Korisnik_ID = domainObject.student.Id;
                modelObject.Predmet_ID  = domainObject.predmet.Id;
                modelObject.Ocenka1     = domainObject.Ocenka;
                context.Ocenkas.InsertOnSubmit(modelObject);
                context.SubmitChanges();
                domain.Ocena result = ToDomain(modelObject);

                return(result);
            }
        }
コード例 #19
0
 public domain.Organizacija Update(domain.Organizacija domainObject)
 {
     using (model.LearnByPracticeDataContext context = CreateContext())
     {
         IQueryable <model.Organizacija> query = context.Organizacijas.Where(p => p.ID == domainObject.Id);
         model.Organizacija modelObject        = query.Single();
         modelObject.Ime                 = domainObject.Ime;
         modelObject.Adresa              = domainObject.Adresa;
         modelObject.Kontakt_Telefon     = domainObject.KontaktTelefon;
         modelObject.Veb_Strana          = domainObject.VebStrana;
         modelObject.Vid_Organizacija_ID = domainObject.vidOrganizacija.Id;
         context.SubmitChanges();
         domain.Organizacija result = ToDomain(modelObject);
         return(result);
     }
 }
コード例 #20
0
        public domain.Organizacija Insert(domain.Organizacija domainObject)
        {
            using (model.LearnByPracticeDataContext context = CreateContext())
            {
                model.Organizacija modelObject = new model.Organizacija();
                modelObject.Ime                 = domainObject.Ime;
                modelObject.Adresa              = domainObject.Adresa;
                modelObject.Kontakt_Telefon     = domainObject.KontaktTelefon;
                modelObject.Veb_Strana          = domainObject.VebStrana;
                modelObject.Vid_Organizacija_ID = domainObject.vidOrganizacija.Id;
                context.Organizacijas.InsertOnSubmit(modelObject);
                context.SubmitChanges();
                domain.Organizacija result = ToDomain(modelObject);

                return(result);
            }
        }