Ejemplo n.º 1
0
 public void LoadProduct()
 {
     if (FriendlyUrl.Segments.Count != 0)
     {
         int productid;
         if (int.TryParse(FriendlyUrl.Segments[0], out productid))
         {
             EventDetails = db.Events.Include("Tickets").FirstOrDefault(p => p.EventsId == productid);
         }
     }
     else if(Request.Form.AllKeys.Count() > 0 && Request.Form.AllKeys.Contains("json"))
     {
         //var dateTimeConverter = new IsoDateTimeConverter { DateTimeFormat = "dd/MM/yyyy HH:mm" };
         JObject EventPreview = JsonConvert.DeserializeObject<JObject>(Request["json"]);
         if (EventPreview != null && EventPreview["Tickets"] != null)
         {
             foreach(JObject t in EventPreview["Tickets"])
             {
                 t["StartDate"] = null;
                 t["EndDate"] = null;
             }
             JsonSerializer jss = new JsonSerializer {
                 DateFormatString = "dd/MM/yyyy HH:mm"
             };
             EventDetails = EventPreview.ToObject<Entities.Events>(jss);
         }
     }
 }
Ejemplo n.º 2
0
 public void updateEvent(Events events)
 {
     TEVEntityModel db = new TEVEntityModel();
     db.Entry<Events>(events).State = System.Data.Entity.EntityState.Modified;
     db.SaveChanges();
 }
Ejemplo n.º 3
0
 public void updateEvent(Events events)
 {
     (new EventsDAL()).updateEvent(events);
 }
Ejemplo n.º 4
0
 public void createEvent(Events events)
 {
     TEVEntityModel db = new TEVEntityModel();
     db.Events.Add(events);
     db.SaveChanges();
 }
Ejemplo n.º 5
0
 public void createEvent(Events events)
 {
     (new EventsDAL()).createEvent(events);
 }