public ActionResult Create([Bind(Include = "ProductId,ManufacturerId,CategoryId,ProductName,ProductCost,ProductGarantee,ProductOnStock")] Product product) { if (ModelState.IsValid) { db.Products.Add(product); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(product)); }
public ActionResult Create([Bind(Include = "PostId,PostName")] Post post) { if (ModelState.IsValid) { db.Posts.Add(post); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(post)); }
public ActionResult Create([Bind(Include = "CategoryProductId,CategoryName")] CategoryProduct categoryProduct) { if (ModelState.IsValid) { db.CategoryProducts.Add(categoryProduct); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(categoryProduct)); }
public ActionResult Create([Bind(Include = "UniversityId,UniversityName")] University university) { if (ModelState.IsValid) { db.Universities.Add(university); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(university)); }
public ActionResult Create([Bind(Include = "WorkerId,WorkerName,WorkerGender,WorkerBirthday,FamilyStatus,WorkerTelephone,WorkerEmail,PassportSeries,PassportNumber,Inn")] Worker worker) { if (ModelState.IsValid) { db.Workers.Add(worker); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(worker)); }
public ActionResult Create([Bind(Include = "VacationSortId,VacationName")] VacationSort vacationSort) { if (ModelState.IsValid) { db.VacationSorts.Add(vacationSort); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(vacationSort)); }
public ActionResult Create([Bind(Include = "EducationSpecialtyId,EducationSpecialtyName")] EducationSpecialty educationSpecialty) { if (ModelState.IsValid) { db.EducationSpecialties.Add(educationSpecialty); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(educationSpecialty)); }
public ActionResult Create([Bind(Include = "CauseId,CauseName")] Cause cause) { if (ModelState.IsValid) { db.Causes.Add(cause); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cause)); }
public ActionResult Create([Bind(Include = "PrizeId,PrizeName")] Prize prize) { if (ModelState.IsValid) { db.Prizes.Add(prize); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(prize)); }
public ActionResult Create([Bind(Include = "WorkerChildId,WorkerId,ChildName,ChildGender,ChildBirthday,StudyPlace")] WorkerChild workerChild) { if (ModelState.IsValid) { db.WorkerChildren.Add(workerChild); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.WorkerId = new SelectList(db.Workers, "WorkerId", "WorkerName", workerChild.WorkerId); return(View(workerChild)); }
public ActionResult Create([Bind(Include = "WorkerPostId,PostId,WorkerId")] WorkerPost workerPost) { if (ModelState.IsValid) { db.WorkerPosts.Add(workerPost); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PostId = new SelectList(db.Posts, "PostId", "PostName", workerPost.PostId); ViewBag.WorkerId = new SelectList(db.Workers, "WorkerId", "WorkerName", workerPost.WorkerId); return(View(workerPost)); }
public ActionResult Create([Bind(Include = "CategoryId,ProductId,CategoryProductId")] Category category) { if (ModelState.IsValid) { db.Categories.Add(category); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CategoryProductId = new SelectList(db.CategoryProducts, "CategoryProductId", "CategoryName", category.CategoryProductId); ViewBag.ProductId = new SelectList(db.Products, "ProductId", "ProductName", category.ProductId); return(View(category)); }
public ActionResult Create([Bind(Include = "VacationId,WorkerId,VacationStart,VacationEnd,VacationSortId,VacationStatus")] Vacation vacation) { if (ModelState.IsValid) { db.Vacations.Add(vacation); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.VacationSortId = new SelectList(db.VacationSorts, "VacationSortId", "VacationName", vacation.VacationSortId); ViewBag.WorkerId = new SelectList(db.Workers, "WorkerId", "WorkerName", vacation.WorkerId); return(View(vacation)); }
public ActionResult Create([Bind(Include = "WorkerPrizeId,WorkerId,PrizeDate,PrizeId,PrizeAmount")] WorkerPrize workerPrize) { if (ModelState.IsValid) { db.WorkerPrizes.Add(workerPrize); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PrizeId = new SelectList(db.Prizes, "PrizeId", "PrizeName", workerPrize.PrizeId); ViewBag.WorkerId = new SelectList(db.Workers, "WorkerId", "WorkerName", workerPrize.WorkerId); return(View(workerPrize)); }
public ActionResult Create([Bind(Include = "WriteOffProductId,WriteOffAmount,ProductId,WriteOffDate,CauseId")] WriteOffProduct writeOffProduct) { if (ModelState.IsValid) { db.WriteOffProducts.Add(writeOffProduct); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CauseId = new SelectList(db.Causes, "CauseId", "CauseName", writeOffProduct.CauseId); ViewBag.ProductId = new SelectList(db.Products, "ProductId", "ProductName", writeOffProduct.ProductId); return(View(writeOffProduct)); }
public ActionResult Create([Bind(Include = "WorkerEducationId,WorkerId,UniversityId,EducationStart,EducationEnd,EducationSpecialtyId")] WorkerEducation workerEducation) { if (ModelState.IsValid) { db.WorkerEducations.Add(workerEducation); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EducationSpecialtyId = new SelectList(db.EducationSpecialties, "EducationSpecialtyId", "EducationSpecialtyName", workerEducation.EducationSpecialtyId); ViewBag.UniversityId = new SelectList(db.Universities, "UniversityId", "UniversityName", workerEducation.UniversityId); ViewBag.WorkerId = new SelectList(db.Workers, "WorkerId", "WorkerName", workerEducation.WorkerId); return(View(workerEducation)); }