public async Task <IActionResult> Create([Bind("DoctorId,DoctorName,SpecialistTypeId,VisitFee,Profile,Description,ManagerSignature,EntryDate")] Doctors doctors, IFormFile profile) { if (ModelState.IsValid) { 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"); _context.Add(doctors); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } } } ViewData["SpecialistTypeId"] = new SelectList(_context.Set <SpecialistType>(), "SpecialistTypeId", "SpecialistTypeName", doctors.SpecialistTypeId); return(View(doctors)); }
public async Task <IActionResult> Create([Bind("Id,Amount,OwnerSignature,EntryDate")] Investment investment) { if (ModelState.IsValid) { _context.Add(investment); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(investment)); }
public async Task <IActionResult> Create([Bind("MonthId,MonthName,OwnerSignature,EntryDate")] Month month) { if (ModelState.IsValid) { _context.Add(month); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(month)); }
public async Task <IActionResult> Create([Bind("CowCollectionId,CowCollectionName,ManagerSignature,EntryDate")] CowCollection cowCollection) { if (ModelState.IsValid) { _context.Add(cowCollection); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(cowCollection)); }
public async Task <IActionResult> Create([Bind("GenderId,GenderName,OwnerSignature,EntryDate")] Gender gender) { if (ModelState.IsValid) { _context.Add(gender); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(gender)); }
public async Task <IActionResult> Create([Bind("CowPurposeId,CowPurposeName,Description,OwnerSignature,EntryDate")] CowPurpose cowPurpose) { if (ModelState.IsValid) { _context.Add(cowPurpose); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(cowPurpose)); }
public async Task <IActionResult> Create([Bind("ProductQualityId,ProductQualityName,OwnerSignature,EntryDate")] ProductQuality productQuality) { if (ModelState.IsValid) { _context.Add(productQuality); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(productQuality)); }
public async Task <IActionResult> Create([Bind("PaymentMethodId,PaymentMethodName,OwnerSignature,EntryDate")] PaymentMethod paymentMethod) { if (ModelState.IsValid) { _context.Add(paymentMethod); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(paymentMethod)); }
public async Task <IActionResult> Create([Bind("RankId,RankName,OwnerSignature,EntryDate")] Rank rank) { if (ModelState.IsValid) { _context.Add(rank); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(rank)); }
public async Task <IActionResult> Create([Bind("SpecialistTypeId,SpecialistTypeName,OwnerSignature,EntryDate")] SpecialistType specialistType) { if (ModelState.IsValid) { _context.Add(specialistType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(specialistType)); }
public async Task <IActionResult> Create([Bind("ScheduleTypeId,DoctorId,DayId,Time,ManagerSignature,EntryDate")] DoctorsSchedule doctorsSchedule) { if (ModelState.IsValid) { _context.Add(doctorsSchedule); await _context.SaveChangesAsync(); 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> Create([Bind("Id,Name,GenderId,Country,NID,Passport,BithCertificate,Profile,Qualification,RankId,Salary,AmountSignId,JoinDate,ManagerSignature,EntryDate")] WorkerManagement workerManagement) { if (ModelState.IsValid) { _context.Add(workerManagement); await _context.SaveChangesAsync(); 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> Create([Bind("ProductTypeId,ProductTypeName,OwnerSignature,EntryDate")] ProductType productType) { if (ModelState.IsValid) { productType.OwnerSignature = HttpContext.Session.GetString("username"); productType.EntryDate = DateTime.Now; _context.Add(productType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(productType)); }
public async Task <IActionResult> Create([Bind("DayId,DayName,OwnerSignature,EntryDate")] Days days) { if (ModelState.IsValid) { days.OwnerSignature = HttpContext.Session.GetString("username"); days.EntryDate = DateTime.Now; _context.Add(days); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(days)); }
public async Task <IActionResult> Create([Bind("NumberSignId,NumberSignName,OwnerSignature,EntryDate")] NumberSign numberSign) { if (ModelState.IsValid) { numberSign.OwnerSignature = HttpContext.Session.GetString("username"); numberSign.EntryDate = DateTime.Now; _context.Add(numberSign); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(numberSign)); }
public async Task <IActionResult> Create([Bind("Id,TransportTypeId,UsesFor,Description,ManagerSignature,EntryDate")] Transport transport) { if (ModelState.IsValid) { transport.ManagerSignature = HttpContext.Session.GetString("username"); transport.EntryDate = DateTime.Now; _context.Add(transport); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["TransportTypeId"] = new SelectList(_context.Set <TransportType>(), "TransportTypeId", "TransportTypeName", transport.TransportTypeId); return(View(transport)); }
public async Task <IActionResult> Create([Bind("Id,Name,GenderId,Country,NID,Passport,BithCertificate,Image,RankId,Amount,AmountSignId,Description,ManagerSignature,EntryDate")] OthersPayment othersPayment, IFormFile nid, IFormFile profile) { 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) { if (nid.Length > 0) { byte[] p1 = null; using (var fs1 = nid.OpenReadStream()) using (var ms1 = new MemoryStream()) { fs1.CopyTo(ms1); p1 = ms1.ToArray(); othersPayment.NID = p1; } } if (profile.Length > 0) { byte[] p1 = null; using (var fs1 = profile.OpenReadStream()) using (var ms1 = new MemoryStream()) { fs1.CopyTo(ms1); p1 = ms1.ToArray(); othersPayment.Image = p1; } } othersPayment.ManagerSignature = HttpContext.Session.GetString("username"); _context.Add(othersPayment); await _context.SaveChangesAsync(); 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)); }
public async Task <IActionResult> Create([Bind("Id,SellerName,GenderId,SellerAddress,Location,LandArea,NumberSignId,Price,AmountSignId,TotalPrice,Description,ManagerSignature,EntryDate")] LandManagement landManagement) { if (ModelState.IsValid) { landManagement.ManagerSignature = HttpContext.Session.GetString("username"); landManagement.EntryDate = DateTime.Now; _context.Add(landManagement); await _context.SaveChangesAsync(); 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> Create([Bind("Id,ProductTypeId,ProductName,ProductQualityId,NumberOfProduct,NumberSignId,WorkerSignature,EntryDate")] ProductReadyToDeliver productReadyToDeliver) { if (ModelState.IsValid) { productReadyToDeliver.WorkerSignature = HttpContext.Session.GetString("username"); productReadyToDeliver.EntryDate = DateTime.Now; _context.Add(productReadyToDeliver); await _context.SaveChangesAsync(); 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> Create([Bind("Id,CowNationId,GenderId,CowName,PreCodeNo,OurCodeNo,CowGroupId,CowCollectionId,CowPurposeId,InitialPrice,Description,ManagerSignature,EntryDate")] CowManagement cowManagement) { if (ModelState.IsValid) { cowManagement.ManagerSignature = HttpContext.Session.GetString("username"); _context.Add(cowManagement); await _context.SaveChangesAsync(); 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> Create([Bind("Id,IdCardNumber,RankId,Salary,MonthId,PaymentMethodId,ManagerSignature,EntryDate")] WorkerSalary workerSalary) { if (ModelState.IsValid) { workerSalary.ManagerSignature = HttpContext.Session.GetString("username"); workerSalary.EntryDate = DateTime.Now; _context.Add(workerSalary); await _context.SaveChangesAsync(); 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> Create([Bind("Id,FoodTypeId,FoodName,FoodForm,ComOrBrndName,ShopName,NumberOfProduct,NumberSignId,Price,AmountSignId,TotalPrice,Description,ManagerSignature,EntryDate")] FoodManagement foodManagement) { if (ModelState.IsValid) { foodManagement.ManagerSignature = HttpContext.Session.GetString("username"); foodManagement.EntryDate = DateTime.Now; _context.Add(foodManagement); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AmountSignId"] = new SelectList(_context.AmountSign, "AmountSignId", "AmountSignName", foodManagement.AmountSignId); ViewData["FoodTypeId"] = new SelectList(_context.Set <FoodType>(), "FoodTypeId", "FoodRypeName", foodManagement.FoodTypeId); ViewData["NumberSignId"] = new SelectList(_context.Set <NumberSign>(), "NumberSignId", "NumberSignName", foodManagement.NumberSignId); return(View(foodManagement)); }
public async Task <IActionResult> Create([Bind("Id,ProductTypeId,ProductName,ProductQualityId,Price,AmountSignId,NumberOfProduct,NumberSignId,TotalPrice,PaymentMethodId,Condition,ManagerSignature,EntryDate")] ProductSell productSell) { if (ModelState.IsValid) { productSell.TotalPrice = productSell.Price * productSell.NumberOfProduct; productSell.ManagerSignature = HttpContext.Session.GetString("username"); productSell.EntryDate = DateTime.Now; _context.Add(productSell); await _context.SaveChangesAsync(); 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)); }