public async Task <IActionResult> VetProducts(User user, VetRegistracion vetRegistracion) { var appUser = await _userManager.FindByNameAsync(User.Identity.Name); user.Email = appUser.Email; user.UserName = appUser.UserName; var productList = _vetContext.GetAllVet(vetRegistracion).Where(e => e.UserName == user.UserName).OrderByDescending(e => e.RegistrationDateTime).ToList(); return(View(productList)); }
public void VetCurrnetJob() { VetRegistracion vet = new VetRegistracion(); var getAllProd = _vetContext.GetAllVet(vet); foreach (var item in getAllProd) { var productEndDateInStirng = item.RegistrationDateTime.AddDays(31).ToString("MM/dd/yyyy"); if (productEndDateInStirng == DateTime.Now.ToString("MM/dd/yyyy")) { _vetContext.RemoveVet(item); //_vetContext.SaveChange(); } } }
public async Task <IActionResult> UserProfile(User user, VetRegistracion vetRegistracion, PetRegistration petRegistration, JobVacancy jobVacancy, Damakeba damakeba) { var appUser = await _userManager.FindByNameAsync(User.Identity.Name); user.Email = appUser.Email; user.UserName = appUser.UserName; if (appUser.GenderValue == 0) { user.UserGender = 0; } else { user.UserGender = 1; } user.VetCount = _vetContext.GetAllVet(vetRegistracion).Where(e => e.UserName == user.UserName).ToList().Count(); user.PetCount = _petContext.GetAllPet(petRegistration).Where(e => e.UserName == user.UserName).ToList().Count(); user.VacancyCount = _vacancyContext.GetAllJob(jobVacancy).Where(e => e.UserName == user.UserName).ToList().Count(); user.DamakebaCount = _damakebaContext.GetAllProduct(damakeba).Where(e => e.UserName == user.UserName).ToList().Count(); return(View(user)); }
public IActionResult Vet(VetRegistracion vetRegistracion) { var getAll = _context.GetAllVet(vetRegistracion).OrderByDescending(e => e.RegistrationDateTime).ToList(); return(View(getAll)); }