Ejemplo n.º 1
0
        public JsonResult DeleteEvent(int eventID)
        {
            var          status = false;
            TacheService dc     = new TacheService();

            Console.WriteLine(eventID);
            Tache v = new Tache();

            v = dc.GetById(eventID);

            dc.Delete(v);
            dc.Commit();
            status = true;

            return(new JsonResult {
                Data = new { status = status }
            });
        }
Ejemplo n.º 2
0
        public JsonResult SaveEvent(Tache e)
        {
            Console.WriteLine("teessssssst" + e.TacheId);
            var          status = false;
            TacheService dc     = new TacheService();

            if (e.TacheId > 0)
            {
                //Update the event
                var v = dc.GetById(e.TacheId);
                if (v != null)
                {
                    v.TacheId     = e.TacheId;
                    v.Subject     = e.Subject;
                    v.Start       = e.Start;
                    v.End         = e.End;
                    v.Description = e.Description;
                    v.IsFullDay   = e.IsFullDay;
                    v.ThemeColor  = e.ThemeColor;
                    dc.Update(v);
                }
            }
            else
            {
                Tache v = new Tache
                {
                    Subject     = e.Subject,
                    Description = e.Description,
                    Start       = e.Start,
                    End         = e.End,
                    IsFullDay   = e.IsFullDay,
                    ThemeColor  = e.ThemeColor
                };

                dc.Add(v);
            }
            dc.Commit();
            status = true;
            return(new JsonResult {
                Data = new { status = status }
            });
        }