Beispiel #1
0
        public ActionResult IndexPost()
        {
            UplataBO uplataBO = new UplataBO();

            uplataBO.AktivnostID = Convert.ToInt32(Request.Form["Aktivnosti"].ToString());
            uplataBO.JMBG        = kDC.Korisniks.FirstOrDefault(t => t.Email == FormsAuthentication.Decrypt(Request.Cookies[FormsAuthentication.FormsCookieName].Value).Name).JMBG;
            uplataBO.Cene        = Convert.ToInt32(Request.Form["Cena"].ToString());
            korisnikRepository.DodajUplatu(uplataBO);
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public void DodajUplatu(UplataBO uplataBO)
        {
            Uplata uplata = new Uplata()
            {
                AktivnostID = uplataBO.AktivnostID,
                Cene        = uplataBO.Cene,
                Datum       = DateTime.Now,
                JMBG        = uplataBO.JMBG
            };

            kDC.Uplatas.InsertOnSubmit(uplata);
            kDC.SubmitChanges();
        }