public ViewResult Manage(string id) { if (id.IsNullOrEmpty()) { return(View(new PinTu())); } else { return(View(IPinTuService.Find(id))); } }
/// <summary> /// 分享 /// </summary> /// <param name="id"></param> /// <param name="code"></param> /// <returns></returns> public ActionResult AddShare(string id, TargetCode code) { if (code == TargetCode.Kanjia) { var kanjia = IKanJiaService.Find(id); if (kanjia == null || kanjia.IsDelete) { return(JResult(Core.Code.ErrorCode.sys_param_format_error, "")); } kanjia.ShareCount++; return(JResult(IKanJiaService.Update(kanjia))); } else if (code == TargetCode.Pintuan) { var pintuan = IPinTuanService.Find(id); if (pintuan == null || pintuan.IsDelete) { return(JResult(Core.Code.ErrorCode.sys_param_format_error, "")); } pintuan.ShareCount++; return(JResult(IPinTuanService.Update(pintuan))); } else if (code == TargetCode.Miaosha) { var miaosha = IMiaoShaService.Find(id); if (miaosha == null || miaosha.IsDelete) { return(JResult(Core.Code.ErrorCode.sys_param_format_error, "")); } miaosha.ShareCount++; return(JResult(IMiaoShaService.Update(miaosha))); } else if (code == TargetCode.Pintu) { var pintu = IPinTuService.Find(id); if (pintu == null || pintu.IsDelete) { return(JResult(Core.Code.ErrorCode.sys_param_format_error, "")); } pintu.ShareCount++; return(JResult(IPinTuService.Update(pintu))); } return(DataErorrJResult()); }
/// <summary> /// 查找 /// </summary> /// <returns></returns> public ActionResult Find(string id) { return(JResult(IPinTuService.Find(id))); }