public ActionResult MyMall() { string owner = User.Identity.Name; ViewModel.MyMallInfo myMallInfo = new ClassLibrary.MarketDownstairs().GetMyMallInfo(owner); return(View(myMallInfo)); }
public ActionResult MyMall(ViewModel.MyMallInfo myMallInfo) { myMallInfo.Owner = User.Identity.Name; if (new ClassLibrary.MarketDownstairs().UpdateMyMallInfo(myMallInfo)) { ViewModel.MyMallInfo myNewMallInfo = new ClassLibrary.MarketDownstairs().GetMyMallInfo(myMallInfo.Owner); return(View(myNewMallInfo)); } return(View(myMallInfo)); }
public ActionResult UploadGood(ViewModel.UpLoadGoodModel uploadModel, HttpPostedFileBase image) { //if (image != null) //{ // string upLoadPath = Server.MapPath("~/Content/Images/"); // Random rn = new Random(); // string unique = rn.Next(1000).ToString(); // string fileName = uploadModel.GoodName + unique + System.IO.Path.GetExtension(image.FileName); // ///获取存储物理路径 // string fileAdress = upLoadPath + fileName; // string photoAdress = "/content/Images/" + fileName; // image.SaveAs(fileAdress); ///获取提交上来的图片路径 string photoAddress = Request.Form["imageAddress"]; if (photoAddress != null) { bool flag = new ClassLibrary.MarketDownstairs().UpLoadGoodInfo(uploadModel, photoAddress); if (flag) { return(RedirectToAction("MarketIndex")); } else { return(View(uploadModel)); } } else { return(View(uploadModel)); } //} //else //{ // return View(uploadModel); //} }