public async Task <IActionResult> Register(int indx, string contr, int maid, [Bind("Id,UILanguage,ReferredById,ArName,EnName,Email,Password,CountryId,UniversityId")] RegisterFromOutsideViewModel registerFromOutsideViewModel) { _context.ApplicationUsers.Add(new ApplicationUser { PasswordHash = null, UserName = registerFromOutsideViewModel.Email, Email = registerFromOutsideViewModel.Email, // Added by Alrshah ============================================================================================= ArName = registerFromOutsideViewModel.ArName, EnName = registerFromOutsideViewModel.EnName, //DateofBirth = model.DateofBirth, //Gender = model.Gender, UILanguage = registerFromOutsideViewModel.UILanguage, CityId = 1, CountryId = registerFromOutsideViewModel.CountryId, FacultyId = 1, UniversityId = registerFromOutsideViewModel.UniversityId, Status = StatusType.New, RegDate = DateTime.Now, ARID = 0, ReferredById = registerFromOutsideViewModel.ReferredById, Visitors = 0, DAL = Guid.NewGuid().ToString(), DALEnabled = true, }); _context.SaveChanges(); var userid = _context.ApplicationUsers.Where(a => a.ReferredById == registerFromOutsideViewModel.ReferredById).OrderByDescending(a => a.RegDate).First().Id; _context.ArticleAuthorships.Add(new ArticleAuthorship { AuthorUserId = userid, ManuscriptId = maid, CountryId = registerFromOutsideViewModel.CountryId, UniversityId = registerFromOutsideViewModel.UniversityId, Email = registerFromOutsideViewModel.Email, Indx = indx, Contribution = contr, }); _context.SaveChanges(); return(RedirectToAction("Create", "ArticleAuthorships", new { /* routeValues, for example: */ mid = maid })); }
public async Task <IActionResult> Register(int maid, string eicins, ReviewerStatus rs, DateTime date, [Bind("Id,UILanguage,ReferredById,ArName,EnName,Email,Password,CountryId,UniversityId")] RegisterFromOutsideViewModel registerFromOutsideViewModel) { _context.ApplicationUsers.Add(new ApplicationUser { UserName = registerFromOutsideViewModel.Email, Email = registerFromOutsideViewModel.Email, // Added by Alrshah ============================================================================================= ArName = registerFromOutsideViewModel.ArName, EnName = registerFromOutsideViewModel.EnName, //DateofBirth = model.DateofBirth, //Gender = model.Gender, UILanguage = registerFromOutsideViewModel.UILanguage, CityId = 1, CountryId = registerFromOutsideViewModel.CountryId, FacultyId = 1, UniversityId = registerFromOutsideViewModel.UniversityId, Status = StatusType.New, RegDate = DateTime.Now, ARID = 0, ReferredById = registerFromOutsideViewModel.ReferredById, Visitors = 0, DAL = Guid.NewGuid().ToString(), DALEnabled = true }); _context.SaveChanges(); var userid = _context.ApplicationUsers.Where(a => a.ReferredById == registerFromOutsideViewModel.ReferredById).OrderByDescending(a => a.RegDate).First().Id; _context.SubmissionReviewers.Add(new SubmissionReviewer { ReviewerUserId = userid, SubmissionId = _context.Submissions.Where(a => a.SubmissionStatus == SubmissionStatus.Submitted).SingleOrDefault(a => a.ManuscriptId == maid).Id, DueDate = date, ReviewerStatus = rs, EICInstructions = eicins, ReviewerDecisionToReview = ReviewerDecisionToReview.WaitingInvitationAcceptance }); _context.SaveChanges(); return(RedirectToAction("Details", "Manuscripts", new { /* routeValues, for example: */ id = maid })); }
public async Task <IActionResult> Register(bool cra, bool cre, SuggestionStatus sstatus, string ros, int maid, [Bind("Id,UILanguage,ReferredById,ArName,EnName,Email,Password,CountryId,UniversityId")] RegisterFromOutsideViewModel registerFromOutsideViewModel) { _context.ApplicationUsers.Add(new ApplicationUser { UserName = registerFromOutsideViewModel.Email, Email = registerFromOutsideViewModel.Email, // Added by Alrshah ============================================================================================= ArName = registerFromOutsideViewModel.ArName, EnName = registerFromOutsideViewModel.EnName, //DateofBirth = model.DateofBirth, //Gender = model.Gender, UILanguage = registerFromOutsideViewModel.UILanguage, CityId = 1, CountryId = registerFromOutsideViewModel.CountryId, FacultyId = 1, UniversityId = registerFromOutsideViewModel.UniversityId, Status = StatusType.New, RegDate = DateTime.Now, ARID = 0, ReferredById = registerFromOutsideViewModel.ReferredById, Visitors = 0, DAL = Guid.NewGuid().ToString(), DALEnabled = true }); _context.SaveChanges(); var userid = _context.ApplicationUsers.Where(a => a.ReferredById == registerFromOutsideViewModel.ReferredById).OrderByDescending(a => a.RegDate).First().Id; _context.SuggestedReviewers.Add(new SuggestedReviewer { ReviewerUserId = userid, ManuscriptId = maid, SuggestionStatus = sstatus, CanReviewArabic = cra, CanReviewEnglish = cre, ReasonForSuggesion = ros, }); _context.SaveChanges(); return(RedirectToAction("Create", "SuggestedReviewers", new { /* routeValues, for example: */ mid = maid })); }