Пример #1
0
        public void Create(UpazilaViewModel upazilaVM)
        {
            var Upazila = new Upazila
            {
                UpazilaName = upazilaVM.UpazilaName
            };

            unitOfWork.UpazilaRepository.Insert(Upazila);
            unitOfWork.Save();
        }
Пример #2
0
        public void Update(UpazilaViewModel upazilaVM)
        {
            var Upazila = new Upazila
            {
                UpazilaId   = upazilaVM.UpazilaId,
                UpazilaName = upazilaVM.UpazilaName
            };

            unitOfWork.UpazilaRepository.Update(Upazila);
            unitOfWork.Save();
        }
Пример #3
0
        // GET: Upazila/Details/5
        public ActionResult Details(int id = 0)
        {
            if (id == 0)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            UpazilaViewModel details = upazilaService.GetById(id);

            if (details == null)
            {
                return(HttpNotFound());
            }
            return(View(details));
        }
Пример #4
0
        public ActionResult Create(UpazilaViewModel upazilaVM)
        {
            try
            {
                // TODO: Add insert logic here

                upazilaService.Create(upazilaVM);


                LoadDropdown();
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Пример #5
0
        public ActionResult Edit(UpazilaViewModel upazilaVM)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    // TODO: Add update logic here

                    upazilaService.Update(upazilaVM);
                    return(RedirectToAction("Index"));
                }
                catch
                {
                    return(View());
                }
            }
            return(View());
        }
        public ActionResult Create(UpazilaViewModel upazilaVM)
        {
            try
            {
                // TODO: Add insert logic here
                if (ModelState.IsValid)
                {
                    upazilaService.Create(upazilaVM);
                }


                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }