/// <summary> /// 保存活动(使用新的活动lxy) /// </summary> /// <param name="activityId"></param> /// <returns></returns> public ActionResult TopicRefCreate(SWfsVActivityTopicsRef obj, string activityId) { if (Request.Form["cb_KeyID"] != null) { obj.ActivityId = Request.Form["activityIds"]; obj.OperatorId = PresentationHelper.GetPassport().UserName; obj.DateCreate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd").Replace("/", "")); string[] arry = Request.Form["cb_KeyID"].Split(','); for (int i = 0; i < arry.Length; i++) { obj.TopicNo = arry[i]; Vcode.TopicsRefCreate(obj); } } return(Content("<script>alert('关联成功'); window.location.href='/Shangpin/VCode/RelatedTopicsListV.html?activityId=" + obj.ActivityId + "'</script>")); }
public ActionResult TopicRefDeleById(string SubjectNo, string ActivityId, int Status) { int count = 0; string mess = string.Empty; if (Status > 0) { //是否已经关联,如果关联不执行添加方法,直接count=1成功 SWfsVActivityTopicsRef obj = Vcode.SelectSingleBySubjectNoRef(SubjectNo, ActivityId); if (obj == null) { obj = new SWfsVActivityTopicsRef(); obj.ActivityId = ActivityId; obj.OperatorId = PresentationHelper.GetPassport().UserName; obj.DateCreate = DateTime.Now; obj.TopicNo = SubjectNo; count = Vcode.TopicsRefCreate(obj); } else { count = 1; } mess = "关联成功"; } else { count = Vcode.TopicRefDelete(SubjectNo, ActivityId); mess = "取消关联"; } if (count > 0) { return(Json(new { result = "1", message = mess })); } else { return(Json(new { result = "0", message = "修改失败!" })); } }
/// <summary> /// 保存专题 /// </summary> /// <param name="obj"></param> /// <returns></returns> public int TopicsRefCreate(SWfsVActivityTopicsRef obj) { return(DapperUtil.Insert <SWfsVActivityTopicsRef>(obj, true)); }