コード例 #1
0
        public static int GetFeedBacksCount(string beginDate, string endDate, int status)
        {
            string sqlWhere = "1=1";

            if (status != -1)
            {
                sqlWhere += " and status=" + status;
            }

            if (!string.IsNullOrEmpty(beginDate))
            {
                sqlWhere += " and createtime>='" + beginDate + "'";
            }

            if (!string.IsNullOrEmpty(endDate))
            {
                sqlWhere += " and createtime<='" + DateTime.Parse(endDate).AddDays(1).ToString("yyyy-MM-dd") + "'";
            }

            int result = Convert.ToInt32(CommonBusiness.Select("FeedBack", "count(1)", sqlWhere));

            return(result);
        }
コード例 #2
0
        public static List <LotteryOrder> GetLotteryWin(string cpCode, int status, decimal winFee, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string btime = "", string etime = "")
        {
            string sqlwhere = " 1=1 ";

            if (!string.IsNullOrEmpty(cpCode))
            {
                sqlwhere += " and b.cpCode='" + cpCode + "'";
            }
            if (status > -1)
            {
                sqlwhere += " and b.Status=" + status;
            }
            if (!string.IsNullOrEmpty(btime))
            {
                sqlwhere += " and b.CreateTime>='" + btime + "'";
            }
            if (winFee > 0)
            {
                sqlwhere += " and b.WinFee>=" + winFee;
            }
            if (!string.IsNullOrEmpty(etime))
            {
                sqlwhere += " and b.CreateTime<='" + etime + " 23:59:59:999'";
            }
            DataTable dt = CommonBusiness.GetPagerData(" LotteryOrder (nolock) b join M_Users a on a.UserID=b.UserID ",
                                                       " b.* ,a.LoginName as UserName", sqlwhere, " b.AutoID ", pageSize, pageIndex,
                                                       out totalCount, out pageCount);
            List <LotteryOrder> list = new List <LotteryOrder>();

            foreach (DataRow dr in dt.Rows)
            {
                LotteryOrder model = new LotteryOrder();
                model.FillData(dr);
                list.Add(model);
            }
            return(list);
        }
コード例 #3
0
        public static bool CheckEmail(string email)
        {
            var result = CommonBusiness.Select("M_Users", "count(1)", " email='" + email + "' ");

            return(Convert.ToInt32(result) > 0);
        }
コード例 #4
0
        public static bool BoutOrder(string ordercode)
        {
            bool bl = CommonBusiness.Update("UserOrders", "Status", 3, "ordercode='" + ordercode + "' and Status=0");

            return(bl);
        }
コード例 #5
0
        public static bool DeleteOrder(string ordercode)
        {
            bool bl = CommonBusiness.Update("UserOrders", "Status", 9, "ordercode='" + ordercode + "'");

            return(bl);
        }
コード例 #6
0
        public static List <LotteryBettAuto> GetBettAutoRecord(string keyWords, string cpcode, string userid, string bCode, string issuenum, string type, int status, int winType, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, int self = 0, string begintime = "", string endtime = "")
        {
            string tablename = "LotteryBettAuto  a left join M_Users b  on a.UserID =b.UserID   ";
            string sqlwhere  = " a.status<>9 ";

            if (!string.IsNullOrEmpty(keyWords))
            {
                sqlwhere += " and (b.LoginName like '%" + keyWords + "%' or a.StartNum like '%" + keyWords + "%' or a.BCode like '%" + keyWords + "%'  or a.TypeName like '%" + keyWords + "%')";
            }
            if (!string.IsNullOrEmpty(type))
            {
                sqlwhere += " and a.Type like '%" + type + "%'";
            }
            if (status > -1)
            {
                sqlwhere += " and a.status=" + status;
            }
            if (winType > -1)
            {
                sqlwhere += " and a.WinType=" + winType;
            }
            if (!string.IsNullOrEmpty(userid))
            {
                if (self > 0)
                {
                    if (self == 1)
                    {
                        sqlwhere += " and a.UserID in(select UserID from UserRelation where ParentID='" + userid + "')";
                    }
                    else if (self == 2)
                    {
                        sqlwhere += " and a.UserID in(select UserID from UserRelation where Parents like '%" + userid + "%')";
                    }
                    else
                    {
                        sqlwhere += " and a.UserID='" + userid + "' ";
                    }
                }
            }
            if (!string.IsNullOrEmpty(begintime))
            {
                sqlwhere += " and a.CreateTime>='" + begintime + "'";
            }
            if (!string.IsNullOrEmpty(endtime))
            {
                sqlwhere += " and a.CreateTime<'" + endtime + " 23:59:59:999'";
            }
            if (!string.IsNullOrWhiteSpace(bCode))
            {
                sqlwhere += " and a.BCode ='" + bCode + "'";
            }
            if (!string.IsNullOrEmpty(issuenum))
            {
                sqlwhere += " and a.StartNum ='" + issuenum + "'";
            }
            DataTable dt = CommonBusiness.GetPagerData(tablename, "a.*,b.LoginName as UserName ", sqlwhere, "a.AutoID ", pageSize, pageIndex, out totalCount, out pageCount);
            List <LotteryBettAuto> list = new List <LotteryBettAuto>();

            foreach (DataRow dr in dt.Rows)
            {
                LotteryBettAuto model = new LotteryBettAuto();
                model.FillData(dr);
                list.Add(model);
            }
            return(list);
        }
