コード例 #1
0
 public static void Add(VSD newVSD)
 {
     using (SqlConnection _conn = new SqlConnection(spDAL.connStr))
     {
         _conn.Insert(newVSD);
     }
 }
コード例 #2
0
 public static void Update_VSD(VSD tmp)
 {
     using (SqlConnection _conn = new SqlConnection(spDAL.connStr))
     {
         _conn.Update(tmp);
     }
 }
コード例 #3
0
 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));
 }
コード例 #4
0
        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));
        }
コード例 #5
0
 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));
 }
コード例 #6
0
        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));
        }
コード例 #7
0
        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));
        }