Beispiel #1
0
 public int Add(LiveHostShow mdl)
 {
     mdl.Id        = Guid.NewGuid().ToString("n");
     mdl.IsEnabled = true;
     mdl.MakeDay   = DateTime.Now;
     throw new NotImplementedException();
 }
Beispiel #2
0
        public IHttpActionResult Post([FromBody] LiveHostShow show)
        {
            if (ModelState.IsValid)
            {
                var uid = User.Identity.GetUserId();

                if (_reps.Exist(uid))
                {
                }
                show.Id      = _reps.GenNewId();
                show.MakeDay = DateTime.Now;
                show.UserId  = uid;
                _reps.Add(show);
            }
            return(Ok(show.Id));
        }
Beispiel #3
0
        public ActionResult UpdateOrAdd(LiveHostShow hostShow)
        {
            int i = 0;

            if (ModelState.IsValid)
            {
                hostShow.UserId = User.Identity.Name;
                var d = _hostSv.Single(hostShow.UserId);
                if (d != null)
                {
                    d.IsBasic      = hostShow.IsBasic;
                    d.StartDate    = hostShow.StartDate;
                    d.TimeDuration = hostShow.TimeDuration;
                    d.MakeDay      = DateTime.Now;
                    i = _hostSv.Update(d);
                }
                else
                {
                    i = _hostSv.Add(hostShow);
                }
            }

            return(Json(new { i }, JsonRequestBehavior.AllowGet));
        }
Beispiel #4
0
 public int Update(LiveHostShow mdl)
 {
     throw new NotImplementedException();
 }