public List <Trade> GetTradeLists(int?UserAccountId, int State, int?IsQrcode, DateTime?BeginTime, DateTime?EndTime) { string sql = string.Empty; string wherestr = string.Empty; if (UserAccountId != null) { wherestr += "and UserAccountId =@0 "; } if (State > -1) { wherestr += "and State =@1 "; } if (IsQrcode != null) { wherestr += " and IsQrcode =@2 "; } if (BeginTime != null) { wherestr += " and TradeTime >=@3 "; } if (EndTime != null) { wherestr += " and TradeTime <@4 "; } sql = string.Format(@" SELECT * FROM dbo.Trade WHERE 1=1 {0} ", wherestr); return(CollectionDB.GetInstance().Fetch <Trade>(sql, UserAccountId, State, IsQrcode, BeginTime, EndTime?.AddDays(1))); }
public Agent GetAgentLogin(Agent model) { #region sql string wherestr = string.Empty; if (!string.IsNullOrEmpty(model.UserName)) { wherestr += " AND UserName = @0"; } if (!string.IsNullOrEmpty(model.UserPwd)) { wherestr += " AND UserPwd = @1 "; } if (model.AgentId > 0) { wherestr += " AND AgentId = @2"; } string sql = string.Format(@" SELECT * FROM dbo.Agent WHERE 1 = 1 {0} ", wherestr); #endregion return(CollectionDB.GetInstance().SingleOrDefault <Agent>(sql, model.UserName, model.UserPwd, model.AgentId)); }
public List <AgentTrade> GetAgentTradeLists(int AgentId, int State, string TradeOrderId, DateTime?BeginTime, DateTime?EndTime) { string sql = string.Empty; string wherestr = string.Empty; if (AgentId > 0) { wherestr += " and AgentId =@0 "; } if (State > -1) { wherestr += " and State =@1 "; } if (!string.IsNullOrWhiteSpace(TradeOrderId)) { wherestr += " and TradeOrderId =@2 "; } if (BeginTime != null) { wherestr += " and TradeTime >=@3 "; } if (EndTime != null) { wherestr += " and TradeTime <@4 "; } sql = string.Format(@" SELECT * FROM dbo.AgentTrade WHERE 1=1 {0} ORDER BY CreateTime DESC", wherestr); return(CollectionDB.GetInstance().Fetch <AgentTrade>(sql, AgentId, State, TradeOrderId, BeginTime, EndTime?.AddDays(1))); }
public List <UserAccount> GetUserList(string UserName, string Phone, int UserAccountId, int IsQrcode) { string sql = string.Empty; string wherestr = string.Empty; if (!string.IsNullOrWhiteSpace(UserName)) { wherestr += " and UserName =@0 "; } if (!string.IsNullOrWhiteSpace(Phone)) { wherestr += " and Phone =@1 "; } if (UserAccountId > 0) { wherestr += " and UserAccountId =@2 "; } if (IsQrcode > 0) { wherestr += " and IsQrcode =@3 "; } sql = string.Format(@" SELECT * FROM dbo.UserAccount WHERE 1=1 {0} ORDER BY CreateTime DESC", wherestr); return(CollectionDB.GetInstance().Fetch <UserAccount>(sql, UserName, Phone, UserAccountId, IsQrcode)); }
public AgentTrade GetAgentTrade(AgentTrade model) { #region sql string wherestr = string.Empty; if (!string.IsNullOrWhiteSpace(model.TradeOrderId)) { wherestr += " AND TradeOrderId = @0 "; } if (!string.IsNullOrWhiteSpace(model.OrderId)) { wherestr += " AND OrderId = @1 "; } if (model.AgentId > 0) { wherestr += " AND AgentId = @2 "; } string sql = string.Format(@" SELECT * FROM [dbo].[AgentTrade] WHERE 1 = 1 {0} ", wherestr); #endregion var agentTrade = CollectionDB.GetInstance().FirstOrDefault <AgentTrade>(sql, model.TradeOrderId, model.OrderId, model.AgentId); return(agentTrade); }
public int UpdateProblem(Problem model) { string sql = string.Empty; sql = "SET Title=@0,Body=@1,MotifyTime=@2 WHERE ProblemId = @3"; return(CollectionDB.GetInstance().Update <Problem>(sql, model.Title, model.Body, model.MotifyTime, model.ProblemId)); }
public int UpdateRate(int UserAccountId, decimal Rate, decimal UserDrawFee) { string wherestr = string.Empty; wherestr = " AND UserAccountId=" + UserAccountId; string sql = string.Format("SET UserRate={0},UserDrawFee = {2} WHERE 1=1 {1}", Rate, wherestr, UserDrawFee); return(CollectionDB.GetInstance().Update <UserAccount>(sql)); }
public int UpdateIsQrcode(int UserAccountId, int IsQrcode, decimal Rate, decimal DrawFee) { string wherestr = string.Empty; wherestr = " AND UserAccountId=" + UserAccountId; string sql = string.Format("SET IsQrcode={0},Rate={2},DrawFee = {3} WHERE 1=1 {1}", IsQrcode, wherestr, Rate, DrawFee); return(CollectionDB.GetInstance().Update <UserAccount>(sql)); }
public int UpdateMemberlevel(int UserAccountId, int Memberlevel) { string wherestr = string.Empty; wherestr = " AND UserAccountId=" + UserAccountId; string sql = string.Format("SET Memberlevel={0} WHERE 1=1 {1}", Memberlevel, wherestr); return(CollectionDB.GetInstance().Update <UserAccount>(sql)); }
public Page <Advice> GetAdviceList(int pageindex, int pagesize) { string sql = string.Empty; string wherestr = string.Empty; sql = string.Format(@" SELECT * FROM dbo.Advice WHERE 1=1 {0} ORDER BY CreateTime DESC", wherestr); return(CollectionDB.GetInstance().Page <Advice>(pageindex, pagesize, sql)); }
public List <BankCard> GetBankCardList(int UserAccountId) { string sql = string.Empty; string wherestr = string.Empty; wherestr += "and UserAccountId =@0"; sql = string.Format(@" SELECT * FROM dbo.BankCard WHERE 1=1 {0} ORDER BY CreateTime DESC", wherestr); return(CollectionDB.GetInstance().Fetch <BankCard>(sql, UserAccountId)); }
public BankCard GetBankCard(BankCard model) { string sql = string.Empty; string wherestr = string.Empty; wherestr += " and CardId =@0 "; wherestr += " and UserAccountId =@1 "; sql = string.Format(@" SELECT * FROM dbo.BankCard WHERE 1=1 {0} ORDER BY CreateTime DESC", wherestr); return(CollectionDB.GetInstance().Fetch <BankCard>(sql, model.CardId, model.UserAccountId).FirstOrDefault()); }
public Page <Agent> GetAgentListByPage(int pageindex, int pagesize) { #region sql string wherestr = string.Empty; string sql = string.Format(@" SELECT * FROM dbo.Agent WHERE 1 = 1 {0} ORDER BY CreateTime DESC ", wherestr); #endregion return(CollectionDB.GetInstance().Page <Agent>(pageindex, pagesize, sql)); }
public int UpdateAgentState(int AgentId, int State) { #region sql string wherestr = string.Empty; wherestr += "AND AgentId = " + AgentId; string modifystr = string.Empty; string sql = string.Format(@" SET State=@0 WHERE 1 = 1 {0} ", wherestr); #endregion return(CollectionDB.GetInstance().Update <Agent>(sql, State)); }
public int UpdateAgent(Agent agent) { #region sql string wherestr = string.Empty; wherestr += "AND AgentId = " + agent.AgentId; string modifystr = string.Empty; string sql = string.Format(@" SET MerchantName=@0,Rate = @1,Phone=@2 WHERE 1 = 1 {0} ", wherestr); #endregion return(CollectionDB.GetInstance().Update <Agent>(sql, agent.MerchantName, agent.Rate, agent.Phone)); }
public List <Agent> GetAgentList() { #region sql string wherestr = string.Empty; string sql = string.Format(@" SELECT * FROM dbo.Agent WHERE 1 = 1 {0} ORDER BY CreateTime DESC ", wherestr); #endregion return(CollectionDB.GetInstance().Fetch <Agent>(sql)); }
public Problem GetProblem(Problem model) { string sql = string.Empty; string wherestr = string.Empty; wherestr += "and ProblemId =@0"; sql = string.Format(@" SELECT * FROM dbo.Problem WHERE 1=1 {0} ORDER BY MotifyTime DESC", wherestr); return(CollectionDB.GetInstance().SingleOrDefault <Problem>(sql, model.ProblemId)); }
public int AddIntegral(int UserAccountId, int Integral, int?Memberlevel) { string wherestr = string.Empty; wherestr += " AND UserAccountId=" + UserAccountId; string setstr = string.Empty; if (Memberlevel != null) { setstr += ",Memberlevel=" + Memberlevel; } string sql = string.Format("SET Integral={0}{2} WHERE 1=1 {1}", Integral, wherestr, setstr); return(CollectionDB.GetInstance().Update <UserAccount>(sql)); }
public Page <Problem> GetProblemList(int pageindex, int pagesize, string Title) { string sql = string.Empty; string wherestr = string.Empty; if (!string.IsNullOrWhiteSpace(Title)) { wherestr += "and Title =@0"; } sql = string.Format(@" SELECT * FROM dbo.Problem WHERE 1=1 {0} ORDER BY MotifyTime DESC", wherestr); return(CollectionDB.GetInstance().Page <Problem>(pageindex, pagesize, sql, Title)); }
public Page <UserAccount> GetUserList(int pageindex, int pagesize, string UserName, string Phone, int UserAccountId) { string sql = string.Empty; string wherestr = string.Empty; if (!string.IsNullOrWhiteSpace(UserName)) { wherestr += " and UserName =@0 "; } if (!string.IsNullOrWhiteSpace(Phone)) { wherestr += " and Phone =@1 "; } if (UserAccountId > 0) { wherestr += " and UserAccountId =@2 "; } sql = string.Format(@" SELECT * FROM dbo.UserAccount WHERE 1=1 {0} ORDER BY CreateTime DESC", wherestr); return(CollectionDB.GetInstance().Page <UserAccount>(pageindex, pagesize, sql, UserName, Phone, UserAccountId)); }
public Agent GetAgent(Agent model) { #region sql string wherestr = string.Empty; if (model.AgentId > 0) { wherestr += " AND AgentId = @0 "; } if (!string.IsNullOrWhiteSpace(model.UserPwd)) { wherestr += " AND UserPwd = @1 "; } string sql = string.Format(@" SELECT * FROM [dbo].[Agent] WHERE 1 = 1 AND State=1 {0} ", wherestr); #endregion var agent = CollectionDB.GetInstance().FirstOrDefault <Agent>(sql, model.AgentId, model.UserPwd); return(agent); }
public int Delete(int BankCardId) { return(CollectionDB.GetInstance().Delete <BankCard>(BankCardId)); }
public object Insert(Problem model) { return(CollectionDB.GetInstance().Insert(model)); }
public int Delete(Problem model) { return(CollectionDB.GetInstance().Delete(model)); }
public int Update(Problem model) { return(CollectionDB.GetInstance().Update(model)); }
public object Insert(Advice model) { return(CollectionDB.GetInstance().Insert(model)); }
public object Add(Agent model) { return(CollectionDB.GetInstance().Insert(model)); }
public int UpdateStateFail(int State, string OrderId, string PlatFormId) { string sql = "set State=@0,PlatFormId=@2 where [TradeOrderId]=@1"; return(CollectionDB.GetInstance().Update <Trade>(sql, State, OrderId, PlatFormId)); }
public object Insert(BankCard model) { return(CollectionDB.GetInstance().Insert(model)); }
public int Update(UserAccount model) { return(CollectionDB.GetInstance().Update(model)); }