public ActionResult Create(GiftViewModel gift)
 {
     if (!ModelState.IsValid)
     {
         ErrorNotification("Kayıt Eklenemedi!");
         return(RedirectToAction("Create"));
     }
     _giftService.Add(new Gift
     {
         CategoryId     = gift.CategoryId,
         BrandId        = gift.BrandId,
         Cancellation   = gift.Cancellation,
         Combining      = gift.Combining,
         Coverage       = gift.Coverage,
         Description    = gift.Description,
         GiftPoint      = gift.GiftPoint,
         Indivisible    = gift.Indivisible,
         TermOfUse      = gift.TermOfUse,
         Usage          = gift.Usage,
         ValidityPeriod = gift.ValidityPeriod,
         IsActive       = gift.IsActive,
         Detail         = gift.Detail
     });
     SuccessNotification("Kayıt Eklendi.");
     return(RedirectToAction("GiftIndex"));
 }
Beispiel #2
0
 public ActionResult Create(GiftViewModel gift)
 {
     if (!ModelState.IsValid)
     {
         ErrorNotification("Kayıt Eklenemedi!");
         return(RedirectToAction("Create"));
     }
     _giftService.Add(new Gift
     {
         //TODO:Alanlar buraya yazılacak
         //Örn:BrandName = brand.BrandName,
     });
     SuccessNotification("Kayıt Eklendi.");
     return(RedirectToAction("GiftIndex"));
 }