/// <summary> /// 新增 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool AddHotSubject(HotSubjectModel model) { return(GoodsClient.Send <AddHotSubjectModelResponse>(new AddHotSubjectModel { AddDto = Mapper.Map <HotSubjectModel, GetHotSubjectDto>(model) }).DoFlag); }
/// <summary> /// 修改 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool UpdateHotSubject(HotSubjectModel model) { return(GoodsClient.Send <UpdHotSubjectModelResponse>(new UpdHotSubjectModel { UpdDto = Mapper.Map <HotSubjectModel, GetHotSubjectDto>(model) }).DoFlag); }
//新增 public JsonResult AddHotSubject(HotSubjectModel model) { var result = new BaseResponse() { DoFlag = false, DoResult = "添加失败,请稍后重试... ..." }; #region 参数验证 //if (string.IsNullOrEmpty(model.LogiscticId)) //{ // result.DoResult = "请填写配送商ID"; // return Json(result); //} //if (string.IsNullOrEmpty(model.LogiscticCompanyName)) //{ // result.DoResult = "请填写配送商名称"; // return Json(result); //} //model.RowCreateDate = DateTime.Now; //model.IsDel = 0; #endregion try { var flag = HotStyleClient.Instance.AddHotSubject(new HotSubjectModel { SubjectName = model.SubjectName, SujectDesc = model.SujectDesc, ApplyPlace = model.ApplyPlace, StartTime = model.StartTime, EndTime = model.EndTime, PictureUrl = model.PictureUrl, PictureUrlTrans = model.PictureUrlTrans, CreateBy = 888, CreateDate = DateTime.Now, UpdateBy = 888, UpdateDate = DateTime.Now, IsDeleted = false, IsEnable = model.IsEnable, SetDiscount = model.SetDiscount, ClickUrl = model.ClickUrl, AppClickUrl = model.AppClickUrl, Sort = 0 }); if (flag) { result.DoFlag = true; result.DoResult = "添加成功"; } } catch (Exception ex) { result.DoResult = "添加异常"; } return(Json(result)); }
/// <summary> /// 查询单个 /// </summary> /// <param name="SysNo"></param> /// <returns></returns> public HotSubjectModel QueryHotSubjectModel(int SysNo) { var model = new HotSubjectModel(); var response = GoodsClient.Send <GetHotSubjectModelResponse>(new GetHotSubjectModel { Id = SysNo }); if (response.DoFlag && response.HotSubjectDto != null) { model = Mapper.Map <GetHotSubjectDto, HotSubjectModel>(response.HotSubjectDto); } return(model); }
//修改 public JsonResult UpdHotSubject(HotSubjectModel model) { var result = new BaseResponse() { DoFlag = false, DoResult = "更新失败 ,请稍后重试……" }; #region 参数验证 #endregion try { var flag = HotStyleClient.Instance.UpdateHotSubject(new HotSubjectModel { Id = model.Id, SubjectName = model.SubjectName, SujectDesc = model.SujectDesc, ApplyPlace = model.ApplyPlace, StartTime = model.StartTime, EndTime = model.EndTime, PictureUrl = model.PictureUrl, PictureUrlTrans = model.PictureUrlTrans, CreateBy = 888, CreateDate = DateTime.Now, UpdateBy = 888, UpdateDate = DateTime.Now, IsDeleted = false, IsEnable = model.IsEnable, SetDiscount = model.SetDiscount, ClickUrl = model.ClickUrl, AppClickUrl = model.AppClickUrl, }); if (flag) { result.DoFlag = true; result.DoResult = "修改成功"; } } catch (Exception ex) { result.DoResult = "修改异常"; } return(Json(result)); }