public ActionResult AddSuggestCourse(DSuggestCourse.SuggestCourse _suggestCourse) { if (_suggestCourse.SuggestCourseID > 0) { _suggestCourse.OrganizationID = Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"])); _commonService.updateSuggestCourse(Mapper.Map <NEPService.CommonService.SuggestCourse>(_suggestCourse)); return(Json(GlobalConst.Message.UpdatedSuccessfully, GlobalConst.Message.text_html)); } else { _suggestCourse.OrganizationID = Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"])); var id = _commonService.addSuggestCourse(Mapper.Map <NEPService.CommonService.SuggestCourse>(_suggestCourse)); return(Json(GlobalConst.Message.AddedSuccessfully, GlobalConst.Message.text_html)); } }
public ActionResult Index(string returnUrl, LoginViewModel model) { ModelState.Clear(); if (Session["Org"] == null) { var _organizationID = HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]))); Organization objOrganization = new Organization(); objOrganization = Mapper.Map <Organization>(_clientService.GetOrganizationByID(_organizationID)); objOrganization.LogoImage = GlobalConst.FolderName.Storage + GlobalConst.ConstantChar.ForwardSlash + GlobalConst.FolderName.Org + _organizationID + GlobalConst.ConstantChar.ForwardSlash + GlobalConst.FolderName.LogoImage + GlobalConst.ConstantChar.ForwardSlash + objOrganization.LogoImage; Session["Org"] = objOrganization; } User user = new User(); try { if (this.Request.RawUrl.ToLower() != "/studentportal/Index" && returnUrl == null) { model.PreviousLog = this.Request.UrlReferrer.AbsolutePath; } } catch { model.PreviousLog = returnUrl; } return(View(model)); }
public ActionResult ProductDetail(string pid) { Session["MyprodcutID"] = pid; pid = _encryptionService.DecryptString2(pid); Product pro = new Product(); pro = Mapper.Map <Product>(_productservice.GetProductByID(Convert.ToInt32(pid))); return(View(pro)); }
public ActionResult Index(string eid) { eid = _encryptionService.DecryptString2(eid); Int32 eduId = 0; if (eid == "" || eid == null) { eduId = EducationID; } else { eduId = Convert.ToInt32(eid); } EducationID = eduId; EducationTypesAvailableViewModel EducationTypesAvailableViewModel = new Domain.ViewModels.EducationTypeAvailableViewModel.EducationTypesAvailableViewModel(); EducationTypesAvailableViewModel.EducationTypesAvailableResults = Mapper.Map <IEnumerable <EducationTypesAvailable> >(_educationService.GetEducationTypeByEducationID(eduId)); EducationTypesAvailableViewModel.EducationDetailPageResults = Mapper.Map <EducationDetailPageWithEducation>(_educationService.GetEducationDetailPageContent(eduId)); EducationTypesAvailableViewModel.EducationCredentialResults = Mapper.Map <IEnumerable <EducationCredential> >(_educationService.GetEducationCredentialByEducationID(eduId)); EducationTypesAvailableViewModel.Education = Mapper.Map <Education>(_educationService.GetEducationByID(eduId)); // string a = EducationTypesAvailableViewModel.Education.CourseStartDate.ToString("yyyy-MM-dd"); if (EducationTypesAvailableViewModel.Education.CourseStartDate <= DateTime.Now && EducationTypesAvailableViewModel.Education.CourseEndDate > DateTime.Now) { EducationTypesAvailableViewModel.Education.CanPurchase = true; } else { EducationTypesAvailableViewModel.Education.CanPurchase = false; } string decodedHTML = HttpUtility.HtmlDecode(EducationTypesAvailableViewModel.EducationDetailPageResults.PContent); if (decodedHTML != null) { EducationTypesAvailableViewModel.EducationDetailPageResults.PContent = decodedHTML.Replace(GlobalConst.Message.SlashStoragePath, GlobalConst.Message.StoragePath); EducationTypesAvailableViewModel.EducationDetailPageResults.PContent = EducationTypesAvailableViewModel.EducationDetailPageResults.PContent.Replace("/richtexteditor/", GlobalConst.Extension.http + GlobalConst.ConstantChar.Colon + GlobalConst.ConstantChar.ForwardSlash + GlobalConst.ConstantChar.ForwardSlash + Request.Url.Host.ToLower() + GlobalConst.ConstantChar.Colon + Request.Url.Port + "/richtexteditor/"); EducationTypesAvailableViewModel.EducationDetailPageResults.PContent = EducationTypesAvailableViewModel.EducationDetailPageResults.PContent.Replace(" ", ""); } else { EducationTypesAvailableViewModel.EducationDetailPageResults.PContent = EducationTypesAvailableViewModel.EducationDetailPageResults.PContent; } return(View(EducationTypesAvailableViewModel)); }
public ActionResult ChangePassword(string userid) { string[] DecryptData = new string[1]; DecryptData[0] = _encryptionService.DecryptString2(userid); var _data = DecryptData[0].Split(','); string _userId = _data[0]; DateTime _datetime = Convert.ToDateTime(_data[1]); DateTime date1 = _datetime; DateTime date2 = System.DateTime.Now; TimeSpan ts = date2 - date1; User user = new User(); user.UID = Convert.ToInt32(_userId); user.PasswordOTP = _encryptionService.EncryptString2(_data[2]); if (ts.TotalHours > 1) { ViewBag.Message = GlobalConst.Message.TimeExpired; } return(View(user)); }
public ActionResult Accreditation() { var _res = _clientService.GetOrganizationByID(HCRGUser != null ? HCRGUser.OrganizationID : int.Parse(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]))); if (_res != null) { if (_res.MenuIDs != null) { if (!_res.MenuIDs.Contains("3")) { return(RedirectToAction(GlobalConst.Actions.UserController.UnauthorisePage, GlobalConst.Controllers.User, new { area = "" })); } } } Accreditation accreditation = new Accreditation(); accreditation = Mapper.Map <Accreditation>(_newsService.GetAccreditationAll(HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]))))); if (accreditation != null) { string decodedHTML = HttpUtility.HtmlDecode(accreditation.AccreditationContent); if (decodedHTML != null) { accreditation.AccreditationContent = decodedHTML.Replace(GlobalConst.Message.SlashStoragePath, GlobalConst.Message.StoragePath); accreditation.AccreditationContent = accreditation.AccreditationContent.Replace("/richtexteditor/", GlobalConst.Extension.http + GlobalConst.ConstantChar.Colon + GlobalConst.ConstantChar.ForwardSlash + GlobalConst.ConstantChar.ForwardSlash + Request.Url.Host.ToLower() + GlobalConst.ConstantChar.Colon + Request.Url.Port + "/richtexteditor/"); accreditation.AccreditationContent = accreditation.AccreditationContent.Replace(" ", ""); } else { accreditation.AccreditationContent = decodedHTML; } } return(View(accreditation)); }
public ActionResult JoinFaculty(Faculty Faculty) { if (this.IsCaptchaValid("Captcha is not valid")) { Faculty.Resume = UpdateDocumentFile(Faculty.ResumeFile, Faculty.FirstName + "_" + Faculty.LastName + DateTime.Now.ToString("ddMMyyyyss")); Faculty.ResumeFile = null; Faculty.OrganizationID = HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]))); Faculty.FacultyID = _CollegeService.AddFaculty(Mapper.Map <HCRGUniversityApp.NEPService.CollegeService.Faculty>(Faculty)); ViewBag.ErrMessage = "Success"; Faculty = new Faculty(); ModelState.Clear(); ModelState.Remove("key"); return(View(new Faculty())); } else { ViewBag.ErrMessage = "Captcha Invalid."; } return(View(Faculty)); }
//[HttpPost] public JsonResult DecryptString() { var _res = _clientService.GetOrganizationByID(HCRGUser != null ? HCRGUser.OrganizationID : int.Parse(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]))); return(Json(_res, JsonRequestBehavior.AllowGet)); }
public ActionResult Index() { AboutUsViewModel aboutusModel = new AboutUsViewModel(); aboutusModel.AboutUSResults = Mapper.Map <IEnumerable <AboutUs> >(_aboutusService.getAllRecords((HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"])))))); foreach (AboutUs viewmodel in aboutusModel.AboutUSResults) { string decodedHTML = HttpUtility.HtmlDecode(viewmodel.Description); if (decodedHTML != null) { viewmodel.Description = decodedHTML.Replace(GlobalConst.Message.SlashStoragePath, GlobalConst.Message.StoragePath); viewmodel.Description = viewmodel.Description.Replace("/richtexteditor/", GlobalConst.Extension.http + GlobalConst.ConstantChar.Colon + GlobalConst.ConstantChar.ForwardSlash + GlobalConst.ConstantChar.ForwardSlash + Request.Url.Host.ToLower() + GlobalConst.ConstantChar.Colon + Request.Url.Port + "/richtexteditor/"); viewmodel.Description = viewmodel.Description.Replace(" ", ""); } else { viewmodel.Description = decodedHTML; } } return(View(aboutusModel)); }
public ActionResult Index(string id) { var _res = _clientService.GetOrganizationByID(HCRGUser != null ? HCRGUser.OrganizationID : int.Parse(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]))); if (_res != null) { if (_res.MenuIDs != null) { if (!_res.MenuIDs.Contains("1")) { return(RedirectToAction(GlobalConst.Actions.UserController.UnauthorisePage, GlobalConst.Controllers.User, new { area = "" })); } } } CollegeEducationViewModel collegeeducationviewmodel = new CollegeEducationViewModel(); if (id == null) { if (HCRGUser == null) { var getCollegeEducation = _educationService.GetEducationByEducationFormatIDORCollegeIDORDeptIDORPrfIDPaged(null, null, null, null, GlobalConst.Records.Skip, GlobalConst.Records.LandingTake, HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"])))); collegeeducationviewmodel.EducationDetailResults = Mapper.Map <IEnumerable <EducationDetail> >(getCollegeEducation.educationsDetail); collegeeducationviewmodel.TotalCount = getCollegeEducation.TotalCount; collegeeducationviewmodel.ShowOnlineCourseOnly = false; } else { var getCollegeEducation = _educationService.GetEducationByEducationFormatIDORCollegeIDORDeptIDORPrfIDPaged(null, null, null, HCRGUser.UID, GlobalConst.Records.Skip, GlobalConst.Records.LandingTake, HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"])))); collegeeducationviewmodel.EducationDetailResults = Mapper.Map <IEnumerable <EducationDetail> >(getCollegeEducation.educationsDetail); collegeeducationviewmodel.TotalCount = getCollegeEducation.TotalCount; collegeeducationviewmodel.ShowOnlineCourseOnly = false; } } else { if (HCRGUser == null) { var getCollegeEducation = _educationService.GetEducationByEducationFormatIDORCollegeIDORDeptIDORPrfIDPaged(null, 2, null, null, GlobalConst.Records.Skip, GlobalConst.Records.LandingTake, HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"])))); collegeeducationviewmodel.EducationDetailResults = Mapper.Map <IEnumerable <EducationDetail> >(getCollegeEducation.educationsDetail); collegeeducationviewmodel.TotalCount = getCollegeEducation.TotalCount; collegeeducationviewmodel.ShowOnlineCourseOnly = true; } else { var getCollegeEducation = _educationService.GetEducationByEducationFormatIDORCollegeIDORDeptIDORPrfIDPaged(null, 2, null, HCRGUser.UID, GlobalConst.Records.Skip, GlobalConst.Records.LandingTake, HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"])))); collegeeducationviewmodel.EducationDetailResults = Mapper.Map <IEnumerable <EducationDetail> >(getCollegeEducation.educationsDetail); collegeeducationviewmodel.TotalCount = getCollegeEducation.TotalCount; collegeeducationviewmodel.ShowOnlineCourseOnly = true; } } return(View(collegeeducationviewmodel)); }
public ActionResult Index(string SectionId) { var _res = _clientService.GetOrganizationByID(HCRGUser != null ? HCRGUser.OrganizationID : int.Parse(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]))); if (_res != null) { if (_res.MenuIDs != null) { if (!_res.MenuIDs.Contains("7")) { return(RedirectToAction(GlobalConst.Actions.UserController.UnauthorisePage, GlobalConst.Controllers.User, new { area = "" })); } } } //return Json(_res, JsonRequestBehavior.AllowGet); NewsDetailViewModel NewsDetail = new NewsDetailViewModel(); ViewBag.OrganizationID = _encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]); ViewBag.StoragePath = GlobalConst.Message.SlashStoragePath + GlobalConst.ConstantChar.ForwardSlash; NewsDetail.NewsSectionResults = Mapper.Map <IEnumerable <NewsSection> >(_newsService.getAllNewsSection(HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]))))); int?sectionId = null; if (SectionId != null) { sectionId = int.Parse(_encryptionService.DecryptString2(SectionId.ToString())); } if (sectionId == null) { var _newsData = _newsService.GetAllNewsDetail("All", 0, GlobalConst.Records.Take, HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"])))); NewsDetail.NewsResults = Mapper.Map <IEnumerable <NewsFullDetail> >(_newsData.NewsFullDetailRecords); foreach (NewsFullDetail _newsFullDetail in NewsDetail.NewsResults) { _newsFullDetail.EncryptedNewsID = _encryptionService.EncryptString2(_newsFullDetail.NewsID.ToString()); } NewsDetail.TotalCount = _newsData.TotalCount; } else { var _newsData = _newsService.GetAllNewsDetailByNewsSectionIDAndType("All", sectionId.Value, 0, GlobalConst.Records.Take, HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"])))); NewsDetail.NewsResults = Mapper.Map <IEnumerable <NewsFullDetail> >(_newsData.NewsFullDetailRecords); foreach (NewsFullDetail _newsFullDetail in NewsDetail.NewsResults) { _newsFullDetail.EncryptedNewsID = _encryptionService.EncryptString2(_newsFullDetail.NewsID.ToString()); } NewsDetail.TotalCount = _newsData.TotalCount; NewsDetail.SectionID = sectionId.Value; } NewsDetail.newsLetter = Mapper.Map <NewsLetter>(_newsService.GetNewsLetterAll(HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]))))); if (NewsDetail.newsLetter != null) { string decodedHTML = HttpUtility.HtmlDecode(NewsDetail.newsLetter.NewsLetterContent); if (decodedHTML != null) { NewsDetail.newsLetter.NewsLetterContent = decodedHTML.Replace(GlobalConst.Message.SlashStoragePath, GlobalConst.Message.StoragePath); } else { NewsDetail.newsLetter.NewsLetterContent = decodedHTML; } } foreach (NewsFullDetail viewmodel in NewsDetail.NewsResults) { viewmodel.NewsDescription = HttpUtility.HtmlDecode(viewmodel.NewsDescription); Regex regex = new Regex("\\<[^\\>]*\\>"); viewmodel.NewsDescription = regex.Replace(viewmodel.NewsDescription, String.Empty); bool IsVideo = viewmodel.NewsDescription.Contains("Video"); if (IsVideo) { viewmodel.NewsDescription = "Video"; } if (viewmodel.NewsDescription.Length > 1000) { viewmodel.NewsDescription = regex.Replace(viewmodel.NewsDescription, String.Empty).Substring(0, 1000); } } return(View(NewsDetail)); }
public ActionResult PreTest(string educationID, string meID) { educationID = _encryptionService.DecryptString2(educationID); meID = _encryptionService.DecryptString2(meID); PreTestQuestionDetailViewModel preTestQuestionDetailViewModel = new PreTestQuestionDetailViewModel(); preTestQuestionDetailViewModel.PreTestAttemptByUser = _examInternalService.GetPreTestAttemptByUser(HCRGUser.UID, Convert.ToInt32(meID)); if (preTestQuestionDetailViewModel.PreTestAttemptByUser < 1) { preTestQuestionDetailViewModel.PreTestQuestionDetailResults = Mapper.Map <IEnumerable <PreTestQuestionDetail> >(_examService.GetAllPreTestQuestionDetailByEID(Convert.ToInt32(educationID))); } return(View(preTestQuestionDetailViewModel)); }
public ActionResult Index() { if (HCRGUser != null) { if (HCRGUser.PageName == "StudentPortal") { return(RedirectToAction(GlobalConst.Actions.MyEducationController.Index, GlobalConst.Controllers.MyEducation, new { area = "" })); } } HomeViewModel homeModel = new HomeViewModel(); HomeContent homecontent = new HomeContent(); homecontent = Mapper.Map <HomeContent>(_newsService.GetHomeContent(HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]))))); string decodedHTML = HttpUtility.HtmlDecode(homecontent.HomePageContent); if (decodedHTML != null) { homeModel.HomePageContent = decodedHTML.Replace(GlobalConst.Message.SlashStoragePath, GlobalConst.Message.StoragePath); homeModel.HomePageContent = homeModel.HomePageContent.Replace("/richtexteditor/", GlobalConst.Extension.http + GlobalConst.ConstantChar.Colon + GlobalConst.ConstantChar.ForwardSlash + GlobalConst.ConstantChar.ForwardSlash + Request.Url.Host.ToLower() + GlobalConst.ConstantChar.Colon + Request.Url.Port + "/richtexteditor/"); homeModel.HomePageContent = homeModel.HomePageContent.Replace(" ", ""); } else { homeModel.HomePageContent = decodedHTML; } if (HCRGUser != null) { homeModel.EducationResults = Mapper.Map <IEnumerable <Education> >(_educationService.GetEducationLatest(HCRGUser.UID, HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]))))); } else { homeModel.EducationResults = Mapper.Map <IEnumerable <Education> >(_educationService.GetEducationLatest(0, HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]))))); } foreach (Education _education in homeModel.EducationResults) { _education.EncrptedEducationID = _encryptionService.EncryptString2(_education.EducationID.ToString()); } homeModel.NewsResults = Mapper.Map <IEnumerable <News> >(_newsService.GetNewslatest(HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]))))); foreach (News viewmodel in homeModel.NewsResults) { viewmodel.NewsDateFormatted = viewmodel.NewsDate.ToString("D"); viewmodel.EncryptedNewsID = _encryptionService.EncryptString2(viewmodel.NewsID.ToString()); } homeModel.EventDetails = Mapper.Map <IEnumerable <HCRGUniversityApp.Domain.Models.Event.EventDetail> >(_newsService.GetEventsUpcoming(HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]))))); foreach (EventDetail eventViewmodel in homeModel.EventDetails) { if (eventViewmodel.EducationID != null) { eventViewmodel.pageUrl = GlobalConst.routeedURL.courseDetailPage + _encryptionService.EncryptString2(eventViewmodel.EducationID.ToString()); } else if (eventViewmodel.NewsID != null) { eventViewmodel.pageUrl = GlobalConst.routeedURL.newsDetailPage + _encryptionService.EncryptString2(eventViewmodel.NewsID.ToString()) + '/' + eventViewmodel.NewsType; } else { eventViewmodel.pageUrl = "#"; } } return(View(homeModel)); }
public ActionResult Index() { var _res = _clientService.GetOrganizationByID(HCRGUser != null ? HCRGUser.OrganizationID : int.Parse(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]))); if (_res != null) { if (_res.MenuIDs != null) { if (!_res.MenuIDs.Contains("6")) { return(RedirectToAction(GlobalConst.Actions.UserController.UnauthorisePage, GlobalConst.Controllers.User, new { area = "" })); } } } UserSubscription _userSubscription = new UserSubscription(); _userSubscription = Mapper.Map <UserSubscription>(_userService.GetUserSubscriptionDetails()); return(View(_userSubscription)); }
public ActionResult getEvents(double start, double end) { var startDate = ConvertFromUnixTimestamp(start); var endDate = ConvertFromUnixTimestamp(end); var coursesList = _educationService.GetOnSiteEducationByStartDate(startDate, endDate); var eventsList = _newsService.GetEventsByEventDateRange(startDate, endDate, HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"])))); int _orgID = HCRGUser != null ? HCRGUser.OrganizationID : (Convert.ToInt32(_encryptionService.DecryptString2(System.Configuration.ConfigurationManager.AppSettings["OrganizationID"]))); var filterEventsList1 = (from evnt in eventsList where !coursesList.Any(hp => (hp.EducationID == evnt.EducationID) && (hp.CourseStartDate == evnt.EventDate)) select evnt).ToList(); var eventList1 = (from e in coursesList select new { id = e.EducationID, title = e.CourseName, start = e.CourseStartDate.Value.ToString("s"), eventDesc = "", CourseLocation = (e.CourseLocation == null) ? "" : e.CourseLocation, courseStartTime = (e.CourseStartTime == null) ? "" : e.CourseStartTime, CoursePresenterName = (e.CoursePresenterName == null) ? "" : e.CoursePresenterName, coursePageUrl = ".." + GlobalConst.routeedURL.courseDetailPage + _encryptionService.EncryptString2(e.EducationID.ToString()), eventType = "OnSiteCourse", EventCourseNews = e.CourseName, OrganizationID = _orgID }).ToList(); var eventList2 = (from e in filterEventsList1.Where(hp => hp.NewsID != null) select new { id = (int)e.NewsID, title = e.EventName, start = e.EventDate.ToString("s"), eventDesc = e.EventDescription, CourseLocation = "", courseStartTime = "", CoursePresenterName = "", coursePageUrl = ".." + GlobalConst.routeedURL.newsDetailPage + _encryptionService.EncryptString2(e.NewsID.ToString()) + "/" + e.NewsType, eventType = "News", EventCourseNews = e.NewsTitle, OrganizationID = e.OrganizationID }).ToList(); var eventList3 = (from e in filterEventsList1.Where(hp => hp.EducationID != null) select new { id = (int)e.EducationID, title = e.EventName, start = e.EventDate.ToString("s"), eventDesc = e.EventDescription, CourseLocation = "", courseStartTime = "", CoursePresenterName = "", coursePageUrl = ".." + GlobalConst.routeedURL.courseDetailPage + _encryptionService.EncryptString2(e.EducationID.ToString()), eventType = "EventCourse", EventCourseNews = e.CourseName, OrganizationID = e.OrganizationID }).ToList(); var finalResult = eventList1.Union(eventList2.Union(eventList3)); return(Json(finalResult.ToArray(), JsonRequestBehavior.AllowGet)); }