private int CaiPuEval_Trans(IDbHelp thelp, object obj) { CaiPuMsg_TransM tmod = (CaiPuMsg_TransM)obj; CaiPu_MsgM mod = tmod.mod; string sSql = "insert into CaiPu_Msg(FK_User,FK_Pro,Detail,Purview,IP) values(@FK_User,@FK_Pro,@Detail,@Purview,@IP)"; IDataParameter[] dp = { DbHelp.Def.AddParam("@FK_User", mod.FK_User), DbHelp.Def.AddParam("@FK_Pro", mod.FK_Pro), DbHelp.Def.AddParam("@Detail", mod.Detail), DbHelp.Def.AddParam("@Purview", mod.Purview), DbHelp.Def.AddParam("@IP", mod.IP), }; if (thelp.Update(sSql, dp) > 0) { banH.Add(); //若用户登录 if (mod.FK_User > 0) { //增加积分或经验 string sname = DbHelp.First("select ProName from CaiPu_Info where ProSN=" + mod.FK_Pro); User_FractHandler.FractHandlerParam ufParam = new User_FractHandler.FractHandlerParam(mod.FK_User, "system", 1, "caipu_comment", "caipu_comment", "菜谱评论 \"" + sname + "\""); ufParam.FK_All = mod.FK_Pro; string slog = new User_FractHandler(thelp).SetFract(ufParam); //string slog = new User_FractHandler(thelp).SetFract(mod.FK_User, "system", 1, "caipu_comment", "caipu_comment", "菜谱评论 \"" + sname + "\""); if (slog != "1") { tmod.returnValue = slog; return(0); } } } else { tmod.returnValue = "nosubmit"; return(0); } tmod.returnValue = "1"; return(1); }
private int NewsEval_Trans(IDbHelp thelp, object obj) { NewsMsg_TransM tmod = (NewsMsg_TransM)obj; News_MsgM mod = tmod.mod; string sql = "insert into News_Msg(FK_User,FK_News,Detail,Purview,IP) values(@FK_User,@FK_News,@Detail,@Purview,@IP)"; IDataParameter[] dp = { DbHelp.Def.AddParam("@FK_User", mod.FK_User), DbHelp.Def.AddParam("@FK_News", mod.FK_News), DbHelp.Def.AddParam("@Detail", mod.Detail), DbHelp.Def.AddParam("@Purview", mod.Purview), DbHelp.Def.AddParam("@IP", mod.IP), }; if (thelp.Update(sql, dp) > 0) { banH.Add(); //若用户登录 if (mod.FK_User > 0) { //增加积分或经验 string sname = DbHelp.First("select Title from News_Info where NewsSN=" + mod.FK_News); User_FractHandler.FractHandlerParam ufParam = new User_FractHandler.FractHandlerParam(mod.FK_User, "system", 1, "news_comment", "news_comment", "新闻评论 \"" + sname + "\""); ufParam.FK_All = mod.FK_News; string slog = new User_FractHandler(thelp).SetFract(ufParam); //string slog = new User_FractHandler(thelp).SetFract(mod.FK_User, "system", 1, "news_comment", "news_comment", "新闻评论 \"" + sname + "\""); if (slog != "1") { tmod.returnValue = slog; return(0); } } } else { tmod.returnValue = "nosubmit"; return(0); } tmod.returnValue = "1"; return(1); }
private int ProEval_Trans(IDbHelp thelp, object obj) { ProEval_TransM tmod = (ProEval_TransM)obj; Pro_EvaluateM mod = tmod.mod; string sql = "insert into Pro_Evaluate(FK_User,FK_Pro,Fraction,Detail,Purview,IP) values(@FK_User,@FK_Pro,@Fraction,@Detail,@Purview,@IP)"; IDataParameter[] dp = { DbHelp.Def.AddParam("@FK_User", mod.FK_User), DbHelp.Def.AddParam("@FK_Pro", mod.FK_Pro), DbHelp.Def.AddParam("@Fraction", mod.Fraction), DbHelp.Def.AddParam("@Detail", mod.Detail), DbHelp.Def.AddParam("@Purview", mod.Purview), DbHelp.Def.AddParam("@IP", mod.IP), }; if (thelp.Update(sql, dp) > 0) { banH.Add(); //增加积分或经验 string sname = DbHelp.First("select ProName from Pro_Info where ProSN=" + mod.FK_Pro); User_FractHandler.FractHandlerParam ufParam = new User_FractHandler.FractHandlerParam(mod.FK_User, "system", 1, "pro_eval", "pro_eval", "产品评价 \"" + sname + "\""); ufParam.FK_All = mod.FK_Pro; string slog = new User_FractHandler(thelp).SetFract(ufParam); //string slog = new User_FractHandler(thelp).SetFract(mod.FK_User, "system", 1, "pro_eval", "pro_eval", "产品评价 \"" + sname + "\""); if (slog != "1") { tmod.returnValue = slog; return(0); } tmod.returnValue = "1"; return(1); } else { tmod.returnValue = "nosubmit"; return(0); } }