Ejemplo n.º 1
0
 public void ClearUser()
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = "datediff(minute,ontime ,getdate())>5";
         if (dbOperHandler.Exist("N_User"))
         {
             dbOperHandler.Reset();
             dbOperHandler.ConditionExpress = "datediff(minute,ontime ,getdate())>5";
             dbOperHandler.AddFieldItem("IsOnline", "0");
             dbOperHandler.AddFieldItem("SessionId", Guid.NewGuid().ToString().Replace("-", ""));
             dbOperHandler.Update("N_User");
         }
     }
 }
Ejemplo n.º 2
0
 public void GetListJSON_ActiveRecord(int _thispage, int _pagesize, string _wherestr1, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = _wherestr1;
         int    totalCount = dbOperHandler.Count("Act_ActiveRecord");
         string sql0       = SqlHelp.GetSql0("Id,UserId,dbo.f_GetUserName(UserId) as UserName,ActiveType,ActiveName,InMoney,Remark,STime", "Act_ActiveRecord", "STime", _pagesize, _thispage, "desc", _wherestr1);
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = sql0;
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"" + PageBar.GetPageBar(6, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);") + "\"," + dtHelp.DT2JSON(dataTable, _pagesize * (_thispage - 1)) + "}";
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Ejemplo n.º 3
0
 public void Test(string _userid)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = string.Format("select UserId,isnull(sum(inmoney),0) money from Act_ActiveRecord where CONVERT(varchar(10), STime, 120) = '{0}' group by UserId", _userid);
         DataTable dataTable = dbOperHandler.GetDataTable();
         if (dataTable.Rows.Count > 0)
         {
             for (int i = 0; i < dataTable.Rows.Count; i++)
             {
                 dbOperHandler.Reset();
             }
         }
     }
 }
Ejemplo n.º 4
0
        public string GetLotteryNumber(int type, string title)
        {
            string result;

            using (DbOperHandler dbOperHandler = new ComData().Doh())
            {
                dbOperHandler.Reset();
                dbOperHandler.SqlCmd = string.Concat(new object[]
                {
                    "SELECT Number from Sys_LotteryData where Type=",
                    type,
                    " and title=",
                    title
                });
                DataTable dataTable = dbOperHandler.GetDataTable();
                if (dataTable.Rows.Count > 0)
                {
                    result = string.Concat(dataTable.Rows[0]["Number"]);
                }
                else
                {
                    result = "0";
                }
            }
            return(result);
        }
Ejemplo n.º 5
0
        public void GetDnListJSON(int lotteryId, ref string _jsonstr)
        {
            DataTable table = new DataTable();

            table.Columns.Add("Title");
            table.Columns.Add("Number");
            table.Columns.Add("Number1");
            table.Columns.Add("Number2");
            table.Columns.Add("Number3");
            table.Columns.Add("Number4");
            table.Columns.Add("Number5");
            using (DbOperHandler dbOperHandler = new ComData().Doh())
            {
                dbOperHandler.Reset();
                dbOperHandler.SqlCmd = "select top 18 * from Sys_LotteryData where Type=" + (object)lotteryId + " order by Title desc";
                DataTable dataTable = dbOperHandler.GetDataTable();
                for (int index = 0; index < dataTable.Rows.Count; ++index)
                {
                    DataRow row = table.NewRow();
                    row["Title"]   = (object)dataTable.Rows[index]["Title"].ToString();
                    row["Number"]  = (object)(dataTable.Rows[index]["Number"].ToString() + "(" + CheckSSC_DN.CheckNNum(dataTable.Rows[index]["Number"].ToString()) + ")");
                    row["Number1"] = (object)(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 1) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 1)) + ")");
                    row["Number2"] = (object)(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 2) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 2)) + ")");
                    row["Number3"] = (object)(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 3) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 3)) + ")");
                    row["Number4"] = (object)(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 4) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 4)) + ")");
                    row["Number5"] = (object)(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 5) + "(" + CheckSSC_DN.CheckNNum(CheckSSC_DN.AddDnNum(dataTable.Rows[index]["Number"].ToString(), 5)) + ")");
                    table.Rows.Add(row);
                }
                _jsonstr = this.ConverTableToJSON(table);
                table.Clear();
                table.Dispose();
            }
        }
