123456789101112131415161718192021222324252627282930313233343536 |
- using System;
- using System.Collections.Generic;
- using Library;
- using System.Linq;
- using System.Data;
- namespace MySystem
- {
- public class HelpProfitTradeSummaryDbconn
- {
- public readonly static HelpProfitTradeSummaryDbconn Instance = new HelpProfitTradeSummaryDbconn();
- public HelpProfitTradeSummaryDbconn()
- { }
- public decimal GetTrade(int UserId, string TradeDateOrMonth, string kind = "self")
- {
- string condition = "";
- if(TradeDateOrMonth.Length == 8)
- {
- condition = " and TradeDate='" + TradeDateOrMonth + "'";
- }
- else
- {
- condition = " and TradeMonth='" + TradeDateOrMonth + "'";
- }
- decimal amt = 0;
- DataTable dt = CustomerSqlConn.dtable("select sum(TradeAmount) from HelpProfitUserTradeSummay where UserId=" + UserId + " and SeoTitle='" + kind + "'" + condition, MysqlConn.ReadSqlConnStr);
- if(dt.Rows.Count > 0)
- {
- amt = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString()));
- }
- return amt;
- }
- }
- }
|