public static void Add(VSD newVSD) { using (SqlConnection _conn = new SqlConnection(spDAL.connStr)) { _conn.Insert(newVSD); } }
public static void Update_VSD(VSD tmp) { using (SqlConnection _conn = new SqlConnection(spDAL.connStr)) { _conn.Update(tmp); } }
public IActionResult Edit(Guid id, [Bind] VSD objVSD) { if (id == null) { return(NotFound()); } if (ModelState.IsValid) { spDAL.Update_VSD(objVSD); return(RedirectToAction("Index")); } ViewBag.Page = "BioPrep"; return(View(objVSD)); }
public IActionResult Delete(Guid id) { if (id == null) { return(NotFound()); } VSD tmp = spDAL.GetById_VSD(id); if (tmp == null) { return(NotFound()); } ViewBag.Page = "VSD"; return(View(tmp)); }
public IActionResult Create([Bind] VSD tmp) { if (ModelState.IsValid) { spDAL.Add(tmp); //проверка на существования аналогичной записи //if (BioPrepDAL.IsUniqueRecord(tmp)) // BioPrepDAL.Add_BioPrep(tmp); //else //{ //TempData["EM"] = "Такая запись уже существует"; //return LocalRedirect("~/Home/Error"); //return RedirectToAction("Error"); //}; return(RedirectToAction("Index")); } ViewBag.Page = "VSD"; return(View(tmp)); }
public IActionResult Create() { string CurrentUserId = User.Claims.ToList().FirstOrDefault(x => x.Type == "UserId").Value; string CurrentUnitsId = User.Claims.ToList().FirstOrDefault(x => x.Type == "UnitsId").Value; ViewBag.UnitsList = spDAL.UnitsList(); ViewBag.EdizmList = spDAL.EdizmList(); ViewBag.TransportList = spDAL.TransportList(); ViewBag.ConclusionList = spDAL.ConclusionList(); VSD tmp = new VSD() { userId = CurrentUserId }; ViewBag.Page = "VSD"; return(View(tmp)); }
public IActionResult Edit(Guid id) { if (id == null) { return(NotFound()); } VSD tmp = spDAL.GetById_VSD(id); if (tmp == null) { return(NotFound()); } //ViewBag.UnitsList = spDAL.UnitsList(); ViewBag.EdizmList = spDAL.EdizmList(); ViewBag.TransportList = spDAL.TransportList(); ViewBag.ConclusionList = spDAL.ConclusionList(); ViewBag.Page = "VSD"; return(View(tmp)); }