Ejemplo n.º 6
0
 public void GetUserLoginListJSON(int _thispage, int _pagesize, string _wherestr1, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = _wherestr1;
         int    totalCount = dbOperHandler.Count("Log_UserLogin");
         string sql0       = SqlHelp.GetSql0("row_number() over (order by Id desc) as rowid,*", "Log_UserLogin", "Id", _pagesize, _thispage, "desc", _wherestr1);
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = sql0;
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"" + PageBar.GetPageBar(80, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);") + "\"," + dtHelp.DT2JSONNOHTML(dataTable, 0, "recordcount", "table", true) + "}";
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Ejemplo n.º 7
0
        public int Save(string orderno, string userId, string bankId, string checkCode, decimal money)
        {
            int result;

            using (DbOperHandler dbOperHandler = new ComData().Doh())
            {
                int num = 0;
                if (bankId == "888")
                {
                    num = 1;
                }
                DateTime dateTime = new DateTimePubDAL().GetDateTime();
                dbOperHandler.Reset();
                dbOperHandler.AddFieldItem("SsId", orderno);
                dbOperHandler.AddFieldItem("UserId", userId);
                dbOperHandler.AddFieldItem("BankId", bankId);
                dbOperHandler.AddFieldItem("CheckCode", checkCode);
                dbOperHandler.AddFieldItem("InMoney", money);
                dbOperHandler.AddFieldItem("DzMoney", money);
                dbOperHandler.AddFieldItem("STime", dateTime.ToString("yyyy-MM-dd HH:mm:ss"));
                dbOperHandler.AddFieldItem("State", num);
                result = dbOperHandler.Insert("N_UserCharge");
            }
            return(result);
        }
Ejemplo n.º 8
0
 public void GetListJSON(int _thispage, int _pagesize, string _wherestr1, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = _wherestr1;
         int    totalCount = dbOperHandler.Count("N_UserBank");
         string sql0       = SqlHelp.GetSql0("row_number() over (order by Id asc) as rowid,'************'+substring(Payaccount,len(Payaccount)-3,4) as tPayaccount,substring(PayName,1,1)+'**' as tPayName,*", "N_UserBank", "Id", _pagesize, _thispage, "asc", _wherestr1);
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = sql0;
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"" + PageBar.GetPageBar(6, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);") + "\"," + dtHelp.DT2JSON(dataTable, _pagesize * (_thispage - 1)) + "}";
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Ejemplo n.º 9
0
        public void Create(int loid)
        {
            string text = ConfigurationManager.AppSettings["DataUrl"].ToString();

            using (DbOperHandler dbOperHandler = new ComData().Doh())
            {
                dbOperHandler.Reset();
                dbOperHandler.SqlCmd = "SELECT top 1 [Title],[Number] FROM [Sys_LotteryData] where Type=" + loid + " order by Title desc";
                DataTable dataTable = dbOperHandler.GetDataTable();
                string    text2     = "{\"title\": \"期号\",\"number\": \"号码\"}";
                if (dataTable.Rows.Count > 0)
                {
                    text2 = text2.Replace("期号", dataTable.Rows[0]["Title"].ToString()).Replace("号码", dataTable.Rows[0]["Number"].ToString());
                }
                else
                {
                    text2 = text2.Replace("期号", "").Replace("号码", "");
                }
                dataTable.Clear();
                dataTable.Dispose();
                string text3 = string.Concat(new object[]
                {
                    text,
                    "EMindexData",
                    loid,
                    ".json"
                });
                DirFile.CreateFolder(DirFile.GetFolderPath(false, text3));
                StreamWriter streamWriter = new StreamWriter(text3, false, Encoding.UTF8);
                streamWriter.Write(text2);
                streamWriter.Close();
            }
        }
Ejemplo n.º 10
0
 public void GetListJSON_ZHDetail(int _thispage, int _pagesize, string _wherestr1, string _wherestr2, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = _wherestr1;
         int    totalCount = dbOperHandler.Count("V_UserBetZhDetail");
         string sql0       = SqlHelp.GetSql0("row_number() over (order by IssueNum asc) as rowid,*,substring(Convert(varchar(20),STime2,120),6,11) as ShortTime", "V_UserBetZhDetail", "IssueNum", _pagesize, _thispage, "asc", _wherestr1);
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = sql0;
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"" + PageBar.GetPageBar(6, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxZhList(<#page#>);") + "\"," + dtHelp.DT2JSON(dataTable, _pagesize * (_thispage - 1)) + "}";
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Ejemplo n.º 11
0
 public void GetListJSONFlex(int _thispage, int _pagesize, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = " IsUsed=1";
         int    num = dbOperHandler.Count("Sys_News");
         string sql = SqlHelp.GetSql0(num + " as totalcount,row_number() over (order by STime desc) as rowid,Convert(varchar(10),STime,120) as shortTime,substring(title,0,18)+'...' as shortTitle,*", "Sys_News", "STime", _pagesize, _thispage, "desc", " IsUsed=1");
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = sql;
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = base.ConverTableToJSON2(dataTable);
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Ejemplo n.º 12
0
        public string GetHisNumber(string ltype)
        {
            string str1 = "";

            using (DbOperHandler dbOperHandler = new ComData().Doh())
            {
                dbOperHandler.Reset();
                dbOperHandler.SqlCmd = "SELECT TOP 1000 [Number]\r\n                                FROM [Sys_LotteryData] where '" + ltype + "'=substring(Convert(varchar(10),type),1,1) order by STime asc";
                DataTable dataTable = dbOperHandler.GetDataTable();
                if (dataTable.Rows.Count > 1)
                {
                    Random   random   = new Random();
                    string   str2     = dataTable.Rows[random.Next(0, dataTable.Rows.Count - 1)]["Number"].ToString();
                    int      num      = random.Next(0, 4);
                    string[] strArray = str2.Split(',');
                    for (int index = 0; index < strArray.Length; ++index)
                    {
                        str1 = index != num ? str1 + strArray[index] + "," : str1 + (object)random.Next(0, 9) + ",";
                    }
                    str1 = str1.Substring(0, str1.Length - 1);
                }
                else
                {
                    str1 = NumberCode.CreateCode(5);
                }
            }
            return(str1);
        }
Ejemplo n.º 13
0
        public string GetUserNav(string pid, string uid)
        {
            string str = "<span><a href='javascript:void(0);' onclick='ajaxSearchPid(" + uid + ")'>本级</a></span><span>></span>";

            if (pid != "0")
            {
                using (DbOperHandler dbOperHandler = new ComData().Doh())
                {
                    dbOperHandler.Reset();
                    dbOperHandler.SqlCmd = "SELECT UserCode FROM [N_User] WHERE [Id]=" + pid;
                    DataTable dataTable = dbOperHandler.GetDataTable();
                    if (dataTable.Rows.Count > 0)
                    {
                        string[] strArray = dataTable.Rows[0]["UserCode"].ToString().Replace(",,", ",").Substring(1, dataTable.Rows[0]["UserCode"].ToString().Replace(",,", ",").Length - 2).Split(',');
                        for (int index = 0; index < strArray.Length; ++index)
                        {
                            if (Convert.ToInt32(strArray[index]) > Convert.ToInt32(uid))
                            {
                                str = str + "<span><a href='javascript:void(0);' onclick='ajaxSearchPid(" + strArray[index] + ")'>" + this.GetUserName(strArray[index]) + "</a></span><span>></span>";
                            }
                        }
                    }
                }
            }
            return(str);
        }
Ejemplo n.º 14
0
 public void GetListJSON(int _thispage, int _pagesize, string _wherestr1, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = _wherestr1;
         int    totalCount = dbOperHandler.Count("Log_UserLogin");
         string sql0       = SqlHelp.GetSql0("*", "Log_UserLogin", "LoginTime", _pagesize, _thispage, "desc", _wherestr1);
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = sql0;
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"" + PageBar.GetPageBar(6, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);") + "\"," + dtHelp.DT2JSON(dataTable, _pagesize * (_thispage - 1)) + "}";
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Ejemplo n.º 15
0
 public void GetListJSON2(int _thispage, int _pagesize, string _wherestr1, string orderby, string order, string pid, string uid, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = _wherestr1;
         int    totalCount = dbOperHandler.Count("V_User");
         string sql0       = SqlHelp.GetSql0(pid + " as pid,*", "V_User", order, _pagesize, _thispage, orderby, _wherestr1);
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = sql0;
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"nav\" :\"" + this.GetUserNav(pid, uid) + "\",\"pagebar\" :\"" + PageBar.GetPageBar(6, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);") + "\"," + dtHelp.DT2JSON(dataTable, _pagesize * (_thispage - 1)) + "}";
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Ejemplo n.º 16
0
 public int BetCancel(string betId)
 {
     using (SqlConnection sqlConnection = new SqlConnection(ComData.connectionString))
     {
         sqlConnection.Open();
         SqlCommand sqlCommand = new SqlCommand();
         sqlCommand.Connection = sqlConnection;
         try
         {
             object[] objArray = new object[6];
             using (DbOperHandler dbOperHandler = new ComData().Doh())
             {
                 dbOperHandler.Reset();
                 dbOperHandler.ConditionExpress = "Id=@Id";
                 dbOperHandler.AddConditionParameter("@Id", (object)betId);
                 objArray = dbOperHandler.GetFields("N_UserBet", "UserId,IssueNum,LotteryId,PlayId,Total,Times,ssid,STime");
             }
             Decimal Money = Convert.ToDecimal(Convert.ToDecimal(objArray[4]) * Convert.ToDecimal(objArray[5]));
             if (new UserTotalTran().MoneyOpers(objArray[6].ToString(), objArray[0].ToString(), Money, Convert.ToInt32(objArray[2].ToString()), Convert.ToInt32(objArray[3].ToString()), Convert.ToInt32(betId), 6, 99, string.Empty, string.Empty, "会员撤单", objArray[7].ToString()) <= 0)
             {
                 return(0);
             }
             sqlCommand.CommandText = "update N_UserBet set State=1 where Id=" + betId;
             sqlCommand.ExecuteNonQuery();
             return(1);
         }
         catch (Exception ex)
         {
             new LogExceptionDAL().Save("系统异常", ex.Message);
             return(0);
         }
     }
 }
Ejemplo n.º 17
0
 public void GetListJSON(int _thispage, int _pagesize, string _wherestr1, string _wherestr2, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = _wherestr1;
         int    totalCount = dbOperHandler.Count("Flex_UserBet");
         string sql0       = SqlHelp.GetSql0(_wherestr2 + "as isme,row_number() over (order by Id desc) as rowid,Id,SsId,UserId,UserName,UserMoney,PlayId,PlayName,PlayCode,LotteryId,LotteryName,IssueNum,SingleMoney,moshi,Times,Num,DX,DS,cast(Times*Total as decimal(15,4)) as Total,Point,PointMoney,Bonus,Bonus2,WinNum,WinBonus,RealGet,Pos,STime,STime2,substring(Convert(varchar(20),STime2,120),6,11) as ShortTime,IsOpen,State,IsWin,number,poslen", "Flex_UserBet", "Id", _pagesize, _thispage, "desc", _wherestr1);
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = sql0;
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"" + PageBar.GetPageBar(6, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);") + "\"," + dtHelp.DT2JSON(dataTable, _pagesize * (_thispage - 1)) + "}";
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Ejemplo n.º 18
0
 public void GetListJSON(int _thispage, int _pagesize, string _wherestr1, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = _wherestr1;
         int    totalCount = dbOperHandler.Count("Sys_News");
         string sql0       = SqlHelp.GetSql0("row_number() over (order by STime desc) as rowid,Convert(varchar(10),STime,120) as shortTime,substring(title,0,18)+'...' as shortTitle,Substring(Convert(varchar(10),STime,120),6,2) as tmonth,Substring(Convert(varchar(10),STime,120),9,2) as tday,*", "Sys_News", "STime", _pagesize, _thispage, "desc", _wherestr1);
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = sql0;
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"" + PageBar.GetPageBar(6, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);") + "\"," + dtHelp.DT2JSON(dataTable) + "}";
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Ejemplo n.º 19
0
 public void GetListUpChargeJSON(int _thispage, int _pagesize, string _wherestr1, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = _wherestr1;
         int    totalCount = dbOperHandler.Count("N_UserChargeLog");
         string sql0       = SqlHelp.GetSql0("row_number() over (order by Id desc) as rowid,dbo.f_GetUserName(UserId) as UserName,dbo.f_GetUserName(ToUserId) as ToUserName,*", "N_UserChargeLog", "Id", _pagesize, _thispage, "desc", _wherestr1);
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = sql0;
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"" + PageBar.GetPageBar(6, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);") + "\"," + dtHelp.DT2JSON(dataTable, _pagesize * (_thispage - 1)) + "}";
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Ejemplo n.º 20
0
 public string GetCurrentSn(int loid)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         DateTime now = DateTime.Now;
         string   str;
         if (loid == 3002 || loid == 3003)
         {
             DateTime dateTime = Convert.ToDateTime(now.Year.ToString() + "-01-01 20:30:00");
             dbOperHandler.Reset();
             dbOperHandler.SqlCmd = "select datediff(d,'" + dateTime.ToString("yyyy-MM-dd HH:mm:ss") + "','" + now.ToString("yyyy-MM-dd HH:mm:ss") + "') as d";
             int Num = Convert.ToInt32(dbOperHandler.GetDataTable().Rows[0]["d"]) - 7;
             str = now.Year.ToString() + Func.AddZero(Num, 3);
         }
         else
         {
             dbOperHandler.Reset();
             dbOperHandler.SqlCmd = "select top 1 Sn from Sys_LotteryTime where LotteryId=" + (object)loid + " and Time < '" + now.ToString("HH:mm:ss") + "' order by time desc";
             DataTable dataTable = dbOperHandler.GetDataTable();
             if (dataTable.Rows.Count < 1)
             {
                 dbOperHandler.Reset();
                 dbOperHandler.SqlCmd = "select top 1 Sn from Sys_LotteryTime where LotteryId=" + (object)loid + " order by time desc";
                 dataTable            = dbOperHandler.GetDataTable();
                 str = now.AddDays(-1.0).ToString("yyyyMMdd") + "-" + dataTable.Rows[0]["Sn"].ToString();
             }
             else
             {
                 str = now.ToString("yyyyMMdd") + "-" + dataTable.Rows[0]["Sn"].ToString();
                 if (now > Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 00:00:00") && now < Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 10:00:01") && loid == 1003)
                 {
                     str = now.AddDays(-1.0).ToString("yyyyMMdd") + "-" + dataTable.Rows[0]["Sn"].ToString();
                 }
             }
             if (loid == 4001)
             {
                 DateTime dateTime = Convert.ToDateTime("2016-01-01 00:00:00");
                 dbOperHandler.Reset();
                 dbOperHandler.SqlCmd = "select datediff(d,'" + dateTime.ToString("yyyy-MM-dd HH:mm:ss") + "','" + now.ToString("yyyy-MM-dd HH:mm:ss") + "') as d";
                 str = string.Concat((object)(530900 + (Convert.ToInt32(dbOperHandler.GetDataTable().Rows[0]["d"]) - 7) * 179 + Convert.ToInt32(dataTable.Rows[0]["Sn"].ToString())));
             }
             dataTable.Clear();
             dataTable.Dispose();
         }
         return(str);
     }
 }
Ejemplo n.º 21
0
        public int GetTsIssueNum(string lotteryId)
        {
            DateTime now = DateTime.Now;
            int      num = 0;

            using (DbOperHandler dbOperHandler = new ComData().Doh())
            {
                switch (lotteryId)
                {
                case "1010":
                case "3004":
                    dbOperHandler.Reset();
                    dbOperHandler.SqlCmd = "select datediff(d,'2016-10-08',Convert(varchar(10),getdate(),120)) as d";
                    num = 1658122 + Convert.ToInt32(dbOperHandler.GetDataTable().Rows[0]["d"]) * 880;
                    break;

                case "1017":
                    dbOperHandler.Reset();
                    dbOperHandler.SqlCmd = "select datediff(d,'2016-10-08',Convert(varchar(10),getdate(),120)) as d";
                    num = 1658117 + Convert.ToInt32(dbOperHandler.GetDataTable().Rows[0]["d"]) * 880;
                    break;

                case "1012":
                    dbOperHandler.Reset();
                    dbOperHandler.SqlCmd = "select datediff(d,'2016-10-23',Convert(varchar(10),getdate(),120)) as d";
                    DataTable dataTable1 = dbOperHandler.GetDataTable();
                    num = !(now > Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 00:00:00")) || !(now < Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 00:01:45")) ? 2588087 + Convert.ToInt32(dataTable1.Rows[0]["d"]) * 660 : 2588087 + (Convert.ToInt32(dataTable1.Rows[0]["d"]) - 1) * 660;
                    break;

                case "1013":
                    dbOperHandler.Reset();
                    dbOperHandler.SqlCmd = "select datediff(d,'2017-01-01',Convert(varchar(10),getdate(),120)) as d";
                    DataTable dataTable2 = dbOperHandler.GetDataTable();
                    num = !(now > Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 00:00:00")) || !(now < Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 06:50:00")) ? 106000000 + Convert.ToInt32(dataTable2.Rows[0]["d"]) * 203 : 106000000 + (Convert.ToInt32(dataTable2.Rows[0]["d"]) - 1) * 203;
                    break;

                case "4001":
                    dbOperHandler.Reset();
                    dbOperHandler.SqlCmd = "select datediff(d,'2017-02-10',Convert(varchar(10),getdate(),120)) as d";
                    DataTable dataTable3 = dbOperHandler.GetDataTable();
                    num = !(DateTime.Now > Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00")) || !(DateTime.Now < Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 09:07:01")) ? 601048 + Convert.ToInt32(dataTable3.Rows[0]["d"]) * 179 : 601048 + (Convert.ToInt32(dataTable3.Rows[0]["d"]) - 1) * 179;
                    break;
                }
            }
            return(num);
        }
Ejemplo n.º 22
0
 public DataTable GetAutoUrl(int lotteryId)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = "select top 1 IsAuto,isnull((select Url from Sys_lotteryUrl where Id=a.AutoUrl),'0') as AutoUrl \r\n                            ,isnull((select Title from Sys_lotteryUrl where Id=a.AutoUrl),'0') as Title\r\n                            from Sys_lottery a where Id=" + (object)lotteryId;
         return(dbOperHandler.GetDataTable());
     }
 }
Ejemplo n.º 23
0
 public static Decimal GetCurRealGet(int lotteryId)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = "SELECT case isnull(sum(Total*Times),0) when 0 then 0 else isnull(-sum(realGet),-0)*100/isnull(sum(Total*Times),0) end as win FROM [N_UserBet] where state>=2 and DateDiff(dd,STime,getdate())=0 and lotteryId=" + (object)lotteryId;
         return(Convert.ToDecimal(dbOperHandler.GetDataTable().Rows[0]["win"]));
     }
 }
Ejemplo n.º 24
0
 public DataTable GetTable()
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = "select [Id],[LotteryId],[Sn],[Time],[Sort] from Sys_LotteryTime order by Id desc";
         return(dbOperHandler.GetDataTable());
     }
 }
