public ActionResult DiscussionByDiscussionID(int DID)
 {
     long AccountID;
     int SystemObjectID = (int)SystemObject.Discussion;
     GenericBE objGenericModel = new GenericBE();
     if (Request.Cookies["ID"] != null)
     {
         AccountID = Convert.ToInt64(Request.Cookies["ID"].Value.ToString());
         CourseItem objCourseItem = new CourseItem();
         objGenericModel = objCourseItem.CourseItemDetails(AccountID, SystemObjectID, DID).Single(DiscussionID => DiscussionID.CourseItemID == DID);
     }
     return View(objGenericModel);
 }
 public ActionResult QuestionByQuestionID(int QID)
 {
     long AccountID;
     int SystemObjectID = (int)SystemObject.Questions;
     CourseItem objCourseItem = new CourseItem();
     GenericBE objGenericBE = new GenericBE();
     if (Request.Cookies["ID"] != null)
     {
         AccountID = Convert.ToInt64(Request.Cookies["ID"].Value.ToString());
         objGenericBE = objCourseItem.CourseItemDetails(AccountID, SystemObjectID, QID).Single(Question => Question.CourseItemID == QID);
     }
     return View(objGenericBE);
 }
        public ActionResult SummaryBySummaryID(int SID)
        {
            long AccountID;
            int SystemObjectID = (int)SystemObject.Summary;
            CourseItem objCourseItem = new CourseItem();
            GenericBE objGenericModel = new GenericBE();

            if (Request.Cookies["ID"] != null)
            {
                AccountID = Convert.ToInt64(Request.Cookies["ID"].Value.ToString());
                objGenericModel = objCourseItem.CourseItemDetails(AccountID, SystemObjectID, SID).Single(Summary => Summary.CourseItemID == SID);
            }
            return View(objGenericModel);
        }
        public ActionResult TermByTermID(int TID)
        {
            long AccountID;
            int SystemObjectID = (int)(SystemObject.Terms);
            CourseItem objCourseItem = new CourseItem();
            GenericBE objGenericBE = new GenericBE();

            if (Request.Cookies["ID"] != null)
            {
                AccountID = Convert.ToInt64(Request.Cookies["ID"].Value.ToString());
                objGenericBE = objCourseItem.CourseItemDetails(AccountID, SystemObjectID, TID).Single(Term => Term.CourseItemID == TID);
            }

            return View(objGenericBE);
        }
        public ActionResult LoadAddItem(int CourseItemID, int CourseID, string SystemObjectName, string IsCourseHomePage)
        {
            GenericBE objGenericModel = new GenericBE();
            int SystemObjectID = (int)Enum.Parse(typeof(SystemObject), SystemObjectName);
            if (CourseItemID <= 0)
            {
                // load default answer new answer
                //objGenericModel.ParentCourseItemID = ParentCID;
                objGenericModel.CourseID = CourseID;
                objGenericModel.SystemObjectName = SystemObjectName;
                objGenericModel.CourseID = CourseID;
                objGenericModel.IsAddItem = true;
                objGenericModel.IsCourseHomePage = Convert.ToInt32(IsCourseHomePage);
                //return View(objGenericModel);
            }
            else if (CourseItemID > 0)
            {
                // Call Database and get value
                long AccountID;
                CourseItem objCourseItem = new CourseItem();

                if (Request.Cookies["ID"] != null)
                {
                    AccountID = Convert.ToInt64(Request.Cookies["ID"].Value.ToString());
                    objGenericModel = objCourseItem.CourseItemDetails(AccountID, SystemObjectID, CourseItemID).Single();
                }
                objGenericModel.IsAddItem = false;
                objGenericModel.IsCourseHomePage = Convert.ToInt32(IsCourseHomePage);
            }
            using (CuteWebUI.MvcUploader uploader = new CuteWebUI.MvcUploader(System.Web.HttpContext.Current))
            {
                uploader.UploadUrl = Response.ApplyAppPathModifier("~/UploadHandler.ashx");
                //the data of the uploader will render as <input type='hidden' name='myuploader'>
                uploader.Name = "myuploader";
                uploader.AllowedFileExtensions = "*.jpg,*.gif,*.png,*.bmp,*.doc,*.docx,*.pdf,*.xls,*.xlsx,*.ppt,*.ppsx";

                //allow select multiple files
                uploader.MultipleFilesUpload = true;

                uploader.ManualStartUpload = true;

                //tell uploader attach a button
                uploader.InsertButtonID = "uploadbutton";

                //prepair html code for the view
                ViewData["uploaderhtml"] = uploader.Render();

            }
            return View(objGenericModel);
        }