コード例 #1
0
        public ActionResult MapsDetail()
        {
            tblMap map = db.tblMaps.First();

            ViewBag.Title       = "<title>" + map.Name + "</title>";
            ViewBag.Description = "<meta name=\"description\" content=\"" + map.Description + "\"/>";
            ViewBag.Keyword     = "<meta name=\"keywords\" content=\"" + map.Name + "\" /> ";
            return(View(map));
        }
コード例 #2
0
        public PartialViewResult FootterPartial()
        {
            tblConfig tblconfig      = db.tblConfigs.Find(1);
            string    chinhsach      = "";
            var       listchinhscach = db.tblNews.Where(p => p.idCate == 12 && p.Active == true).OrderBy(p => p.Ord).ToList();

            for (int i = 0; i < listchinhscach.Count; i++)
            {
                chinhsach += "<a href=\"/News/" + listchinhscach[i].Tag + "-" + listchinhscach[i].id + ".aspx\" title=\"" + listchinhscach[i].Name + "\">" + listchinhscach[i].Name + "</a>";
            }
            ViewBag.chinhsach = chinhsach;
            string sanpham     = "";
            var    listProduct = db.tblGroupProducts.Where(p => p.Priority == true && p.Active == true).OrderBy(p => p.Ord).ToList();

            for (int i = 0; i < listProduct.Count; i++)
            {
                sanpham += "<h3><a href=\"/ListProduct/" + listProduct[i].Tag + "-" + listProduct[i].id + ".aspx\" title=\"" + listProduct[i].Title + "\">" + listProduct[i].Name + "</a></h3>";
            }
            ViewBag.sanpham = sanpham;
            tblMap tblmap = db.tblMaps.First();

            ViewBag.maps = tblmap.Content;
            var    listCapacity = db.tblCapacities.Where(p => p.Active == true).OrderBy(p => p.Ord).ToList();
            string dungtich     = "";

            foreach (var item in listCapacity)
            {
                dungtich += "<h3><a href=\"/" + item.Tag + ".html\" title=\"" + item.Title + "\">" + item.Name + "</a></h3>";
            }
            ViewBag.dungtich = dungtich;
            var Imagesadw = db.tblImages.Where(p => p.Active == true && p.idCate == 5).OrderByDescending(p => p.Ord).Take(1).ToList();

            if (Imagesadw.Count > 0)
            {
                ViewBag.Chuoiimg = "<a href=\"" + Imagesadw[0].Url + "\" title=\"" + Imagesadw[0].Name + "\"><img src=\"" + Imagesadw[0].Images + "\" alt=\"" + Imagesadw[0].Name + "\" style=\"max-width:100%;\" /> </a>";
            }
            var           listUrl   = db.tblUrls.Where(p => p.Active == true).OrderBy(p => p.Ord).ToList();
            StringBuilder resultUrl = new StringBuilder();

            for (int i = 0; i < listUrl.Count; i++)
            {
                resultUrl.Append("<h3 style = \"margin:0px; display:inline-block;   font-weight:normal\" ><a style = \"font-size:12px; margin:0px; color:#FFF\" href = \"" + listUrl[i].Url + "\" title = \"" + listUrl[i].Name + "\" > " + listUrl[i].Name + "</a ></h3 >");
            }
            ViewBag.resultUrl = resultUrl.ToString();
            return(PartialView(tblconfig));
        }
コード例 #3
0
        public ActionResult Edit(tblMap tblmaps, FormCollection collection)
        {
            if (ModelState.IsValid)
            {
                string idUser = Request.Cookies["Username"].Values["UserID"];
                tblmaps.UserID     = int.Parse(idUser);
                tblmaps.DateCreate = DateTime.Now;

                int id = int.Parse(collection["idMaps"]);
                tblmaps.id = id;
                db.Entry(tblmaps).State = EntityState.Modified;
                db.SaveChanges();



                #region [Updatehistory]
                Updatehistoty.UpdateHistory("Update Maps", Request.Cookies["Username"].Values["Username"].ToString(), Request.Cookies["Username"].Values["UserID"].ToString());
                #endregion
            }
            return(View(tblmaps));
        }
コード例 #4
0
        public ActionResult Edit()
        {
            if ((Request.Cookies["Username"] == null))
            {
                return(RedirectToAction("LoginIndex", "Login"));
            }
            if (ClsCheckRole.CheckQuyen(5, 2, int.Parse(Request.Cookies["Username"].Values["UserID"])) == true)
            {
                tblMap tblmaps = db.tblMaps.First();

                if (tblmaps == null)
                {
                    return(HttpNotFound());
                }

                return(View(tblmaps));
            }
            else
            {
                return(Redirect("/Users/Erro"));
            }
        }