Ejemplo n.º 1
0
 public string SaveHappyHoursDays(HappyHoursDaysModel model)
 {
     try
     {
         var                  cultureSource = new CultureInfo("en-US", false);
         DateTime             StartTime     = DateTime.Parse(model.TimeStart, cultureSource);
         TimeSpan             starttime     = StartTime.TimeOfDay;
         DateTime             EndTime       = DateTime.Parse(model.TimeEnd, cultureSource);
         TimeSpan             endtime       = EndTime.TimeOfDay;
         int                  Max           = SaveOfferType(model.OfferType);
         Nibs_HappyHours_Days tb            = new Nibs_HappyHours_Days();
         tb.Discount    = model.Discount;
         tb.EndDay      = model.EndDay;
         tb.FreeItemId  = model.FreeItemId;
         tb.HHOfferType = model.HHOfferType;
         tb.OfferId     = Max;
         tb.StartDay    = model.StartDay;
         tb.TimeEnd     = endtime;
         tb.TimeStart   = starttime;
         tb.ItemIndex   = model.ItemIndex;
         _entities.Nibs_HappyHours_Days.Add(tb);
         _entities.SaveChanges();
         return("record saved successfully..");
     }
     catch
     {
         return("something wrong try again !");
     }
 }
Ejemplo n.º 2
0
        public ActionResult SaveHappyHoursDays(HappyHoursDaysModel model)
        {
            var Data = happy.SaveHappyHoursDays(model);

            TempData["result"] = Data;
            return(RedirectToAction("Index"));
        }