internal static void CreateSubscription(KidsInformationCreateViewModel kidsInformation) { int day = kidsInformation.DateOfBirth.Day; int month = kidsInformation.DateOfBirth.Month; using (var da = new DAArchanaInformation(true)) { da.CreateSubscription(kidsInformation.Name, kidsInformation.ParentName, kidsInformation.EmailAddress, day, month); } }
public ActionResult Create([Bind(Include = "Name,ParentName,DateOfBirth,EmailAddress")] KidsInformationCreateViewModel kidsInformation) { try { if (ModelState.IsValid && kidsInformation != null) { ArchanaSubscriptionHelper.CreateSubscription(kidsInformation); return(RedirectToAction("Index")); } ModelState.AddModelError("Invalid Data", "Please try again."); return(View(kidsInformation)); } catch (Exception ex) { log.Error(ex.Message, ex); throw; } }