public IActionResult Post(FormElement data)
        {
            data.isActive = true;
            var createdAbout = service.Add(data);

            return(CreatedAtAction("Get", new { id = createdAbout.Data.Id }, createdAbout));
        }
Exemple #2
0
 public IActionResult FormElement(FormElement formElement)
 {
     if (HttpContext.Session.GetString("Name") == null)
     {
         return(RedirectToAction("Login", "Admin"));
     }
     if (formElement.Order != 0)
     {
         formElement.AddedDate = DateTime.Now;
         formElement.isActive  = true;
         var kayıt = formElementService.Add(formElement);
         TempData["Mesaj"] = kayıt.BasariliMi ? "Kayıt Eklendi." : kayıt.Mesaj;
         return(RedirectToAction("FormElement"));
     }
     else
     {
         ViewModel mymodel = new ViewModel();
         mymodel.FormElements     = formElementService.GetAll().Data;
         mymodel.Forms            = formService.GetAll().Data;
         mymodel.FormElementItems = itemService.GetAll().Data;
         TempData["Mesaj"]        = "Sıra numarası giriniz.";
         return(View(mymodel));
     }
 }