コード例 #1
0
ファイル: KhoController.cs プロジェクト: minhtd16/BanXeMay
        public ActionResult Create(Kho entity)
        {
            var dao = new KhoDao();

            dao.Insert(entity);
            return(RedirectToAction("Index"));
        }
コード例 #2
0
ファイル: KhoController.cs プロジェクト: minhtd16/BanXeMay
        // GET: Admin/Khoes/Edit/5
        public ActionResult Edit(int id)
        {
            var dao   = new KhoDao();
            var model = dao.GetByID(id);

            return(View(model));
        }
コード例 #3
0
ファイル: KhoController.cs プロジェクト: minhtd16/BanXeMay
        // GET: Admin/Kho
        public ActionResult Index()
        {
            var dao   = new KhoDao();
            var model = dao.ListAll();

            return(View(model));
        }
コード例 #4
0
ファイル: KhoController.cs プロジェクト: minhtd16/BanXeMay
        public ActionResult Delete(int id)
        {
            var dao   = new KhoDao();
            var model = dao.GetByID(id);

            if (model != null)
            {
                dao.Delete(model);
            }
            return(RedirectToAction("Index"));
        }
コード例 #5
0
ファイル: KhoController.cs プロジェクト: minhtd16/BanXeMay
        public ActionResult Edit(Kho entity)
        {
            var dao = new KhoDao();

            if (dao.Update(entity))
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(entity));
            }
        }