Esempio n. 1
0
        public ActionResult SessionCreate(long?id)
        {
            if (id != null)
            {
                var Varial = _courseSessionBs.GetById(Convert.ToInt32(id));
                return(View(Varial));
            }
            CourseSessionModel model = new CourseSessionModel();

            if (TempData["CourseID"] != null)
            {
                model.CourseID = Convert.ToInt64(TempData["CourseID"]);
            }

            return(View(model));
        }
Esempio n. 2
0
        public IHttpActionResult GetCourseSession(Int64 topicID)
        {
            CourseSessionModel model = new CourseSessionModel();
            var sessionData          = _courseSessionBs.GetById(topicID);

            if (sessionData == null)
            {
                apiResponse.IsSuccess = false;
                apiResponse.Message   = "No Session Found";
            }
            model.Topic     = sessionData.Topic;
            model.VideoLink = sessionData.VideoLink;
            model.AudioLink = sessionData.AudioLink;
            model.Document1 = sessionData.Document1 != null ? ConfigurationManager.AppSettings["BaseUrl"] + "/Documents" + "/" + sessionData.Document1 : string.Empty;
            model.Document2 = sessionData.Document2 != null ? ConfigurationManager.AppSettings["BaseUrl"] + "/Documents" + "/" + sessionData.Document2 : string.Empty;
            model.CourseID  = sessionData.CourseID;
            model.Id        = sessionData.Id;


            apiResponse.IsSuccess = true;
            apiResponse.Data      = model;
            return(Ok(apiResponse));
        }