示例#1
0
        public PartialViewResult HeaderPartial()

        {
            AboutDao dbCat = new AboutDao();

            return(PartialView(dbCat.ToActive()));
        }
        // GET: Admin/About/Edit/5
        public ActionResult Edit(int id)
        {
            var dao   = new AboutDao();
            var about = dao.GetByID(id);

            return(View(about));
        }
示例#3
0
        public ActionResult Index(string searchString, int page = 1, int pageSize = 10)
        {
            var dao   = new AboutDao();
            var model = dao.ListAllPaging(searchString, page, pageSize);

            return(View(model));
        }
示例#4
0
        //[HasCredential(RoleID = "ABOUT_VIEW")]
        public ActionResult Index()
        {
            ViewBag.MenuActive = "mIndexAbout";
            var dao = new AboutDao().GetAbout();

            return(View(dao));
        }
示例#5
0
        public ActionResult Detail(long id)
        {
            var model = new AboutDao().GetByID(id);

            ViewBag.Tags = new AboutDao().ListTag(id);
            return(View(model));
        }
示例#6
0
        public ActionResult Create(About collection)
        {
            try
            {
                AboutDao bdDao = new AboutDao();

                UserLogin us = (UserLogin)Session[SystemConsts.USER_SESSION];
                collection.CreateBy     = us.UserName;
                collection.CreateDate   = Hepper.GetDateServer();
                collection.ModifiedBy   = us.UserName;
                collection.ModifiedDate = Hepper.GetDateServer();
                collection.LanguageID   = "vi";
                //collection.CreateBy = us.UserName;
                //collection.ModifiedBy = us.UserName;
                if (bdDao.Insert(collection))
                {
                    SetAlert(@Resources.ResourceAdmin.AdminCreateRecordSuccess, "success");
                    return(RedirectToAction("Index"));
                }
                else
                {
                    SetAlert(@Resources.ResourceAdmin.AdminCreateRecordFailed, "danger");
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                SetAlert(@Resources.ResourceAdmin.AdminCreateRecordFailed, "danger");
                return(View());
            }
        }
示例#7
0
        public ActionResult Edit(About collection)
        {
            AboutDao bdDao = new AboutDao();

            try
            {
                UserLogin us = (UserLogin)Session[SystemConsts.USER_SESSION];

                collection.ModifiedBy   = us.UserName;
                collection.ModifiedDate = Hepper.GetDateServer();


                if (bdDao.Update(collection))
                {
                    SetAlert(@Resources.ResourceAdmin.AdminEditRecordSucess, "success");
                    return(RedirectToAction("Index"));
                }
                else
                {
                    SetAlert(@Resources.ResourceAdmin.AdminEditRecordFailed, "danger");
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                SetAlert(@Resources.ResourceAdmin.AdminEditRecordFailed, "danger");
                return(View());
            }
        }
示例#8
0
        public ActionResult Create(About entity)
        {
            if (ModelState.IsValid)
            {
                long id;

                try
                {
                    entity.CreatedOn = DateTime.Now;
                    entity.Status    = true;
                    id = new AboutDao().Insert(entity);
                }
                catch (Exception ex)
                {
                    return(View("Error", new HandleErrorInfo(ex, "About", "Index")));
                }
                if (id > 0)
                {
                    ModelState.AddModelError("", "Thêm mới thành công");
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Thêm mới không thành công");
                    return(View());
                }
            }
            else
            {
                ModelState.AddModelError("", "Vui lòng nhập đầy đủ thông tin");
                return(View());
            }
        }
示例#9
0
        public ActionResult Index(int page = 1, int pageSize = 10)
        {
            var dao   = new AboutDao();
            var model = dao.ListPg(page, pageSize);

            return(View(model));
        }
        // GET: Admin/About
        public ActionResult Index(string searchString, int page = 1, int pageSize = 10)
        {
            var dao   = new AboutDao();
            var model = dao.ListAllPage(searchString, page, pageSize);

            ViewBag.SearchString = searchString;//de giu lai gia tri search, ViewBag gui gia tri tu controllor xuong view
            return(View(model));
        }
示例#11
0
        public PartialViewResult FooterPartial()

        {
            FooterDao dbCat = new FooterDao();
            AboutDao  abDao = new AboutDao();

            ViewBag.About = abDao.ToActive();
            return(PartialView(dbCat.ToActive()));
        }
示例#12
0
        public JsonResult ChangeStatus(long id)
        {
            var result = new AboutDao().ChangeStatus(id);

            return(Json(new
            {
                status = result
            }));
        }
示例#13
0
        public ActionResult Edit(long id)
        {
            if (id <= 0)
            {
                return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest));
            }
            var data = new AboutDao().GetByID(id);

            return(View(data));
        }
示例#14
0
        public JsonResult ChangeStatus(int id)
        {
            if (id <= 0)
            {
                return(Json(new { status = false, mess = "False" }));
            }
            var result = new AboutDao().ChangeStatus(id);

            return(Json(new { status = result, mess = "Thay đổi thành công" }));
        }
示例#15
0
        public ActionResult Index(About entity)
        {
            var dao = new AboutDao();

            entity.CreateBy   = ((UserLoginSession)Session[ConstantSession.USER_SESSION]).UserName;
            entity.ModifiedBy = ((UserLoginSession)Session[ConstantSession.USER_SESSION]).UserName;

            dao.Update(entity);
            return(View(entity));
        }
示例#16
0
        // GET: Contact
        public ActionResult Index()
        {
            var about = new AboutDao().GetDetail(1);

            ViewBag.About = about;
            if (Session[Constants.USER_INFO] != null)
            {
                new LogDao().SetLog("Contact", null, ((User)Session[Constants.USER_INFO]).ID);
            }
            return(View());
        }
 // GET: About
 public ActionResult Index()
 {
     try
     {
         var model = new AboutDao().GetAbout();
         return(View(model));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
 public ActionResult Detail(long id)
 {
     if (((User)Session[Constants.USER_INFO]).GroupID == Constants.GROUP_ADMIM)
     {
         SetActiveSlideBar(Constants.SLIDEBAR_AD_SYSTEM);
         var AboutModel = new AboutDao().GetDetail(id);
         new LogDao().SetLog("Admin_About_Detail", null, ((User)Session[Constants.USER_INFO]).ID);
         return(View(AboutModel));
     }
     SetAlert("Tài khoản của bạn không có quyền", Constants.ALERTTYPE_ERROR);
     new LogDao().SetLog("Admin_About_Detail", "Tài khoản của bạn không có quyền", ((User)Session[Constants.USER_INFO]).ID);
     return(RedirectToAction("Index", "Home"));
 }
        public ActionResult Delete(int id, FormCollection collection)
        {
            var result = new AboutDao().DeleteByID(id);

            if (result)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View("Index"));
            }
        }
示例#20
0
        public ActionResult Delete(long id)
        {
            bool result = new AboutDao().Delete(id);

            if (result)
            {
                ModelState.AddModelError("", "Xóa thành công");
                return(RedirectToAction("Index"));
            }
            else
            {
                ModelState.AddModelError("", "Xóa không thành công");
                return(RedirectToAction("Index"));
            }
        }
示例#21
0
        public JsonResult Delete(int id)
        {
            if (id <= 0)
            {
                return(Json(new { status = false, mess = "False" }));
            }
            var data = new AboutDao().GetByID((long)id);

            if (data.Status.Value)
            {
                return(Json(new { status = false, mess = "Không xóa được" }));
            }
            new AboutDao().Delete(id);
            return(Json(new { status = true, mess = "Xóa thành công" }));
        }
