Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        public ActionResult RenderSlideTop()
        {
            SliderDa dataAccess = new SliderDa();

            var listSlideTop = dataAccess.getListSlideView(Constant.SlideType.Top);

            return(PartialView(listSlideTop));
        }
Exemple #4
0
        public ActionResult RenderFooter()
        {
            SliderDa dataAccess = new SliderDa();
            string   myCompany  = "00000";

            var infoCompany = dataAccess.getInfoCompany(myCompany);

            return(PartialView(infoCompany));
        }
Exemple #5
0
        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());
        }
Exemple #6
0
        // 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));
        }