コード例 #7
0
        public static List <LotteryOrder> GetLotteryOrder(string keyWords, string cpcode, string userid, string lcode, string issuenum, string type, string status, int winType, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, int self = 0, string begintime = "", string endtime = "", string username = "", string orderby = " a.AutoID ", string bcode = "", string winfee = "", string opentime = "", string opentimeend = "")
        {
            string tablename = "LotteryOrder (nolock) a left join M_Users b  on a.UserID =b.UserID " +
                               "left join lotteryResult (nolock) c on a.IssueNum=c.IssueNum   and a.CPCode=c.CPCode " +
                               " left join lotteryBettAuto (nolock) d on a.bcode=d.Bcode ";
            string sqlwhere = " a.status<>9 ";

            if (!string.IsNullOrEmpty(keyWords))
            {
                sqlwhere += " and (b.LoginName like '%" + keyWords + "%' or a.IssueNum like '%" + keyWords + "%' or a.LCode like '%" + keyWords + "%'  or a.TypeName like '%" + keyWords + "%')";
            }
            if (!string.IsNullOrEmpty(type))
            {
                sqlwhere += " and a.Type like '%" + type + "%'";
            }
            if (!string.IsNullOrEmpty(bcode))
            {
                sqlwhere += " and a.bcode='" + bcode + "'";
            }
            if (!string.IsNullOrEmpty(status) && status != "-1")
            {
                sqlwhere += " and a.status in(" + status + ")";
            }
            if (!string.IsNullOrEmpty(cpcode))
            {
                sqlwhere += " and a.cpcode='" + cpcode + "'";
            }
            if (!string.IsNullOrEmpty(username))
            {
                sqlwhere += " and b.LoginName='" + username + "'";
            }
            if (winType > -1)
            {
                sqlwhere += " and a.WinType=" + winType;
            }
            if (!string.IsNullOrEmpty(winfee))
            {
                sqlwhere += " and a.WinFee>" + Convert.ToDecimal(winfee);
            }
            if (!string.IsNullOrEmpty(opentime))
            {
                sqlwhere += " and c.opentime>='" + opentime + "'";
            }
            if (!string.IsNullOrEmpty(opentimeend))
            {
                sqlwhere += " and c.opentime<'" + opentimeend + "'";
            }
            if (!string.IsNullOrEmpty(userid))
            {
                if (self > 0)
                {
                    if (self == 1)
                    {
                        sqlwhere += " and a.UserID in(select UserID from UserRelation where ParentID='" + userid + "') ";
                    }
                    else if (self == 2)
                    {
                        sqlwhere += " and a.UserID in(select UserID from UserRelation where Parents like '%" + userid + "%')";
                    }
                    else
                    {
                        sqlwhere += " and a.UserID='" + userid + "' ";
                    }
                }
                else
                {
                    sqlwhere += " and (a.UserID in(select UserID from UserRelation where Parents like '%" + userid + "%') or  a.UserID='" + userid + "' )";
                }
            }
            if (!string.IsNullOrEmpty(begintime))
            {
                sqlwhere += " and a.CreateTime>='" + begintime + "'";
            }
            if (!string.IsNullOrEmpty(endtime))
            {
                sqlwhere += " and a.CreateTime<'" + endtime + " 23:59:59:999'";
            }
            if (!string.IsNullOrWhiteSpace(lcode))
            {
                sqlwhere += " and a.LCode ='" + lcode + "'";
            }
            if (!string.IsNullOrEmpty(issuenum))
            {
                sqlwhere += " and a.IssueNum ='" + issuenum + "'";
            }
            bool isdesc = true;

            if (!string.IsNullOrEmpty(orderby))
            {
                if (orderby.ToLower().IndexOf(" desc") > -1)
                {
                    isdesc = false;
                }
                orderby = orderby.Replace("desc", " ").Replace("asc", "");
            }
            DataTable           dt   = CommonBusiness.GetPagerData(tablename, " a.*,b.LoginName as UserName,c.ResultNum, isnull(d.IsStart,-1) IsStart,isnull(d.Status,-1) BettStatus", sqlwhere, orderby, pageSize, pageIndex, out totalCount, out pageCount, isdesc);
            List <LotteryOrder> list = new List <LotteryOrder>();

            foreach (DataRow dr in dt.Rows)
            {
                LotteryOrder model = new LotteryOrder();
                model.FillData(dr);
                list.Add(model);
            }
            return(list);
        }