Ejemplo n.º 25
0
 public DataTable GetLotteryAutoMode()
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = "SELECT top 1 [AutoLottery],[ProfitModel],[ProfitMargin] FROM [Sys_Info]";
         return(dbOperHandler.GetDataTable());
     }
 }
Ejemplo n.º 26
0
 public void DeleteUserBetZh(string d1, string d2)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = "Stime<='" + d2 + "' and Stime>='" + d1 + "'";
         dbOperHandler.Delete("N_UserBetZh");
     }
 }
Ejemplo n.º 27
0
 public void DeleteUserLogs(string d1, string d2)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = "LoginTime<='" + d2 + "' and LoginTime>='" + d1 + "'";
         dbOperHandler.Delete("Log_UserLogin");
     }
 }
Ejemplo n.º 28
0
 public void DeleteLotteryData(string d1, string d2)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = "Stime<='" + d2 + "' and Stime>='" + d1 + "'";
         dbOperHandler.Delete("Sys_LotteryData");
     }
 }
Ejemplo n.º 29
0
 public void Delete()
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = "1=1";
         dbOperHandler.Delete("N_UserMessage");
     }
 }
Ejemplo n.º 30
0
 public static DataTable GetLotteryCheck(int lotteryId)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = "SELECT top 1 [CheckNum],[CheckPer] FROM [Sys_LotteryCheck] where Id=" + (object)lotteryId;
         return(dbOperHandler.GetDataTable());
     }
 }