Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
 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;
     }
 }