예제 #1
0
        public ActionResult ImagesSet(int id, FormCollection f, HttpPostedFileBase fileImage)
        {
            bizImagesShow b = new bizImagesShow();
            ImagesShow model = b.Get(int.Parse(f["ImageShowID"]), int.Parse(f["ImageShowTypeID"]));
            Public.ImageHelper.UpImageAttr upImageAttr;
            string result = "";

            model.Attach();

            if (fileImage != null)
            {
                result = Public.ImageHelper.ImageUp(fileImage, Enumerations.ImageUpPathType.sysimg, model.ImagePath == null ? "" : model.ImagePath, out upImageAttr);
                if (result == "")
                    model.ImagePath = upImageAttr.imagePath;
            }
            model.Url = f["Url"];
            model.Title = f["Title"];
            model.ModTime = DateTime.Now;
            model.Detach();
            if(result=="")
                b.Update(model);
            else
                TempData["Msg"] = result;

            return RedirectToAction("ImagesSet", new { id = id, showID = model.ImageShowID });
        }
예제 #2
0
 public ActionResult ImagesSet(int id)
 {
     int showID = Request.QueryString["showID"] == null ? 1 : int.Parse(Request.QueryString["showID"]);
     bizImageShowType bt = new bizImageShowType();
     bizImagesShow b = new bizImagesShow();
     ViewData["showTypeID"] = id;
     ViewData["showID"] = showID;
     ImageShowType modelType=bt.Get(id);
     ImagesShow model = b.Get(showID, id);
     ViewData["ModelType"]=modelType;
     return View(model);
 }