public async Task <IActionResult> Edit(int id, [Bind("Id,ManuscriptId,CountryId,UniversityId,AuthorUserId,DateOfRecord,Indx,Email,Contribution")] ArticleAuthorship articleAuthorship) { if (id != articleAuthorship.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(articleAuthorship); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ArticleAuthorshipExists(articleAuthorship.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Create", "ArticleAuthorships", new { /* routeValues, for example: */ mid = articleAuthorship.ManuscriptId })); } ViewData["AuthorUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", articleAuthorship.AuthorUserId); ViewData["CountryId"] = new SelectList(_context.Countries, "Id", "ArCountryName", articleAuthorship.CountryId); ViewData["ManuscriptId"] = new SelectList(_context.Manuscripts, "Id", "ArAbstract", articleAuthorship.ManuscriptId); ViewData["UniversityId"] = new SelectList(_context.Universities, "Id", "ArUniversityName", articleAuthorship.UniversityId); return(View(articleAuthorship)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,CommunityId,ApplicationUserId,NotifyMe,IsAdmin,IsAccepted")] CommunityFollower communityFollower) { if (id != communityFollower.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(communityFollower); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CommunityFollowerExists(communityFollower.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index), new { id = communityFollower.CommunityId })); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", communityFollower.ApplicationUserId); ViewData["CommunityId"] = new SelectList(_context.Communities, "Id", "BgImage", communityFollower.CommunityId); return(View(communityFollower)); }
public async Task <IActionResult> Create(string uid, [Bind("RecordDate,Details,Amount,Destination,ApplicationUserId,BalanceType")] Statement statement) { if (ModelState.IsValid) { if (statement.Details != null) { statement.Details = statement.Details.Replace("\n", "<br/>"); } _context.Add(statement); var user = _context.ApplicationUsers.SingleOrDefault(a => a.Id == statement.ApplicationUserId); if (statement.Destination == true) { user.Balance = user.Balance + statement.Amount; _context.Update(user); } else { user.Balance = user.Balance - statement.Amount; _context.Update(user); } await _context.SaveChangesAsync(); return(RedirectToAction(nameof(UserStatements), new { id = uid })); } //ViewData["FromApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", statement.ApplicationUser); return(View(statement)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,SubmissionId,JournalFileTypeId,FileName,Description")] SubmissionFile submissionFile, IFormFile myfile) { if (id != submissionFile.Id) { return(NotFound()); } if (ModelState.IsValid) { try { submissionFile.FileName = await UserFile.UploadeNewFileAsync(submissionFile.FileName, myfile, _environment.WebRootPath, Properties.Resources.Secured); _context.Update(submissionFile); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SubmissionFileExists(submissionFile.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Create", "SubmissionFiles", new { /* routeValues, for example: */ sid = submissionFile.SubmissionId })); } ViewData["JournalFileTypeId"] = new SelectList(_context.JournalFileTypes, "Id", "Id", submissionFile.JournalFileTypeId); ViewData["SubmissionId"] = new SelectList(_context.Submissions, "Id", "CoverLetter", submissionFile.SubmissionId); return(View(submissionFile)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,FullAddress,PhoneNumber,AddressSaveName,ArName,EnName,ApplicationUserId,IsDeleted,CountryId,CityId,UniversityId,FacultyId")] Address address) { if (id != address.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(address); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AddressExists(address.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", address.ApplicationUserId); ViewData["CityId"] = new SelectList(_context.Cities, "Id", "ArCityName", address.CityId); ViewData["CountryId"] = new SelectList(_context.Countries, "Id", "ArCountryName", address.CountryId); ViewData["FacultyId"] = new SelectList(_context.Faculties, "Id", "ArFacultyName", address.FacultyId); ViewData["UniversityId"] = new SelectList(_context.Universities, "Id", "ArUniversityName", address.UniversityId); return(View(address)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,SpecialityId,UserId")] Expertise expertise) { if (id != expertise.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(expertise); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ExpertiseExists(expertise.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["SpecialityId"] = new SelectList(_context.Specialities, "Id", "Name", expertise.SpecialityId); return(View(expertise)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Indx,CourseId,Logo,Link")] CourseSponsor courseSponsor, IFormFile myfile) { if (id != courseSponsor.Id) { return(NotFound()); } if (ModelState.IsValid) { courseSponsor.Logo = await UserFile.UploadeNewImageAsync(courseSponsor.Logo, myfile, _environment.WebRootPath, Properties.Resources.ScientificEvent, 500, 500); try { _context.Update(courseSponsor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CourseSponsorExists(courseSponsor.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CourseId"] = new SelectList(_context.Courses, "Id", "ArName", courseSponsor.CourseId); return(View(courseSponsor)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,PostCommentId,ApplicationUserId,VoteValue,Date,ReportType")] CommentMetric commentMetric) { if (id != commentMetric.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(commentMetric); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CommentMetricExists(commentMetric.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", commentMetric.ApplicationUserId); ViewData["PostCommentId"] = new SelectList(_context.PostComments, "Id", "Comment", commentMetric.PostCommentId); return(View(commentMetric)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Subject,Content,DateOfRecord,DateOfRead,FromApplicationUserId,ToApplicationUserId,IsRead,IsDeleted,IsReported,Attachment")] Message message) { if (id != message.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(message); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MessageExists(message.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["FromApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", message.FromApplicationUserId); ViewData["ToApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", message.ToApplicationUserId); return(View(message)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Type")] ArticleType articleType) { if (id != articleType.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(articleType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ArticleTypeExists(articleType.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(articleType)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,JournalId,SpecialityId")] JournalSpeciality journalSpeciality) { if (id != journalSpeciality.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(journalSpeciality); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!JournalSpecialityExists(journalSpeciality.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["JournalId"] = new SelectList(_context.Journals, "Id", "ArName", journalSpeciality.JournalId); ViewData["SpecialityId"] = new SelectList(_context.Specialities, "Id", "EnSpecialityName", journalSpeciality.SpecialityId); return(View(journalSpeciality)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ExpertiseId,ApplicationUserId")] UserExpertise userExpertise) { if (id != userExpertise.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(userExpertise); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExpertiseExists(userExpertise.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } var expertiseList = _context.Expertises .Where(e => string.IsNullOrEmpty(e.UserId)); ViewData["ExpertiseId"] = new SelectList(expertiseList, "Id", "Name", userExpertise.ExpertiseId); return(View(userExpertise)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,JournalId,Title,Body,Direction,Releasedate")] JournalPage journalPage) { if (id != journalPage.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(journalPage); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!JournalPageExists(journalPage.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["JournalId"] = new SelectList(_context.Journals, "Id", "ArName", journalPage.JournalId); return(View(journalPage)); }
public async Task <IActionResult> Edit(int jid, int id, [Bind("Id,Year,Description,JournalId,IsPublished,Name")] Volume volume) { if (id != volume.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(volume); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VolumeExists(volume.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index", new { id = jid })); } ViewData["JournalId"] = new SelectList(_context.Journals, "Id", "ArName", volume.JournalId); return(View(volume)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ArPositionName,EnPositionName,IsApproved")] PositionType positionType) { if (id != positionType.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(positionType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PositionTypeExists(positionType.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(positionType)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,RegistrationFormId,ApplicationUserId,CreationDate")] UserExpressInterest userExpressInterest) { if (id != userExpressInterest.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(userExpressInterest); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExpressInterestExists(userExpressInterest.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", userExpressInterest.ApplicationUserId); ViewData["RegistrationFormId"] = new SelectList(_context.RegistrationForms, "Id", "Id", userExpressInterest.RegistrationFormId); return(View(userExpressInterest)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ApplicationUserId,ArProjectName,EnProjectName,ArDescription,EnDescription,ArDetails,EnDetails,CountryId,ProjectState,FromYear,ToYear")] Project project) { if (id != project.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(project); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProjectExists(project.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CountryId"] = new SelectList(_context.Countries, "Id", "ArCountryName", project.CountryId); return(View(project)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ApplicationUserId,ArDescription,EnDescription,ArTitle,EnTitle,IsCurrent,FromYear,ToYear,Indx")] TeachingExperience teachingExperience) { if (id != teachingExperience.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(teachingExperience); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TeachingExperienceExists(teachingExperience.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(teachingExperience)); }
public async Task <IActionResult> Edit( int id, [Bind("Id,ArCountryName,EnCountryName,CountryCode,ShortName,Flag")] Country country, IFormFile myfile) { if (id != country.Id) { return(NotFound()); } if (ModelState.IsValid) { try { country.Flag = await UserFile.UploadeNewImageAsync( _context.Countries.Where(m => m.Id == id).Select(c => c.Flag).First(), myfile, _environment.WebRootPath, Properties.Resources.CountryFlagFolder, 100, 100); _context.Update(country); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CountryExists(country.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(country)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Question,CourseChapterId,Indx,IsHidden,Description,Imgurl")] CourseChapterExam courseChapterExam, IFormFile myfile) { if (id != courseChapterExam.Id) { return(NotFound()); } if (ModelState.IsValid) { try { courseChapterExam.Imgurl = await UserFile.UploadeNewImageAsync(courseChapterExam.Imgurl, myfile, _environment.WebRootPath, Properties.Resources.Secured, 500, 500); _context.Update(courseChapterExam); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CourseChapterExamExists(courseChapterExam.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Edit", "CourseChapters", new { id = courseChapterExam.CourseChapterId })); } return(View(courseChapterExam)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,ApplicationUserId,ScoreValueId,PostId,Date")] ScoreLog scoreLog) { if (id != scoreLog.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(scoreLog); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ScoreLogExists(scoreLog.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", scoreLog.ApplicationUserId); ViewData["PostId"] = new SelectList(_context.Posts, "Id", "Body", scoreLog.PostId); ViewData["ScoreValueId"] = new SelectList(_context.ScoreValues, "Id", "Id", scoreLog.ScoreValueId); return(View(scoreLog)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ApplicationUserId,Description,OriginalImage,ThumbImage")] Gallary gallary) { if (id != gallary.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(gallary); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GallaryExists(gallary.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", gallary.ApplicationUserId); return(View(gallary)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Title,Description,Image,ExternalLink,Controller,Action,Indx,Hits,Date,IsVisible,ApplicationUserId,AdsPositionType,TargetType")] SideAd sideAds) { if (id != sideAds.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sideAds); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SideAdsExists(sideAds.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", sideAds.ApplicationUserId); return(View(sideAds)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,MembershipType,CreationDate,DueDate,ApplicationUserId,Status")] Membership membership) { if (id != membership.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(membership); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MembershipExists(membership.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", membership.ApplicationUserId); return(View(membership)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,EditorUserId,EditorDateTime,PostId,Title,Body")] PostRevision postRevision) { if (id != postRevision.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(postRevision); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PostRevisionExists(postRevision.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["EditorUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", postRevision.EditorUserId); ViewData["PostId"] = new SelectList(_context.Posts, "Id", "Body", postRevision.PostId); return(View(postRevision)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Indx,CourseId,Description,ApplicationUserId")] CourseInstructor courseInstructor) { if (id != courseInstructor.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(courseInstructor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CourseInstructorExists(courseInstructor.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", courseInstructor.ApplicationUserId); ViewData["CourseId"] = new SelectList(_context.Courses, "Id", "ArName", courseInstructor.CourseId); return(View(courseInstructor)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ApplicationUserId,AnswerDate,CourseChapterChoiceId")] CourseChapterExamLog courseChapterExamLog) { if (id != courseChapterExamLog.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(courseChapterExamLog); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CourseChapterExamLogExists(courseChapterExamLog.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", courseChapterExamLog.ApplicationUserId); return(View(courseChapterExamLog)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,EnSpecialityName")] Speciality speciality) { if (id != speciality.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(speciality); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SpecialityExists(speciality.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(speciality)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ApplicationUserId,JournalId,Description,JoinDate,IsActive,RoleId")] AreaEditor areaEditor) { if (id != areaEditor.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(areaEditor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AreaEditorExists(areaEditor.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index", "AreaEditors", new { /* routeValues, for example: */ id = areaEditor.JournalId })); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", areaEditor.ApplicationUserId); ViewData["JournalId"] = new SelectList(_context.Journals, "Id", "ArName", areaEditor.JournalId); return(View(areaEditor)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,ApplicationUserId,EmailContentId")] SentEmailRecords sentEmailRecords) { if (id != sentEmailRecords.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sentEmailRecords); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SentEmailRecordsExists(sentEmailRecords.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", sentEmailRecords.ApplicationUserId); return(View(sentEmailRecords)); }