コード例 #1
0
ファイル: MappingHelper.cs プロジェクト: Dragan89/Diplomska
 public static LoggedInEntity LoggedInEntityFromKlient(Poedinci poedinec)
 {
     return new LoggedInEntity
     {
         Id = poedinec.IdPoedinci,
         KorisnickoIme = poedinec.KorisnickoIme,
         Mail = poedinec.Mail,
         Naziv = poedinec.Ime + " " + poedinec.Prezime,
         Telefon = poedinec.Telefon,
         Role = "Poedinec",
         UserType = Helpers.Enumerations.LogedUserTypeEnum.Poedinec
     };
 }
コード例 #2
0
ファイル: QPoedinec.cs プロジェクト: Dragan89/Diplomska
        public bool RegisterPoedinec(RegisterModel poedinecModel)
        {
            try
            {
                Poedinci poedinec = new Poedinci
                {
                    Ime = poedinecModel.Ime,
                    Prezime = poedinecModel.Prezime,
                    KorisnickoIme = poedinecModel.KorisnickoIme,
                    Lozinka = poedinecModel.Password,
                    Mail = poedinecModel.Email,
                    Telefon = poedinecModel.Telefon
                };

                _db.Poedinci.Add(poedinec);
                _db.SaveChanges();
            }
            catch(Exception ex)
            {
                return false;
            }
            return true;
        }