Example #1
0
        public ActionResult DomainNoteEkle(DomainNot model, FormCollection frm)
        {
            DomainNot entity = new DomainNot();

            if (model.DomainNotId > 0)
            {
                entity = Db.DomainNots.SingleOrDefault(x => x.DomainNotId == model.DomainNotId);
            }
            entity.DomainNotNot   = model.DomainNotNot;
            entity.DomainNotTarih = DateTime.Now;
            entity.RefDomainId    = model.RefDomainId;
            if (model.DomainNotId > 0)
            {
                Db.Entry(entity).State = EntityState.Modified;
            }
            else
            {
                Db.DomainNots.Add(entity);
            }
            //todo: login ekranı eklenince kaldırılacak
            entity.RefNotKullaniciId = User.Identity.GetUserId() ?? "f5f53da2-c311-44c9-af6a-b15ca29aee57";
            Db.SaveChanges();
            TempData[SUCESS] = "Domain Kaydedildi";
            return(RedirectToAction("DomainNotlari"));
        }
Example #2
0
        public ActionResult DomainNoteEkle(int?id)
        {
            DomainNot model = new DomainNot();

            if (id.HasValue)
            {
                model = Db.DomainNots.Include(x => x.Domain).SingleOrDefault(x => x.DomainNotId == id);
            }
            return(View(model));
        }