public void DeleteConditionsByLogic(int sysno) { using (SQLData data = new SQLData()) { StringBuilder builder = new StringBuilder(); builder.Append(@"delete RSH_BaziCondition where LogicSysNo=").Append(sysno); try { data.CmdtoNone(builder.ToString()); } catch (Exception exception) { } } }
public void CopyPrivilege(int fromuser, int touser) { using (SQLData data = new SQLData()) { StringBuilder builder = new StringBuilder(); builder.Append(@"insert into REL_Admin_Privilege (Privilege_sysno,admin_sysno) select privilege_sysno,").Append(touser).Append(" where admin_sysno=").Append(fromuser).Append(" and dr=0"); try { data.CmdtoNone(builder.ToString()); } catch (Exception exception) { throw exception; } } }
public void AddConsume(int CustomerSysNo, int TotalSellRMB, int TotalBuyRMB, int TotalBuyPoint) { using (SQLData data = new SQLData()) { StringBuilder builder = new StringBuilder(); builder.Append("update USR_Customer set TotalSellRMB = TotalSellRMB+").Append(TotalSellRMB).Append(",TotalBuyRMB = TotalBuyRMB+").Append(TotalBuyRMB) .Append(",TotalBuyPoint = TotalBuyPoint+").Append(TotalBuyPoint).Append(" where SysNo=").Append(CustomerSysNo); try { data.CmdtoNone(builder.ToString()); } catch (Exception exception) { //throw exception; } } }
/// <summary> /// 蜘蛛导入记录去除时恢复导入标示 /// </summary> /// <param name="sysno"></param> public void InputReturn(int sysno) { using (SQLData data = new SQLData()) { StringBuilder builder = new StringBuilder(); builder.Append(@"Update [SPD_Famous] set [FamousSysNo]=null where [FamousSysNo]=").Append(sysno); try { data.CmdtoNone(builder.ToString()); } catch (Exception exception) { throw exception; } } }
public void RemoveAttention(int UserSysNo, int TagetSysNo) { TransactionOptions options = new TransactionOptions(); options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; options.Timeout = TransactionManager.DefaultTimeout; using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options)) { using (SQLData data = new SQLData()) { StringBuilder builder = new StringBuilder(); builder.Append("update BLG_Attention set DR=").Append((int)AppEnum.State.deleted).Append(" where CustomerSysNo=").Append(UserSysNo).Append(" and TargetSysNo=").Append(TagetSysNo).Append(" and DR=").Append((int)AppEnum.State.normal); try { data.CmdtoNone(builder.ToString()); } catch (Exception exception) { //throw exception; } } scope.Complete(); } }
/// <summary> /// 删除某案例的所有关键字 /// </summary> /// <param name="SysNo"></param> public void RemoveAllKeyByFamous(int SysNo) { using (SQLData data = new SQLData()) { StringBuilder builder = new StringBuilder(); builder.Append("delete SYS_Famous_KeyWords where Famous_SysNo=").Append(SysNo); try { data.CmdtoNone(builder.ToString()); } catch (Exception exception) { throw exception; } } }
public void ZeroUnReadInfo(int sysno) { using (SQLData data = new SQLData()) { StringBuilder builder = new StringBuilder(); builder.Append("update USR_Customer set HasNewInfo = 0 where sysno =").Append(sysno); try { data.CmdtoNone(builder.ToString()); } catch (Exception exception) { //throw exception; } } }
public int AddExp(int exp, int sysno) { int ret = 0; using (SQLData data = new SQLData()) { StringBuilder builder = new StringBuilder(); builder.Append("update USR_Customer set Exp = Exp+(").Append(exp).Append(") where SysNo=").Append(sysno) .Append(";select Exp from USR_Customer where SysNo=").Append(sysno) .Append(";select * from USR_Grade where SysNo in (select GradeSysNo from USR_Customer where SysNo=").Append(sysno).Append(")"); try { DataSet m_ds = data.CmdtoDataSet(builder.ToString()); ret = int.Parse(m_ds.Tables[0].Rows[0]["Exp"].ToString()); DataTable m_grade = USR_GradeBll.GetInstance().GetList(); for (int i = 0; i < m_grade.Rows.Count; i++) { if (int.Parse(m_grade.Rows[i]["LevelNum"].ToString()) == int.Parse(m_ds.Tables[1].Rows[0]["LevelNum"].ToString()) + 1) { if (ret >= int.Parse(m_grade.Rows[i]["Exp"].ToString())) { data.CmdtoNone("update USR_Customer set GradeSysNo=" + m_grade.Rows[i]["SysNo"].ToString() + " where sysno=" + sysno); } } } } catch (Exception exception) { //throw exception; } } return ret; }
/// <summary> /// /// </summary> /// <param name="CustomerSysNo"></param> /// <param name="TotalQuest">问答部分总提问数</param> /// <param name="TotalAnswer">问答部分总回答数</param> /// <param name="BestAnswer">被采纳回答数</param> /// <param name="TotalReply">问答部分总反馈数(提问者在自己问题中发评论)</param> /// <param name="TotalTalk">讨论部分总发帖数</param> /// <param name="TotalTalkReply">讨论部分总回答数</param> /// <param name="SetOrderCount">付费咨询发报价单数</param> /// <param name="BuyOrderCount">付费咨询购买报价单数</param> /// <param name="SellOrderCount">付费咨询发的报价单成交数</param> public void AddCount(int CustomerSysNo, int TotalQuest, int TotalAnswer, int BestAnswer, int TotalReply, int TotalTalk, int TotalTalkReply, int SetOrderCount, int BuyOrderCount, int SellOrderCount) { using (SQLData data = new SQLData()) { StringBuilder builder = new StringBuilder(); builder.Append("update USR_Customer set TotalQuest = TotalQuest+").Append(TotalQuest).Append(",TotalAnswer = TotalAnswer+").Append(TotalAnswer) .Append(",BestAnswer = BestAnswer+").Append(BestAnswer).Append(",TotalReply = TotalReply+").Append(TotalReply) .Append(",TotalTalk = TotalTalk+").Append(TotalTalk).Append(",TotalTalkReply = TotalTalkReply+").Append(TotalTalkReply) .Append(",SetOrderCount = SetOrderCount+").Append(SetOrderCount).Append(",BuyOrderCount = BuyOrderCount+").Append(BuyOrderCount).Append(",SellOrderCount = SellOrderCount+").Append(SellOrderCount) .Append(" where SysNo=").Append(CustomerSysNo); try { data.CmdtoNone(builder.ToString()); } catch (Exception exception) { //throw exception; } } }