public void UploadSuccessReward(Guid fileId,int reqId) { DocService ds = Context.GetService<DocService>(); U_UserInfo u = base.GetUser(); DDocInfo doc = ds.DDocInfoBll.GetByFileId(fileId); //更新悬赏列表的加入文档数量 TReqDoc trdoc = ds.TReqDocBll.Get(reqId); trdoc.DocCount += 1; ds.TReqDocBll.Update(trdoc); //新增到加入列表 TJoinDoc jd = new TJoinDoc() { DocId = doc.DocId, TId = reqId, Title = doc.Title, UserId = u.UserId, IsWin = false }; ds.TJoinDocBll.Insert(jd); //转至我的投稿页面 AddSuccess("投稿成功"); Redirect("/my/MyContribute.do"); }
/// <summary> /// 更新数据 /// </summary> /// <param name="obj"></param> /// <returns>返回:ture 成功,false 失败</returns> public bool Update(TJoinDoc obj) { return dal.Update(obj); }
/// <summary> /// 更新数据 /// </summary> /// <param name="obj"></param> /// <returns>返回:ture 成功,false 失败</returns> public bool Update(TJoinDoc obj) { if (obj == null) throw new ArgumentNullException("obj"); String stmtId = "TJoinDoc.Update"; int result = SqlMapper.Instance().QueryForObject<int>(stmtId, obj); return result > 0 ? true : false; }
/// <summary> /// 插入数据 /// </summary> /// <param name="obj">对象</param> /// <returns>返回:该条数据的主键Id</returns> public int Insert(TJoinDoc obj) { return dal.Insert(obj); }
/// <summary> /// 插入数据 /// </summary> /// <param name="obj">对象</param> /// <returns>返回:该条数据的主键Id</returns> public int Insert(TJoinDoc obj) { if (obj == null) throw new ArgumentNullException("obj"); String stmtId = "TJoinDoc.Insert"; return SqlMapper.Instance().QueryForObject<int>(stmtId, obj); }