public ActionResult Payments() { List <ViewModelConference> results = new List <ViewModelConference>(); using (IcasieEntities entity = new IcasieEntities()) { var conferences = entity.Conferences.ToList(); foreach (var item in conferences) { ViewModelConference newConf = new ViewModelConference(); newConf.PaperSubActive = false; if (item.PaperSubStartDate <= DateTime.Now && item.PaperSubEndDate >= DateTime.Now) { newConf.PaperSubActive = true; } //fill the properties newConf.ConferenceId = item.ConferenceId; newConf.Name = item.Name; newConf.StartDate = item.StartDate; newConf.EndDate = item.EndDate; newConf.PaperSubStartDate = item.PaperSubStartDate; newConf.PaperSubEndDate = item.PaperSubEndDate; results.Add(newConf); } } return(View(results)); }
public ActionResult Assign(int id) { //get user credential string currentUserEmail = HttpContext.User.Identity.Name; ViewModelConference newConf = new ViewModelConference(); PrepareSelectList(); using (IcasieEntities entity = new IcasieEntities()) { var subThemes = entity.SubThemes.ToList(); var conference = entity.Conferences.SingleOrDefault(c => c.ConferenceId == id); //fill the properties newConf.ConferenceId = conference.ConferenceId; newConf.Name = conference.Name; newConf.StartDate = conference.StartDate; newConf.EndDate = conference.EndDate; newConf.PaperSubStartDate = conference.PaperSubStartDate; newConf.PaperSubEndDate = conference.PaperSubEndDate; newConf.Submissions = new List <ViewModelSubmission>(); var uses = entity.Users.ToList(); var submissions = entity.Submissions.Where(c => c.ConferenceId == conference.ConferenceId); foreach (var subItem in submissions) { var user = uses.SingleOrDefault(c => c.UserId == subItem.UserId); var formatChecker = uses.SingleOrDefault(c => c.UserId == subItem.FormatCheckerId); var reviwer = uses.SingleOrDefault(c => c.UserId == subItem.ReviewedBy); var proofReader = uses.SingleOrDefault(c => c.UserId == subItem.ProofReaderId); ViewModelSubmission newSubmission = new ViewModelSubmission(); newSubmission.UserId = subItem.UserId; newSubmission.AuthorName = user.FirstName + " " + user.LastName; newSubmission.ConferenceId = subItem.ConferenceId; newSubmission.FullPaperStatus = subItem.FullPaperStatus; newSubmission.Title = subItem.Title; newSubmission.SubmissionId = subItem.SubmissionId; newSubmission.Number = subItem.PaperNumber; newSubmission.SubThemesId = subItem.SubThemesId; newSubmission.SubThemes = subThemes.FirstOrDefault(c => c.SubThemesId == subItem.SubThemesId).Title; newSubmission.PaymentTypeString = subItem.PaymentType == Constant.PaymentType.Full ? Constant.PaymentType.FullString : Constant.PaymentType.PartialString; newSubmission.PaymentType = subItem.PaymentType; newSubmission.FormatCheckerName = subItem.FormatCheckerId.HasValue ? formatChecker.FirstName + " " + formatChecker.LastName : ""; newSubmission.FormatCheckerId = subItem.FormatCheckerId.HasValue ? subItem.FormatCheckerId.Value : 0; newSubmission.ReviewerName = subItem.ReviewedBy.HasValue ? reviwer.FirstName + " " + reviwer.LastName : ""; newSubmission.ReviewedBy = subItem.ReviewedBy.HasValue ? subItem.ReviewedBy.Value : 0; newSubmission.ProofReaderName = subItem.ProofReaderId.HasValue ? proofReader.FirstName + " " + proofReader.LastName : ""; newSubmission.ProofReaderId = subItem.ProofReaderId.HasValue ? subItem.ProofReaderId.Value : 0; newConf.Submissions.Add(newSubmission); } } return(View(newConf)); }
public ActionResult Create(ViewModelConference model) { DateTime outStartDate = new DateTime(); DateTime outEndDate = new DateTime(); DateTime outPaperStartDate = new DateTime(); DateTime outPaperEndDate = new DateTime(); IFormatProvider provider = CultureInfo.CurrentCulture; if (!DateTime.TryParseExact(model.StartDateString, Constant.DateFormatInput, provider, DateTimeStyles.None, out outStartDate)) { ModelState.AddModelError("StartDateString", "Start Date format is not valid"); } if (!DateTime.TryParseExact(model.EndDateString, Constant.DateFormatInput, provider, DateTimeStyles.None, out outEndDate)) { ModelState.AddModelError("EndDateString", "End Date format is not valid"); } if (!DateTime.TryParseExact(model.PaperSubStartDateString, Constant.DateFormatInput, provider, DateTimeStyles.None, out outPaperStartDate)) { ModelState.AddModelError("PaperSubStartDateString", "Paper Submission Start Date format is not valid"); } if (!DateTime.TryParseExact(model.PaperSubEndDateString, Constant.DateFormatInput, provider, DateTimeStyles.None, out outPaperEndDate)) { ModelState.AddModelError("PaperSubEndDateString", "Paper Submission End Date format is not valid"); } if (!ModelState.IsValid) { return(View(model)); } using (IcasieEntities entity = new IcasieEntities()) { Conference conference = new Conference(); var prefix = model.Name.Replace(" ", ""); prefix = prefix.ToUpper(); conference.Name = model.Name; conference.StartDate = outStartDate; conference.EndDate = outEndDate; conference.PaperSubStartDate = outPaperStartDate; conference.PaperSubEndDate = outPaperEndDate; conference.LastSequenceNumber = prefix + "-" + Constant.NumberSuffix; conference.LastParticipantNumber = prefix + "-PART-" + Constant.NumberSuffix; entity.Conferences.Add(conference); entity.SaveChanges(); } return(RedirectToAction("Index")); }
// // GET: /Administration/ public ActionResult ParticipantPayment(int id) { //get user credential string currentUserEmail = HttpContext.User.Identity.Name; List <ViewModelConference> confList = new List <ViewModelConference>(); using (IcasieEntities entity = new IcasieEntities()) { var conference = entity.Conferences.Where(c => c.ConferenceId == id).ToList(); foreach (var item in conference) { ViewModelConference newConf = new ViewModelConference(); newConf.PaperSubActive = false; if (item.PaperSubStartDate <= DateTime.Now && item.PaperSubEndDate >= DateTime.Now) { newConf.PaperSubActive = true; } //fill the properties newConf.ConferenceId = item.ConferenceId; newConf.Name = item.Name; newConf.StartDate = item.StartDate; newConf.EndDate = item.EndDate; newConf.PaperSubStartDate = item.PaperSubStartDate; newConf.PaperSubEndDate = item.PaperSubEndDate; newConf.Participants = new List <ViewModelParticipant>(); var participants = entity.Participants.Where(c => c.ConferenceId == item.ConferenceId); foreach (var subItem in participants) { var user = entity.Users.FirstOrDefault(c => c.UserId == subItem.UserId); ViewModelParticipant newParticipant = new ViewModelParticipant(); newParticipant.Name = user.FirstName + " " + user.LastName; newParticipant.UserId = subItem.UserId; newParticipant.ConferenceId = subItem.ConferenceId; newParticipant.ParticipantId = subItem.ParticipantId; newParticipant.Payment = subItem.Payment; newParticipant.PaymentDate = subItem.PaymentDate.ToString(Icasie.Helper.Constant.DateFormat); newParticipant.PaymentFileName = subItem.PaymentFileName; newParticipant.PaymentStatus = subItem.PaymentStatus; newParticipant.Number = subItem.Number; newParticipant.TotalPayment = subItem.TotalPayment; newConf.Participants.Add(newParticipant); } confList.Add(newConf); } } return(View(confList)); }
public ActionResult AuthorPayment(int id) { //get user credential string currentUserEmail = HttpContext.User.Identity.Name; ViewModelConference newConf = new ViewModelConference(); using (IcasieEntities entity = new IcasieEntities()) { var subThemes = entity.SubThemes.ToList(); var conference = entity.Conferences.SingleOrDefault(c => c.ConferenceId == id); //fill the properties newConf.ConferenceId = conference.ConferenceId; newConf.Name = conference.Name; newConf.StartDate = conference.StartDate; newConf.EndDate = conference.EndDate; newConf.PaperSubStartDate = conference.PaperSubStartDate; newConf.PaperSubEndDate = conference.PaperSubEndDate; newConf.Submissions = new List <ViewModelSubmission>(); var uses = entity.Users.ToList(); var submissions = entity.Submissions.Where(c => c.ConferenceId == conference.ConferenceId && (c.FullPaperStatus == Constant.FullPaperStatus.Pending || c.FullPaperStatus == Constant.FullPaperStatus.PaymentVerified)); foreach (var subItem in submissions) { var user = uses.SingleOrDefault(c => c.UserId == subItem.UserId); ViewModelSubmission newSubmission = new ViewModelSubmission(); newSubmission.UserId = subItem.UserId; newSubmission.PaymentVerificationDate = subItem.PaymentVerificationDate.HasValue ? subItem.PaymentVerificationDate.Value : newSubmission.PaymentVerificationDate; newSubmission.AuthorName = user.FirstName + " " + user.LastName; newSubmission.ConferenceId = subItem.ConferenceId; newSubmission.FullPaperStatus = subItem.FullPaperStatus; newSubmission.Title = subItem.Title; newSubmission.SubmissionId = subItem.SubmissionId; newSubmission.Number = subItem.PaperNumber; newSubmission.SubThemesId = subItem.SubThemesId; newSubmission.TotalPayment = subItem.TotalPayment.Value; newSubmission.SubThemes = subThemes.FirstOrDefault(c => c.SubThemesId == subItem.SubThemesId).Title; newSubmission.PaymentTypeString = subItem.PaymentType == Constant.PaymentType.Full ? Constant.PaymentType.FullString : Constant.PaymentType.PartialString; newSubmission.PaymentDate = subItem.PaymentDate; newConf.Submissions.Add(newSubmission); } } return(View(newConf)); }
public ActionResult Edit(ViewModelConference model) { DateTime outStartDate = new DateTime(); DateTime outEndDate = new DateTime(); DateTime outPaperStartDate = new DateTime(); DateTime outPaperEndDate = new DateTime(); IFormatProvider provider = CultureInfo.CurrentCulture; if (!DateTime.TryParseExact(model.StartDateString, Constant.DateFormatInput, provider, DateTimeStyles.None, out outStartDate)) { ModelState.AddModelError("StartDateString", "Start Date format is not valid"); } if (!DateTime.TryParseExact(model.EndDateString, Constant.DateFormatInput, provider, DateTimeStyles.None, out outEndDate)) { ModelState.AddModelError("EndDateString", "End Date format is not valid"); } if (!DateTime.TryParseExact(model.PaperSubStartDateString, Constant.DateFormatInput, provider, DateTimeStyles.None, out outPaperStartDate)) { ModelState.AddModelError("PaperSubStartDateString", "Paper Submission Start Date format is not valid"); } if (!DateTime.TryParseExact(model.PaperSubEndDateString, Constant.DateFormatInput, provider, DateTimeStyles.None, out outPaperEndDate)) { ModelState.AddModelError("PaperSubEndDateString", "Paper Submission End Date format is not valid"); } if (!ModelState.IsValid) { return(View(model)); } using (IcasieEntities entity = new IcasieEntities()) { var odlConf = entity.Conferences.SingleOrDefault(c => c.ConferenceId == model.ConferenceId); odlConf.Name = model.Name; odlConf.StartDate = outStartDate; odlConf.EndDate = outEndDate; odlConf.PaperSubStartDate = outPaperStartDate; odlConf.PaperSubEndDate = outPaperEndDate; entity.SaveChanges(); } return(RedirectToAction("Index")); }
public ActionResult Edit(int id) { ViewModelConference result = new ViewModelConference(); using (IcasieEntities entity = new IcasieEntities()) { var conf = entity.Conferences.SingleOrDefault(c => c.ConferenceId == id); result.Name = conf.Name; result.ConferenceId = conf.ConferenceId; result.StartDateString = conf.StartDate.ToString(Constant.DateFormatInput); result.EndDateString = conf.EndDate.ToString(Constant.DateFormatInput); result.PaperSubStartDateString = conf.PaperSubStartDate.ToString(Constant.DateFormatInput); result.PaperSubEndDateString = conf.PaperSubEndDate.ToString(Constant.DateFormatInput); } return(View(result)); }
public ActionResult Index() { //get user credential string currentUserEmail = HttpContext.User.Identity.Name; List <ViewModelConference> confList = new List <ViewModelConference>(); using (IcasieEntities entity = new IcasieEntities()) { var user = entity.Users.SingleOrDefault(c => c.Email == currentUserEmail); int userId = user.UserId; var subThemes = entity.SubThemes.ToList(); var conference = entity.Conferences.ToList(); foreach (var item in conference) { ViewModelConference newConf = new ViewModelConference(); newConf.PaperSubActive = false; if (item.PaperSubStartDate <= DateTime.Now && item.PaperSubEndDate >= DateTime.Now) { newConf.PaperSubActive = true; } //fill the properties newConf.ConferenceId = item.ConferenceId; newConf.Name = item.Name; newConf.StartDate = item.StartDate; newConf.EndDate = item.EndDate; newConf.PaperSubStartDate = item.PaperSubStartDate; newConf.PaperSubEndDate = item.PaperSubEndDate; newConf.Submissions = new List <ViewModelSubmission>(); var submissions = entity.Submissions.Where(c => c.UserId == userId && c.ConferenceId == item.ConferenceId); foreach (var subItem in submissions) { ViewModelSubmission newSubmission = new ViewModelSubmission(); newSubmission.UserId = subItem.UserId; newSubmission.ConferenceId = subItem.ConferenceId; newSubmission.FullPaperStatus = subItem.FullPaperStatus; newSubmission.FullPaperDate = subItem.FullPaperDate; newSubmission.PaymentDate = subItem.PaymentDate; newSubmission.Comment = subItem.Comment; newSubmission.Title = subItem.Title; newSubmission.SubmissionId = subItem.SubmissionId; newSubmission.Number = subItem.PaperNumber; newSubmission.SubThemesId = subItem.SubThemesId; newSubmission.SubThemes = subThemes.FirstOrDefault(c => c.SubThemesId == subItem.SubThemesId).Title; newSubmission.PaymentTypeString = subItem.PaymentType == Constant.PaymentType.Full ? Constant.PaymentType.FullString : Constant.PaymentType.PartialString; newSubmission.PaymentType = subItem.PaymentType; newSubmission.CoAuthors = subItem.CoAuthors; newSubmission.TotalPayment = subItem.TotalPayment.Value; if (subItem.ReviewedBy != null) { var reviewer = entity.Users.SingleOrDefault(c => c.UserId == subItem.ReviewedBy); newSubmission.ReviewerName = reviewer.FirstName + " " + reviewer.LastName; newSubmission.FullPaperReviewFileName = subItem.FullPaperReviewFileName; newSubmission.FullPaperReviewFileName2 = subItem.FullPaperReviewFileName2; newSubmission.FullPaperReviewFileName3 = subItem.FullPaperReviewFileName3; } if (subItem.ProofReaderId != null) { var proofReader = entity.Users.SingleOrDefault(c => c.UserId == subItem.ProofReaderId); newSubmission.ProofReaderName = proofReader.FirstName + " " + proofReader.LastName; newSubmission.ProofReaderResultFileName = subItem.ProofReadingResultFileName; } if (subItem.FormatCheckerId != null) { var formatChecker = entity.Users.SingleOrDefault(c => c.UserId == subItem.FormatCheckerId); newSubmission.FormatCheckerName = formatChecker.FirstName + " " + formatChecker.LastName; newSubmission.FormatCheckingResultFileName = subItem.FormatCheckingResultFileName; } newSubmission.ReviewDateString = subItem.ReviewDate.HasValue ? subItem.ReviewDate.Value.ToString(Constant.DateFormat) : string.Empty; newSubmission.ProofReadingDateString = subItem.ProofReadingDate.HasValue ? subItem.ProofReadingDate.Value.ToString(Constant.DateFormat) : string.Empty; newSubmission.FormatCheckingDateString = subItem.FormatCheckingDate.HasValue ? subItem.FormatCheckingDate.Value.ToString(Constant.DateFormat) : string.Empty; newConf.Submissions.Add(newSubmission); } confList.Add(newConf); } } return(View(confList)); }
public ActionResult Index(int id) { List <ViewModelConference> confList = new List <ViewModelConference>(); //get user credential string currentUserEmail = HttpContext.User.Identity.Name; using (IcasieEntities entity = new IcasieEntities()) { var conference = entity.Conferences.Where(c => c.ConferenceId == id).ToList(); var subThemes = entity.SubThemes.ToList(); var formatChecker = entity.Users.SingleOrDefault(c => c.Email == currentUserEmail); foreach (var item in conference) { ViewModelConference newConf = new ViewModelConference(); newConf.PaperSubActive = false; if (item.PaperSubStartDate <= DateTime.Now && item.PaperSubEndDate >= DateTime.Now) { newConf.PaperSubActive = true; } //fill the properties newConf.ConferenceId = item.ConferenceId; newConf.Name = item.Name; newConf.StartDate = item.StartDate; newConf.EndDate = item.EndDate; newConf.PaperSubStartDate = item.PaperSubStartDate; newConf.PaperSubEndDate = item.PaperSubEndDate; newConf.Submissions = new List <ViewModelSubmission>(); var submissions = entity.Submissions.Where(c => c.ConferenceId == item.ConferenceId && c.FormatCheckerId == formatChecker.UserId && (c.FullPaperStatus == Constant.FullPaperStatus.PaymentVerified || c.FullPaperStatus == Constant.FullPaperStatus.FormatRevised)); foreach (var subItem in submissions) { ViewModelSubmission newSubmission = new ViewModelSubmission(); newSubmission.UserId = subItem.UserId; var user = entity.Users.SingleOrDefault(c => c.UserId == newSubmission.UserId); newSubmission.AuthorName = user.FirstName + " " + user.LastName; newSubmission.ConferenceId = subItem.ConferenceId; newSubmission.FullPaperStatus = subItem.FullPaperStatus; newSubmission.FullPaper = subItem.FullPaper; newSubmission.FullPaperDate = subItem.FullPaperDate; newSubmission.FullPaperFileName = subItem.FullPaperFileName; newSubmission.Title = subItem.Title; newSubmission.SubmissionId = subItem.SubmissionId; newSubmission.Number = subItem.PaperNumber; newSubmission.SubThemesId = subItem.SubThemesId; newSubmission.SubThemes = subThemes.FirstOrDefault(c => c.SubThemesId == subItem.SubThemesId).Title; if (subItem.FormatCheckerId != null) { var formatCheckerId = entity.Users.SingleOrDefault(c => c.UserId == subItem.FormatCheckerId); newSubmission.FormatCheckerName = formatCheckerId.FirstName + " " + formatCheckerId.LastName; newSubmission.FormatCheckingResultFileName = subItem.FormatCheckingResultFileName; } newSubmission.FormatCheckingDateString = subItem.FormatCheckingDate.HasValue ? subItem.FormatCheckingDate.Value.ToString(Constant.DateFormat) : string.Empty; newConf.Submissions.Add(newSubmission); } confList.Add(newConf); } } return(View(confList)); }