예제 #1
0
        public void CreateDirection(Direction Direction)
        {

            utOfWork.DirectionRepository.Add(Direction);


        }
        public ActionResult EditDirection(Direction reg)
        {
            if (ModelState.IsValid)
            {

                try
                {
                    dir.UpdateDirectionDetached(reg);
                    dir.SaveDirection();

                    return RedirectToAction("GetDirection");
                }
                catch (Exception ex)
                {
                    LogThread.WriteLine(ex.Message);
                    return RedirectToAction("Index", "Error");
                }

            }
            else

            {
                return View();
            }
        }
        public ActionResult CreateDirection(Direction direction)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    if (etat)
                    {
                        BissInventaireEntities.Instance.Direction.Add(direction);
                        BissInventaireEntities.Instance.SaveChanges();
                        return RedirectToAction("GetDirection");
                    }
                    else
                    {
                        return RedirectToAction("Index", "Error");
                    }
                }
                catch (Exception ex)
                {
                    LogThread.WriteLine(ex.Message);
                    return RedirectToAction("Index", "Error");
                }
            }
            else

            {

                return View();
            }
        }
예제 #4
0
 public void UpdateDirectionDetached(Direction e)
 {
     utOfWork.DirectionRepository.UpdateDirectionDetached(e);
 }
예제 #5
0
 public ActionResult CreateDirection(Direction direction)
 {
     try
     {
         BissInventaireEntities.Instance.Direction.Add(direction);
         BissInventaireEntities.Instance.SaveChanges();
         return RedirectToAction("GetDirection");
     }
     catch (Exception ex)
     {
         LogThread.WriteLine(ex.Message);
         return RedirectToAction("Index", "Error");
     }
 }