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)));
        }
Beispiel #4
0
        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);
        }
Beispiel #6
0
        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));
        }
Beispiel #7
0
        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));
        }
Beispiel #8
0
        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));
        }
Beispiel #9
0
        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));
        }
Beispiel #10
0
        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));
        }
Beispiel #11
0
        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));
        }
Beispiel #12
0
        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());
        }
Beispiel #13
0
 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));
 }
Beispiel #14
0
 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));
 }
Beispiel #15
0
 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));
 }
Beispiel #16
0
 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));
 }
Beispiel #17
0
        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));
        }
Beispiel #18
0
        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));
        }
Beispiel #19
0
        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));
        }
Beispiel #20
0
        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));
        }
Beispiel #21
0
        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);
        }
Beispiel #22
0
 public int Delete(int BankCardId)
 {
     return(CollectionDB.GetInstance().Delete <BankCard>(BankCardId));
 }
Beispiel #23
0
 public object Insert(Problem model)
 {
     return(CollectionDB.GetInstance().Insert(model));
 }
Beispiel #24
0
 public int Delete(Problem model)
 {
     return(CollectionDB.GetInstance().Delete(model));
 }
Beispiel #25
0
 public int Update(Problem model)
 {
     return(CollectionDB.GetInstance().Update(model));
 }
Beispiel #26
0
 public object Insert(Advice model)
 {
     return(CollectionDB.GetInstance().Insert(model));
 }
Beispiel #27
0
 public object Add(Agent model)
 {
     return(CollectionDB.GetInstance().Insert(model));
 }
Beispiel #28
0
        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));
        }
Beispiel #29
0
 public object Insert(BankCard model)
 {
     return(CollectionDB.GetInstance().Insert(model));
 }
Beispiel #30
0
 public int Update(UserAccount model)
 {
     return(CollectionDB.GetInstance().Update(model));
 }