예제 #1
0
        public ActionResult CreateAbout(AboutUs a, HttpPostedFileBase imgAbout)
        {
            string FileName = DateTime.Now.Ticks + Path.GetFileName(imgAbout.FileName);
            string path     = Path.Combine(Server.MapPath("~/Images"), FileName);

            imgAbout.SaveAs(path);
            a.AboutImage = FileName;
            if (Repositories.CreateAU(a) == true)
            {
                TempData["success"] = "Create new about successfully!";
            }
            else
            {
                TempData["error"] = "Create new about failed!";
            }
            return(RedirectToAction("ListAbout"));
        }