public ActionResult Intro() { DBC.WeChat.Models.Infrastructures.Store StoreModel = GetStore(); var banQuery = new BannerPictureQuery { StoreIDs = new long[] { OwnerID }, PictureTypes = new int[] { (int)StorePicType.IntroPicture } }; var banModel = svc.SelectOrEmpty(banQuery); if (StoreModel == null) { StoreModel = new WeChat.Models.Infrastructures.Store(); } if (banModel != null && banModel.Any()) { Collection <BannerPicture> bCollection = new Collection <BannerPicture>(); foreach (var item in banModel.ToList()) { item.Path = Path.Combine(ftp, item.Path, item.Name); bCollection.Add(item); } StoreModel.BannerPictures = bCollection; } return(View(StoreModel)); }
/// <summary> /// 保存更新Store表中Announcement字段 /// </summary> /// <param name="announcement"></param> /// <returns>操作结果</returns> public ActionResult SaveAnnouncement(string sname, string announcement) { JsonResult result = new JsonResult { JsonRequestBehavior = JsonRequestBehavior.AllowGet }; try { DBC.WeChat.Models.Infrastructures.Store _Store = GetStore(); _Store.Name = sname; _Store.Announcement = announcement; svc.Update(_Store); result.Data = new { Success = true }; return(result); } catch (Exception e) { result.Data = new { Success = false, Message = e.Message }; return(result); } }
/// <summary> /// 获取店铺信息 /// </summary> /// <returns>店铺信息</returns> private DBC.WeChat.Models.Infrastructures.Store GetStore() { DBC.WeChat.Models.Infrastructures.Store _Stroe = svc.SelectOrEmpty(new StoreQuery() { IDs = new long[] { OwnerID } }).FirstOrDefault(); return(_Stroe); }
public JsonResult AjaxIntro(string Phone, string Email, string Address, string Description) { JsonResult result = new JsonResult { JsonRequestBehavior = JsonRequestBehavior.AllowGet }; try { DBC.WeChat.Models.Infrastructures.Store StoreModel = GetStore(); StoreModel.Address = Address; StoreModel.Phone = Phone; StoreModel.Email = Email; StoreModel.Description = Description; svc.Update(StoreModel); result.Data = new { success = true, message = "修改成功" }; } catch (Exception e) { result.Data = new { success = false, message = e.Message }; } return(result); }