Example #1
0
        public ViewResult GetChannels()
        {
            var service = ServicesFactory.GetChannelsService();
            var model   = service.GetChannelsModel();

            return(View(model));
        }
Example #2
0
        public JsonResult DeleteChannel(int id)
        {
            string status  = string.Empty;
            var    service = ServicesFactory.GetChannelsService();;

            if (service.DeleteChannel(id))
            {
                status = "ok";
            }
            else
            {
                status = "fail";
            }


            return(Json(new { status = status }));
        }
Example #3
0
        public JsonResult AddChannel(string channel)
        {
            string status = "ok";
            int    id     = 0;

            try
            {
                var service = ServicesFactory.GetChannelsService();
                id = service.AddChannel(channel);
            }
            catch (Exception exception)
            {
                status = "false";
            }

            return(Json(new { id = id, status = status }));
        }