Ejemplo n.º 1
0
        public ActionResult NewsEdit(int id, FormCollection collection, HttpPostedFileBase fileImg)
        {
            if (Request.Cookies["Username"] != null)
            {
                string Name        = collection["Name"];
                string Tag         = StringClass.NameToTag(collection["Name"]);
                string Image       = collection["Image"];
                string Content     = collection["Content"];
                string Detail      = collection["Detail"];
                int    IdGroup     = Convert.ToInt32(collection["GroupNew"]);
                string Keyword     = collection["Keyword"];
                string Description = collection["Description"];
                string Title       = collection["Title"];
                int    Ord         = Convert.ToInt32(collection["Ord"]);
                bool   Index       = (collection["Index"] == "false") ? false : true;
                bool   Active      = (collection["Active"] == "false") ? false : true;
                int    View        = 0;//so luot xem

                DateTime SDate = DateTime.Now;
                db.sp_News_Update(id, Name, Tag, Title, Keyword, Description, Image, SDate, Content, Detail, Index, View, IdGroup, Ord, Active, Session["Lang"].ToString());
                db.SaveChanges();
                return(RedirectToAction("NewsIndexot"));
            }
            else
            {
                return(Redirect("/Admins/admins"));
            }
        }