public ActionResult Interpretation() { var applicationUser = UserManager.FindByIdAsync(User.Identity.GetUserId()); var model = new ProfileInterpreterViewModel { ApplicationUser = applicationUser.Result, FirstName = applicationUser.Result.FirstName, LastName = applicationUser.Result.LastName, }; return View(model); }
public ActionResult InterpreterMainLanguagePairLoad() { var repo = new Repository<ProfileLanguageModel>(DbCollection.ProfileLanguage); var listItem = repo.Gets().Where(m => m.AccountId.Equals(User.Identity.GetUserId()) && m.Type.Equals(2)).ToList(); var model = new ProfileInterpreterViewModel { ProfileLanguageList = listItem, }; return PartialView("_ProfileInterpreterMainLanguagePairLoadPartial", model); }
public ActionResult InterpreterBestRate() { var repo = new Repository<ProfileInterpreterRateModel>(DbCollection.ProfileInterpreterRate); var item = repo.Gets().Where(m => m.AccountId.Equals(User.Identity.GetUserId())).OrderByDescending(i => i.Id).FirstOrDefault() ?? new ProfileInterpreterRateModel(); var model = new ProfileInterpreterViewModel { ProfileRate = item, MinRatePerHourList = new SelectList(MyConstants.MinRatePerHourList(), "Name", "Name"), PreferredRatePerHourList = new SelectList(MyConstants.PreferredRatePerHourList(), "Name", "Name"), MinRatePerDayList = new SelectList(MyConstants.MinRatePerSourceWordList(), "Name", "Name"), PreferredRatePerDayList = new SelectList(MyConstants.PreferredRatePerSourceWordList(), "Name", "Name") }; return PartialView("_ProfileInterpreterRatePartial", model); }
public ActionResult InterpreterBestRate(ProfileInterpreterViewModel model) { var repo = new Repository<ProfileInterpreterRateModel>(DbCollection.ProfileInterpreterRate); var item = repo.Gets().FirstOrDefault(m => m.Id.Equals(model.ProfileRate.Id)); if (item != null) { item.MinRatePerHour = model.ProfileRate.MinRatePerHour; item.PreferredRatePerHour = model.ProfileRate.PreferredRatePerHour; item.MinRatePerDay = model.ProfileRate.MinRatePerDay; item.PreferredRatePerDay = model.ProfileRate.PreferredRatePerDay; repo.Update(item); } else { item = new ProfileInterpreterRateModel { AccountId = User.Identity.GetUserId(), MinRatePerHour = model.ProfileRate.MinRatePerHour, PreferredRatePerHour = model.ProfileRate.PreferredRatePerHour, MinRatePerDay = model.ProfileRate.MinRatePerDay, PreferredRatePerDay = model.ProfileRate.PreferredRatePerDay }; repo.Insert(item); } return Json(new { result = true, model }); }
public ActionResult InterpreterSince(ProfileInterpreterViewModel model) { var repo = new Repository<ProfileSinceModel>(DbCollection.ProfileSince); var item = repo.Gets().Where(m => m.AccountId.Equals(User.Identity.GetUserId()) && m.Type.Equals(2)).OrderByDescending(i => i.Id).FirstOrDefault(); if (item != null) { item.Since = model.ProfileSince.Since; repo.Update(item); } else { item = new ProfileSinceModel { AccountId = User.Identity.GetUserId(), Since = model.ProfileSince.Since, Type = 2 }; repo.Insert(item); } return Json(new { result = true, model }); }
public ActionResult InterpreterBestRateLoad() { var repo = new Repository<ProfileInterpreterRateModel>(DbCollection.ProfileInterpreterRate); var item = repo.Gets().Where(m => m.AccountId.Equals(User.Identity.GetUserId())).OrderByDescending(i => i.Id).FirstOrDefault() ?? new ProfileInterpreterRateModel(); var model = new ProfileInterpreterViewModel { ProfileRate = item }; return PartialView("_ProfileInterpreterRateLoadPartial", model); }
public ActionResult InterpreterSince() { var repo = new Repository<ProfileSinceModel>(DbCollection.ProfileSince); var item = repo.Gets().Where(m => m.AccountId.Equals(User.Identity.GetUserId()) && m.Type.Equals(2)).OrderByDescending(i => i.Id).FirstOrDefault(); var model = new ProfileInterpreterViewModel { ProfileSince = item, SinceList = new SelectList(MyConstants.SinceList(), "Name", "Name") }; return PartialView("_ProfileInterpreterSincePartial", model); }
//[ValidateAntiForgeryToken] public ActionResult InterpreterExpertise(ProfileInterpreterViewModel model) { var repo = new Repository<ProfileExpertiseModel>(DbCollection.ProfileExpertise); var listItem = repo.Gets().Where(m => m.AccountId.Equals(User.Identity.GetUserId()) && m.Type.Equals(2)).ToList(); foreach (var item in listItem) { repo.Delete(item.Id); } foreach (var item in model.ProfileExpertiseList) { item.AccountId = User.Identity.GetUserId(); item.Type = 2; repo.Insert(item); } if (string.IsNullOrEmpty(model.ExpertiseOther)) return Json(new { result = true, model }); var other = new ProfileExpertiseModel { AccountId = User.Identity.GetUserId(), Type = 2, Expertise = model.ExpertiseOther }; repo.Insert(other); return Json(new { result = true, model }); }
public ActionResult InterpreterExpertise() { var repo = new Repository<ProfileExpertiseModel>(DbCollection.ProfileExpertise); var listItem = repo.Gets().Where(m => m.AccountId.Equals(User.Identity.GetUserId()) && m.Type.Equals(2) & m.ExpertiseId != null).ToList(); var itemOrther = repo.Gets().FirstOrDefault(m => m.AccountId.Equals(User.Identity.GetUserId()) && m.Type.Equals(1) & m.ExpertiseId == null) ?? new ProfileExpertiseModel(); var repoExpertise = new Repository<ExpertiseModel>(DbCollection.Expertise); var listExpertise = repoExpertise.Gets().ToList(); var model = new ProfileInterpreterViewModel { ProfileExpertiseList = listItem, ExpertiseList = listExpertise, ExpertiseOther = itemOrther.Expertise }; return PartialView("_ProfileInterpreterExpertisePartial", model); }
//[ValidateAntiForgeryToken] public ActionResult InterpreterMainLanguagePair(ProfileInterpreterViewModel model) { var repo = new Repository<ProfileLanguageModel>(DbCollection.ProfileLanguage); var listItem = repo.Gets().Where(m => m.AccountId.Equals(User.Identity.GetUserId()) && m.Type.Equals(2)).ToList(); foreach (var profileLanguageModel in listItem) { repo.Delete(profileLanguageModel.Id); } foreach (var item in model.ProfileLanguageList) { item.AccountId = User.Identity.GetUserId(); item.Type = 2; repo.Insert(item); } if (string.IsNullOrEmpty(model.SourceOther) || string.IsNullOrEmpty(model.TargetOther)) return Json(new { result = true, model }); var other = new ProfileLanguageModel { AccountId = User.Identity.GetUserId(), Type = 2, SourceLanguage = model.SourceOther, TargetLanguage = model.TargetOther, }; repo.Insert(other); return Json(new { result = true, model }); }
public ActionResult InterpreterMainLanguagePair() { var repo = new Repository<ProfileLanguageModel>(DbCollection.ProfileLanguage); var listItem = repo.Gets().Where(m => m.AccountId.Equals(User.Identity.GetUserId()) && m.Type.Equals(2) & m.SourceLanguageId != null).ToList(); var itemOrther = repo.Gets().FirstOrDefault(m => m.AccountId.Equals(User.Identity.GetUserId()) && m.Type.Equals(2) & m.SourceLanguageId == null) ?? new ProfileLanguageModel(); var repoLanguage = new Repository<LanguageModel>(DbCollection.Language); var listLanguage = repoLanguage.Gets().ToList(); var model = new ProfileInterpreterViewModel { ProfileLanguageList = listItem, LanguageList = new SelectList(listLanguage, "Id", "Name"), SourceOther = itemOrther.SourceLanguage, TargetOther = itemOrther.TargetLanguage, }; return PartialView("_ProfileInterpreterMainLanguagePairPartial", model); }