public long UpdateSlide(Slide model) { long res = 0; // Declare new DataAccess object SliderDa dataAccess = new SliderDa(); using (var transaction = new TransactionScope()) { try { res = dataAccess.UpdateSlide(model); if (res <= 0) { transaction.Dispose(); } transaction.Complete(); } catch (Exception ex) { throw new Exception(ex.Message, ex); } finally { transaction.Dispose(); } } return(res); }
public IEnumerable <Slide> SearchSlideList(DataTableModel dt, Slide model, out int total_row) { SliderDa dataAccess = new SliderDa(); IEnumerable <Slide> results = dataAccess.SearchSlideList(dt, model, out total_row); return(results); }
public ActionResult RenderSlideTop() { SliderDa dataAccess = new SliderDa(); var listSlideTop = dataAccess.getListSlideView(Constant.SlideType.Top); return(PartialView(listSlideTop)); }
public ActionResult RenderFooter() { SliderDa dataAccess = new SliderDa(); string myCompany = "00000"; var infoCompany = dataAccess.getInfoCompany(myCompany); return(PartialView(infoCompany)); }
public ActionResult Index() { if (ModelState.IsValid) { using (ProductService service = new ProductService()) { var dataList = service.SearchProductList(); SliderDa dataAccess = new SliderDa(); var listSlideTop = dataAccess.getListSlideView(Constant.SlideType.Top); ViewBag.listSlideTop = listSlideTop; return(View(dataList)); } } return(View()); }
// GET: Slider #region REGISTER/ UPDATE public ActionResult SliderEdit(long newsId = 0) { CmnEntityModel currentUser = Session["CmnEntityModel"] as CmnEntityModel; if (currentUser == null || currentUser.IsAdmin == false) { return(RedirectToAction("Login", "Login")); } Slide model = new Slide(); CommonService comService = new CommonService(); SliderDa dataAccess = new SliderDa(); model.Status = Constant.Status.ACTIVE; if (newsId > 0) { Slide infor = new Slide(); infor = dataAccess.getInfoSlider(newsId); model = infor != null ? infor : model; } return(View(model)); }