示例#22
0
        public ActionResult Index()
        {
            CategoryDao cateDB = new CategoryDao();

            ViewBag.HocTieuBieu = cateDB.TToListActivePositionByParentID(3, 26).SingleOrDefault();


            AboutDao dbCat = new AboutDao();

            ViewBag.About = dbCat.ToActive();

            StatsInfoDao stiDB = new StatsInfoDao();

            ViewBag.StatsInfo = stiDB.ToListActive();

            return(View());
        }
 public ActionResult Edit(About about)
 {
     if (ModelState.IsValid)
     {
         var dao    = new AboutDao();
         var result = dao.Update(about);
         if (result)
         {
             return(RedirectToAction("Index", "About"));
         }
         else
         {
             ModelState.AddModelError("", "Không thêm được");
         }
     }
     return(View("Index"));
 }
        public ActionResult Edit(About about)
        {
            var dao    = new AboutDao();
            var result = dao.Update(about);

            if (result)
            {
                SetAlert("Add user successfully", "success");
                return(RedirectToAction("Index", "About"));
            }
            else
            {
                SetAlert("Update user failure", "danger");
                ModelState.AddModelError("", "Update user failure");
            }
            return(View("Index"));
        }
示例#25
0
        public ActionResult Create(About model)
        {
            if (ModelState.IsValid)
            {
                var dao = new AboutDao();

                long id = dao.Insert(model);
                if (id > 0)
                {
                    return(RedirectToAction("Index", "About"));
                }
                else
                {
                    ModelState.AddModelError("", "Them about thanh cong");
                }
            }
            return(View("Index"));
        }
示例#26
0
        public ActionResult Delete(long id)
        {
            try
            {
                // TODO: Add delete logic here

                AboutDao bdDao = new AboutDao();

                bdDao.Delete(id);
                // SetAlert("Xóa thành công", "success");
                return(RedirectToAction("Index"));
            }
            catch
            {
                // SetAlert("Không xóa được", "danger");
                return(View());
            }
        }
 public ActionResult Create(About about)
 {
     if (ModelState.IsValid)
     {
         var  dao = new AboutDao();
         long id  = dao.Insert(about);
         if (id > 0)
         {
             setAlert("Thêm thông tin thành công", "success");
             return(RedirectToAction("Index", "About"));
         }
         else
         {
             setAlert("Cập nhật thông tin thành công", "success");
             ModelState.AddModelError("", "Không thêm được");
         }
     }
     return(View("Index"));
 }
示例#28
0
        public ActionResult Edit(About abouts)
        {
            if (ModelState.IsValid)
            {
                var dao = new AboutDao();

                var result = dao.Update2(abouts);
                if (result)
                {
                    //SetAlert("Cập nhật thành công", "success");
                    return(RedirectToAction("Index", "About"));
                }
                else
                {
                    ModelState.AddModelError("", "Cập nhật không thành công");
                }
            }
            return(View("Index"));
        }
示例#29
0
        // GET: Content
        public ActionResult Index(String searchString, int page = 1, int pageSize = 10)
        {
            var model       = new AboutDao().ListAllpaging(searchString, page, pageSize);
            int totalRecord = 0;

            ViewBag.Total = totalRecord;
            ViewBag.Page  = page;

            int maxPage   = 5;
            int totalPage = 0;

            totalPage         = (int)Math.Ceiling((double)(totalRecord / pageSize));
            ViewBag.TotalPage = totalPage;
            ViewBag.MaxPage   = maxPage;
            ViewBag.First     = 1;
            ViewBag.Last      = totalPage;
            ViewBag.Next      = page + 1;
            ViewBag.Prev      = page - 1;
            return(View(model));
        }
示例#30
0
 public ActionResult Edit(About model)
 {
     if (ModelState.IsValid)
     {
         var session = (UserLogin)Session[CommonConstants.USER_SESSION];
         model.ModifiedBy = session.UserName;
         var dao    = new AboutDao();
         var result = dao.Update(model);
         if (result)
         {
             SetAlert("Update content thành công", "success");
             return(RedirectToAction("Index", "About"));
         }
         else
         {
             ModelState.AddModelError("", "Cập nhật content không thành công");
         }
     }
     return(View());
 }