public async Task <IActionResult> Edit(int id, [Bind("CowNationId,CowNationName,Description,OwnerSignature,EntryDate")] NationOfCow nationOfCow) { if (id != nationOfCow.CowNationId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(nationOfCow); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NationOfCowExists(nationOfCow.CowNationId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(nationOfCow)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,FoodTypeId,FoodName,FoodForm,ComOrBrndName,ShopName,NumberOfProduct,NumberSignId,Price,AmountSignId,TotalPrice,Description,ManagerSignature,EntryDate")] FoodManagement foodManagement) { if (id != foodManagement.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(foodManagement); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FoodManagementExists(foodManagement.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["AmountSignId"] = new SelectList(_context.AmountSign, "AmountSignId", "AmountSignName", foodManagement.AmountSignId); ViewData["FoodTypeId"] = new SelectList(_context.Set <FoodType>(), "FoodTypeId", "Description", foodManagement.FoodTypeId); ViewData["NumberSignId"] = new SelectList(_context.Set <NumberSign>(), "NumberSignId", "NumberSignName", foodManagement.NumberSignId); return(View(foodManagement)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Amount,OwnerSignature,EntryDate")] Investment investment) { if (id != investment.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(investment); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InvestmentExists(investment.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(investment)); }
public async Task <IActionResult> Edit(int id, [Bind("MonthId,MonthName,OwnerSignature,EntryDate")] Month month) { if (id != month.MonthId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(month); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MonthExists(month.MonthId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(month)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,GenderId,Country,NID,Passport,BithCertificate,Profile,Qualification,RankId,Salary,AmountSignId,JoinDate,ManagerSignature,EntryDate")] WorkerManagement workerManagement) { if (id != workerManagement.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(workerManagement); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WorkerManagementExists(workerManagement.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["AmountSignId"] = new SelectList(_context.AmountSign, "AmountSignId", "AmountSignName", workerManagement.AmountSignId); ViewData["GenderId"] = new SelectList(_context.Gender, "GenderId", "GenderName", workerManagement.GenderId); ViewData["RankId"] = new SelectList(_context.Rank, "RankId", "RankName", workerManagement.RankId); return(View(workerManagement)); }
public async Task <IActionResult> Edit(int id, [Bind("CowCollectionId,CowCollectionName,ManagerSignature,EntryDate")] CowCollection cowCollection) { if (id != cowCollection.CowCollectionId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(cowCollection); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CowCollectionExists(cowCollection.CowCollectionId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(cowCollection)); }
public async Task <IActionResult> Edit(int id, [Bind("DayId,DayName,OwnerSignature,EntryDate")] Days days) { if (id != days.DayId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(days); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DaysExists(days.DayId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(days)); }
public async Task <IActionResult> Edit(int id, [Bind("RankId,RankName,OwnerSignature,EntryDate")] Rank rank) { if (id != rank.RankId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(rank); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RankExists(rank.RankId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(rank)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,TransportTypeId,UsesFor,Description,ManagerSignature,EntryDate")] Transport transport) { if (id != transport.Id) { return(NotFound()); } if (ModelState.IsValid) { try { transport.ManagerSignature = HttpContext.Session.GetString("username"); transport.EntryDate = DateTime.Now; _context.Update(transport); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TransportExists(transport.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["TransportTypeId"] = new SelectList(_context.Set <TransportType>(), "TransportTypeId", "TransportTypeName", transport.TransportTypeId); return(View(transport)); }
public async Task <IActionResult> Edit(int id, [Bind("ScheduleTypeId,DoctorId,DayId,Time,ManagerSignature,EntryDate")] DoctorsSchedule doctorsSchedule) { if (id != doctorsSchedule.ScheduleTypeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(doctorsSchedule); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DoctorsScheduleExists(doctorsSchedule.ScheduleTypeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["DayId"] = new SelectList(_context.Days, "DayId", "DayName", doctorsSchedule.DayId); ViewData["DoctorId"] = new SelectList(_context.Doctors, "DoctorId", "Description", doctorsSchedule.DoctorId); return(View(doctorsSchedule)); }
public async Task <IActionResult> Edit(int id, [Bind("GenderId,GenderName,OwnerSignature,EntryDate")] Gender gender) { if (id != gender.GenderId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(gender); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GenderExists(gender.GenderId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(gender)); }
public async Task <IActionResult> Edit(int id, [Bind("FoodTypeId,FoodTypeName,Description,OwnerSignature,EntryDate")] FoodType foodType) { if (id != foodType.FoodTypeId) { return(NotFound()); } if (ModelState.IsValid) { try { foodType.OwnerSignature = HttpContext.Session.GetString("username"); foodType.EntryDate = DateTime.Now; _context.Update(foodType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FoodTypeExists(foodType.FoodTypeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(foodType)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,IdCardNumber,RankId,Salary,MonthId,PaymentMethodId,ManagerSignature,EntryDate")] WorkerSalary workerSalary) { if (id != workerSalary.Id) { return(NotFound()); } if (ModelState.IsValid) { try { workerSalary.ManagerSignature = HttpContext.Session.GetString("username"); _context.Update(workerSalary); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WorkerSalaryExists(workerSalary.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["MonthId"] = new SelectList(_context.Month, "MonthId", "MonthName", workerSalary.MonthId); ViewData["PaymentMethodId"] = new SelectList(_context.PaymentMethod, "PaymentMethodId", "PaymentMethodName", workerSalary.PaymentMethodId); ViewData["RankId"] = new SelectList(_context.Rank, "RankId", "RankName", workerSalary.RankId); return(View(workerSalary)); }
public async Task <IActionResult> Edit(int id, [Bind("SpecialistTypeId,SpecialistTypeName,OwnerSignature,EntryDate")] SpecialistType specialistType) { if (id != specialistType.SpecialistTypeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(specialistType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SpecialistTypeExists(specialistType.SpecialistTypeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(specialistType)); }
public async Task <IActionResult> Edit(int id, [Bind("ProductQualityId,ProductQualityName,OwnerSignature,EntryDate")] ProductQuality productQuality) { if (id != productQuality.ProductQualityId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(productQuality); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductQualityExists(productQuality.ProductQualityId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(productQuality)); }
public async Task <IActionResult> Edit(int id, [Bind("AmountSignId,AmountSignName,OwnerSignature,EntryDate")] AmountSign amountSign) { if (id != amountSign.AmountSignId) { return(NotFound()); } if (ModelState.IsValid) { try { amountSign.OwnerSignature = HttpContext.Session.GetString("username"); amountSign.EntryDate = DateTime.Now; _context.Update(amountSign); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AmountSignExists(amountSign.AmountSignId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(amountSign)); }
public async Task <IActionResult> Edit(int id, [Bind("DoctorId,DoctorName,SpecialistTypeId,VisitFee,Profile,Description,ManagerSignature,EntryDate")] Doctors doctors, IFormFile profile) { if (id != doctors.DoctorId) { return(NotFound()); } if (!string.IsNullOrEmpty(doctors.DoctorName) && !string.IsNullOrEmpty(doctors.Description) && doctors.SpecialistTypeId != 0 && doctors.VisitFee > 0) { try { if (profile.Length > 0) { byte[] p1 = null; using (var fs1 = profile.OpenReadStream()) using (var ms1 = new MemoryStream()) { fs1.CopyTo(ms1); p1 = ms1.ToArray(); doctors.Profile = p1; } doctors.ManagerSignature = HttpContext.Session.GetString("username"); doctors.EntryDate = DateTime.Now; _context.Update(doctors); await _context.SaveChangesAsync(); } } catch (DbUpdateConcurrencyException) { if (!DoctorsExists(doctors.DoctorId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["SpecialistTypeId"] = new SelectList(_context.Set <SpecialistType>(), "SpecialistTypeId", "SpecialistTypeName", doctors.SpecialistTypeId); return(View(doctors)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ProductTypeId,ProductName,ProductQualityId,Price,AmountSignId,NumberOfProduct,NumberSignId,TotalPrice,PaymentMethodId,Condition,ManagerSignature,EntryDate")] ProductSell productSell) { if (id != productSell.Id) { return(NotFound()); } if (ModelState.IsValid) { try { productSell.TotalPrice = productSell.Price * productSell.NumberOfProduct; productSell.ManagerSignature = HttpContext.Session.GetString("username"); _context.Update(productSell); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductSellExists(productSell.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["AmountSignId"] = new SelectList(_context.AmountSign, "AmountSignId", "AmountSignName", productSell.AmountSignId); ViewData["NumberSignId"] = new SelectList(_context.NumberSign, "NumberSignId", "NumberSignName", productSell.NumberSignId); ViewData["PaymentMethodId"] = new SelectList(_context.PaymentMethod, "PaymentMethodId", "PaymentMethodName", productSell.PaymentMethodId); ViewData["ProductQualityId"] = new SelectList(_context.ProductQuality, "ProductQualityId", "ProductQualityName", productSell.ProductQualityId); ViewData["ProductTypeId"] = new SelectList(_context.Set <ProductType>(), "ProductTypeId", "ProductTypeName", productSell.ProductTypeId); return(View(productSell)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ProductTypeId,ProductName,ProductQualityId,NumberOfProduct,NumberSignId,WorkerSignature,EntryDate")] ProductReadyToDeliver productReadyToDeliver) { if (id != productReadyToDeliver.Id) { return(NotFound()); } if (ModelState.IsValid) { try { productReadyToDeliver.WorkerSignature = HttpContext.Session.GetString("username"); productReadyToDeliver.EntryDate = DateTime.Now; _context.Update(productReadyToDeliver); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductReadyToDeliverExists(productReadyToDeliver.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["NumberSignId"] = new SelectList(_context.NumberSign, "NumberSignId", "NumberSignName", productReadyToDeliver.NumberSignId); ViewData["ProductQualityId"] = new SelectList(_context.ProductQuality, "ProductQualityId", "ProductQualityName", productReadyToDeliver.ProductQualityId); ViewData["ProductTypeId"] = new SelectList(_context.Set <ProductType>(), "ProductTypeId", "ProductTypeName", productReadyToDeliver.ProductTypeId); return(View(productReadyToDeliver)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,SellerName,GenderId,SellerAddress,Location,LandArea,NumberSignId,Price,AmountSignId,TotalPrice,Description,ManagerSignature,EntryDate")] LandManagement landManagement) { if (id != landManagement.Id) { return(NotFound()); } if (ModelState.IsValid) { try { landManagement.ManagerSignature = HttpContext.Session.GetString("username"); landManagement.EntryDate = DateTime.Now; _context.Update(landManagement); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LandManagementExists(landManagement.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["AmountSignId"] = new SelectList(_context.AmountSign, "AmountSignId", "AmountSignName", landManagement.AmountSignId); ViewData["GenderId"] = new SelectList(_context.Gender, "GenderId", "GenderName", landManagement.GenderId); ViewData["NumberSignId"] = new SelectList(_context.Set <NumberSign>(), "NumberSignId", "NumberSignName", landManagement.NumberSignId); return(View(landManagement)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,CowNationId,GenderId,CowName,PreCodeNo,OurCodeNo,CowGroupId,CowCollectionId,CowPurposeId,InitialPrice,Description,ManagerSignature,EntryDate")] CowManagement cowManagement) { if (id != cowManagement.Id) { return(NotFound()); } if (ModelState.IsValid) { try { cowManagement.ManagerSignature = HttpContext.Session.GetString("username"); _context.Update(cowManagement); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CowManagementExists(cowManagement.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CowCollectionId"] = new SelectList(_context.CowCollection, "CowCollectionId", "CowCollectionName", cowManagement.CowCollectionId); ViewData["CowGroupId"] = new SelectList(_context.CowGroup, "CowGroupId", "CowGroupName", cowManagement.CowGroupId); ViewData["CowPurposeId"] = new SelectList(_context.Set <CowPurpose>(), "CowPurposeId", "CowPurposeName", cowManagement.CowPurposeId); ViewData["GenderId"] = new SelectList(_context.Set <Gender>(), "GenderId", "GenderName", cowManagement.GenderId); ViewData["CowNationId"] = new SelectList(_context.Set <NationOfCow>(), "CowNationId", "CowNationName", cowManagement.CowNationId); return(View(cowManagement)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,GenderId,Country,NID,Passport,BithCertificate,Image,RankId,Amount,AmountSignId,Description,ManagerSignature,EntryDate")] OthersPayment othersPayment) { if (id != othersPayment.Id) { return(NotFound()); } if (othersPayment.Name != null && othersPayment.GenderId != null && othersPayment.Country != null && othersPayment.RankId != null && othersPayment.Amount != null && othersPayment.AmountSignId != null && othersPayment.Description != null && othersPayment.ManagerSignature != null) { try { othersPayment.ManagerSignature = HttpContext.Session.GetString("username"); _context.Update(othersPayment); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OthersPaymentExists(othersPayment.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["AmountSignId"] = new SelectList(_context.AmountSign, "AmountSignId", "AmountSignName", othersPayment.AmountSignId); ViewData["GenderId"] = new SelectList(_context.Gender, "GenderId", "GenderName", othersPayment.GenderId); ViewData["RankId"] = new SelectList(_context.Set <Rank>(), "RankId", "RankName", othersPayment.RankId); return(View(othersPayment)); }