Ejemplo n.º 1
0
 public void UpdatePages(tb_Page pagesModel)
 {
     _repository = new PagesRepository();
     _repository.UpdatePages(pagesModel);
 }
Ejemplo n.º 2
0
        public bool AddPages(tb_Page pages)
        {
            _repository = new PagesRepository();

            return _repository.AddPages(pages);
        }
Ejemplo n.º 3
0
        public ActionResult Pages_Destroy([DataSourceRequest] DataSourceRequest request, PagesModel model)
        {
            if (model != null)
            {
                tb_Page modelNew = new tb_Page();
                AutoMapper.Mapper.CreateMap<PagesModel, tb_Page>();
                modelNew = AutoMapper.Mapper.Map(model, modelNew);
                _pagesBal.DeletePages(modelNew.Page_Id);
            }

            return Json(new[] { model }.ToDataSourceResult(request, ModelState));
        }
Ejemplo n.º 4
0
        public ActionResult Pages_Update([DataSourceRequest] DataSourceRequest request, PagesModel model)
        {
            if (model != null && ModelState.IsValid)
            {
                tb_Page modelNew = new tb_Page();
                AutoMapper.Mapper.CreateMap<PagesModel, tb_Page>();
                modelNew = AutoMapper.Mapper.Map(model, modelNew);
                modelNew.Modify_By = 1;
                modelNew.Modify_Date = DateTime.Now;
                _pagesBal.UpdatePages(modelNew);
            }

            return Json(new[] { model }.ToDataSourceResult(request, ModelState));
        }
Ejemplo n.º 5
0
        public ActionResult Pages_Create([DataSourceRequest] DataSourceRequest request, PagesModel model)
        {
            if (model != null && ModelState.IsValid)
            {
                tb_Page modelNew = new tb_Page();
                AutoMapper.Mapper.CreateMap<PagesModel, tb_Page>();
                modelNew = AutoMapper.Mapper.Map(model, modelNew);
                modelNew.Page_Content = model.Page_Content;
                //modelNew.Parent_Page_Id = 0;
                modelNew.Name = model.Name;
                modelNew.Created_By = 1;
                modelNew.Created_Date = DateTime.Now;
                modelNew.Modify_By = 1;
                modelNew.Modify_Date = DateTime.Now;
                _pagesBal.AddPages(modelNew);
            }

            return Json(new[] { model }.ToDataSourceResult(request, ModelState));
        }