コード例 #8
0
        public static List <M_Users> GetUsersRelationList(int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string userid, int type = -1, int status = -1, string keyWords = "", string colmonasc = " a.AutoID ", bool isasc = false,
                                                          string accountmin = "", string accountmax = "", bool myselft = false, int sourcetype = -1, int isline = -1)
        {
            string whereSql = " a.layers>0 and a.Status<>9   ";

            if (type > -1)
            {
                whereSql += " and a.type=" + type + " ";
            }
            if (isline > -1)
            {
                whereSql += " and a.isline=" + isline + " ";
            }
            if (!string.IsNullOrEmpty(accountmax))
            {
                whereSql += " and b.AccountFee<='" + accountmax + "' ";
            }
            if (!string.IsNullOrEmpty(accountmin))
            {
                whereSql += " and b.AccountFee>'" + accountmin + "' ";
            }
            if (sourcetype > -1)
            {
                whereSql += " and a.sourcetype=" + sourcetype + " ";
            }
            if (status > -1)
            {
                whereSql += " and a.Status=" + status;
            }
            if (!string.IsNullOrEmpty(keyWords))
            {
                whereSql += " and (a.UserName like '%" + keyWords + "%' or a.LoginName like'%" + keyWords + "%') ";
            }
            string orswhere = "";

            if (!string.IsNullOrEmpty(userid))
            {
                orswhere = " and ( c.ParentID='" + userid + "' " + (myselft ? " or a.userid='" + userid + "'" : "") + " ) ";;
            }
            if (string.IsNullOrEmpty(colmonasc))
            {
                colmonasc = " a.AutoID ";
            }
            //string clumstr = @" select  a.*,b.AccountFee,f.*  from M_Users a join UserAccount b on a.UserID=b.Userid left join UserRelation c on a.UserID=c.UserID  " + orswhere + " left join (select  d.userid as uid,d.BackID,d.SSCNum,d.SSCUseNum,d.FCNum,d.FCUseNum,d.X5Num,d.X5UseNum,e.SSCType,e.FCType,e.X5Type,e.WinFee  " +
            //                 "from UserBackSet d join  BackModel e on d.Backid=e.AutoID  where d.type=0) f on f.uid=a.userid  " + whereSql;

            DataTable dt = CommonBusiness.GetPagerData("  M_Users a join UserAccount b on a.UserID=b.Userid left join UserRelation c on a.UserID=c.UserID   left join (select  d.userid as uid,d.BackID,d.SSCNum,d.SSCUseNum,d.FCNum,d.FCUseNum,d.X5Num,d.X5UseNum,e.SSCType,e.FCType,e.X5Type,e.WinFee  " +
                                                       "from UserBackSet d join  BackModel e on d.Backid=e.AutoID  where d.type=0) f on f.uid=a.userid  ", " a.*,b.AccountFee,f.*  ", whereSql + orswhere, colmonasc, pageSize, pageIndex, out totalCount, out pageCount, isasc);
            //DataTable dt = M_UsersDAL.GetDataTable(clumstr);
            List <M_Users> list = new List <M_Users>();
            M_Users        model;

            foreach (DataRow item in dt.Rows)
            {
                model = new M_Users();
                model.FillData(item);
                list.Add(model);
            }

            return(list);
        }