Exemplo n.º 1
0
        public bool IsAuto(int lotteryId)
        {
            bool result;

            using (DbOperHandler dbOperHandler = new ComData().Doh())
            {
                dbOperHandler.Reset();
                dbOperHandler.ConditionExpress = "Id=@Id";
                dbOperHandler.AddConditionParameter("@Id", lotteryId);
                int num = Convert.ToInt32(dbOperHandler.GetField("Sys_Lottery", "IsAuto"));
                result = (num == 0);
            }
            return(result);
        }
Exemplo n.º 2
0
 public void Update(DataTable dt)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             dbOperHandler.Reset();
             dbOperHandler.ConditionExpress = "Id=@Id";
             dbOperHandler.AddConditionParameter("@Id", dt.Rows[i]["Id"].ToString());
             dbOperHandler.AddFieldItem("IsRead", "1");
             dbOperHandler.Update("N_UserMessage");
         }
     }
 }
Exemplo n.º 3
0
 public void GetListJSON(int _thispage, int _pagesize, string _wherestr1, string _userId, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = "Id=@Id";
         dbOperHandler.AddConditionParameter("@Id", (object)_userId);
         string str = string.Concat(dbOperHandler.GetField("N_User", "ParentId"));
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = _wherestr1;
         int    totalCount = dbOperHandler.Count("N_UserEmail");
         string sql0       = SqlHelp.GetSql0("row_number() over (order by STime desc) as rowid," + str + " as parentid,dbo.f_GetUserName(SendId) as SendName,dbo.f_GetUserName(ReceiveId) as ReceiveName,*", "N_UserEmail", "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();
     }
 }
Exemplo n.º 4
0
        public bool SaveMobile(string _userid, string _name)
        {
            bool result;

            using (DbOperHandler dbOperHandler = new ComData().Doh())
            {
                dbOperHandler.Reset();
                dbOperHandler.ConditionExpress = "id=@id";
                dbOperHandler.AddConditionParameter("@id", _userid);
                dbOperHandler.AddFieldItem("Mobile", _name);
                if (dbOperHandler.Update("N_User") > 0)
                {
                    result = true;
                }
                else
                {
                    result = false;
                }
            }
            return(result);
        }
Exemplo n.º 5
0
        public int BetCancel(string betId)
        {
            int result;

            using (SqlConnection sqlConnection = new SqlConnection(ComData.connectionString))
            {
                sqlConnection.Open();
                SqlCommand sqlCommand = new SqlCommand();
                sqlCommand.Connection = sqlConnection;
                try
                {
                    object[] array = new object[6];
                    using (DbOperHandler dbOperHandler = new ComData().Doh())
                    {
                        dbOperHandler.Reset();
                        dbOperHandler.ConditionExpress = "Id=@Id";
                        dbOperHandler.AddConditionParameter("@Id", betId);
                        array = dbOperHandler.GetFields("N_UserBet", "UserId,IssueNum,LotteryId,PlayId,Total,Times,ssid,STime");
                    }
                    decimal money = Convert.ToDecimal(Convert.ToDecimal(array[4]) * Convert.ToDecimal(array[5]));
                    if (new UserTotalTran().MoneyOpers(array[6].ToString(), array[0].ToString(), money, Convert.ToInt32(array[2].ToString()), Convert.ToInt32(array[3].ToString()), Convert.ToInt32(betId), 6, 99, string.Empty, string.Empty, "会员撤单", array[7].ToString()) > 0)
                    {
                        sqlCommand.CommandText = "update N_UserBet set State=1 where Id=" + betId;
                        sqlCommand.ExecuteNonQuery();
                        result = 1;
                    }
                    else
                    {
                        result = 0;
                    }
                }
                catch (Exception ex)
                {
                    new LogExceptionDAL().Save("系统异常", ex.Message);
                    result = 0;
                }
            }
            return(result);
        }
Exemplo n.º 6
0
 public string ChkAutoLoginWebApp(string _Id, string _sessionId)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = string.Format("select top 1 UserName,Point,sessionId from N_User with(nolock) where Id={0}", _Id);
         DataTable dataTable = dbOperHandler.GetDataTable();
         if (dataTable.Rows.Count > 0)
         {
             if (!string.IsNullOrEmpty(string.Concat(dataTable.Rows[0]["sessionId"])))
             {
                 NameValueCollection nameValueCollection = new NameValueCollection();
                 nameValueCollection.Add("id", _Id);
                 nameValueCollection.Add("name", dataTable.Rows[0]["UserName"].ToString());
                 nameValueCollection.Add("cookiess", dataTable.Rows[0]["sessionId"].ToString());
                 nameValueCollection.Add("point", dataTable.Rows[0]["Point"].ToString());
                 Cookie.SetObj(this.site.CookiePrev + "WebApp", 1, nameValueCollection, this.site.CookieDomain, this.site.CookiePath);
             }
             else
             {
                 string text = Guid.NewGuid().ToString().Replace("-", "");
                 dbOperHandler.Reset();
                 dbOperHandler.ConditionExpress = "Id=@Id";
                 dbOperHandler.AddConditionParameter("@Id", _Id);
                 dbOperHandler.AddFieldItem("sessionId", text);
                 dbOperHandler.Update("N_User");
                 dbOperHandler.Dispose();
                 NameValueCollection nameValueCollection2 = new NameValueCollection();
                 nameValueCollection2.Add("id", _Id);
                 nameValueCollection2.Add("name", dataTable.Rows[0]["UserName"].ToString());
                 nameValueCollection2.Add("cookiess", text);
                 nameValueCollection2.Add("point", dataTable.Rows[0]["Point"].ToString());
                 Cookie.SetObj(this.site.CookiePrev + "WebApp", 1, nameValueCollection2, this.site.CookieDomain, this.site.CookiePath);
             }
         }
     }
     return(_Id);
 }
Exemplo n.º 7
0
        public Decimal GetMaxMoney(int userId)
        {
            Decimal num = new Decimal(0);

            using (DbOperHandler dbOperHandler = new ComData().Doh())
            {
                dbOperHandler.Reset();
                dbOperHandler.SqlCmd = "select top 1 ISNULL(MoneyAfter,0) as MoneyAfter from N_UserMoneyLog with(nolock) where userId=" + (object)userId + " order by Id desc";
                DataTable dataTable = dbOperHandler.GetDataTable();
                if (dataTable.Rows.Count > 0)
                {
                    num = Convert.ToDecimal(dataTable.Rows[0]["MoneyAfter"].ToString());
                }
                else
                {
                    dbOperHandler.Reset();
                    dbOperHandler.ConditionExpress = "id=@id";
                    dbOperHandler.AddConditionParameter("@id", (object)userId);
                    num = Convert.ToDecimal(dbOperHandler.GetField("N_User", "Money"));
                }
            }
            return(num);
        }
Exemplo n.º 8
0
 public string ChkAutoLoginWebApp(string _Id, string _sessionId, int iExpires)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = string.Format("select top 1 UserName,Point,sessionId from N_User with(nolock) where Id={0}", (object)_Id);
         DataTable dataTable = dbOperHandler.GetDataTable();
         if (dataTable.Rows.Count > 0)
         {
             if (!string.IsNullOrEmpty(string.Concat(dataTable.Rows[0]["sessionId"])))
             {
                 Cookie.SetObj(this.site.CookiePrev + "WebApp", 1, new NameValueCollection()
                 {
                     {
                         "id",
                         _Id
                     },
                     {
                         "name",
                         dataTable.Rows[0]["UserName"].ToString()
                     },
                     {
                         "cookiess",
                         dataTable.Rows[0]["sessionId"].ToString()
                     },
                     {
                         "point",
                         dataTable.Rows[0]["Point"].ToString()
                     }
                 }, "www.youle1288.com;youle1288.com;www.youle2888.com;youle2888.com,feifan1188.com,www.feifan1188.com", this.site.CookiePath);
             }
             else
             {
                 string str = Guid.NewGuid().ToString().Replace("-", "");
                 dbOperHandler.Reset();
                 dbOperHandler.ConditionExpress = "Id=@Id";
                 dbOperHandler.AddConditionParameter("@Id", (object)_Id);
                 dbOperHandler.AddFieldItem("sessionId", (object)str);
                 dbOperHandler.Update("N_User");
                 dbOperHandler.Dispose();
                 Cookie.SetObj(this.site.CookiePrev + "WebApp", 1, new NameValueCollection()
                 {
                     {
                         "id",
                         _Id
                     },
                     {
                         "name",
                         dataTable.Rows[0]["UserName"].ToString()
                     },
                     {
                         "cookiess",
                         str
                     },
                     {
                         "point",
                         dataTable.Rows[0]["Point"].ToString()
                     }
                 }, "www.youle1288.com;youle1288.com;www.youle2888.com;youle2888.com,feifan1188.com,www.feifan1188.com", this.site.CookiePath);
             }
         }
         return(_Id);
     }
 }
Exemplo n.º 9
0
 public void GetActive7Money(string userId, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = "Code=@Code";
         dbOperHandler.AddConditionParameter("@Code", "Active7");
         object[] fields = dbOperHandler.GetFields("Act_ActiveSet", "StartTime,EndTime,IsUse");
         if (Convert.ToInt32(fields[2]) == 1)
         {
             if (new DateTimePubDAL().GetDateTime() >= Convert.ToDateTime(fields[0]) && new DateTimePubDAL().GetDateTime() <= Convert.ToDateTime(fields[1]))
             {
                 Random             random             = new Random();
                 decimal            num                = random.Next(this.site.SignMinTotal, this.site.SignMaxTotal);
                 SysActiveRecordDAL sysActiveRecordDAL = new SysActiveRecordDAL();
                 string             clientIP           = IPHelp.ClientIP;
                 dbOperHandler.Reset();
                 dbOperHandler.ConditionExpress = "ActiveType='Active7' and datediff(d,STime,getdate())=0";
                 int num2 = dbOperHandler.Count("Act_ActiveRecord");
                 if (num2 <= this.site.SignNum)
                 {
                     if (!sysActiveRecordDAL.Exists("UserId=" + userId + " and ActiveType='Active7' and datediff(d,STime,getdate())=0"))
                     {
                         if (!sysActiveRecordDAL.Exists("CheckIp='" + clientIP + "' and ActiveType='Active7' and datediff(d,STime,getdate())=0"))
                         {
                             dbOperHandler.Reset();
                             dbOperHandler.ConditionExpress = "UserId=" + userId;
                             int num3 = dbOperHandler.Count("N_UserBank");
                             if (num3 > 0)
                             {
                                 dbOperHandler.Reset();
                                 dbOperHandler.ConditionExpress = "UserId=" + userId + " and state=0";
                                 int num4 = dbOperHandler.Count("N_UserBet");
                                 if (num4 > 0)
                                 {
                                     _jsonstr = "您还有未开奖的订单,请开奖后再领取!";
                                 }
                                 else
                                 {
                                     dbOperHandler.Reset();
                                     dbOperHandler.SqlCmd = "select Bet,Cancellation from N_UserMoneyStatAll where UserId=" + userId + " and datediff(d,STime,getdate())=0";
                                     DataTable dataTable = dbOperHandler.GetDataTable();
                                     if (dataTable.Rows.Count > 0)
                                     {
                                         if (Convert.ToDecimal(dataTable.Rows[0]["Bet"]) - Convert.ToDecimal(dataTable.Rows[0]["Cancellation"]) < 50m)
                                         {
                                             _jsonstr = "签到领现失败,您的流水未得到50元!";
                                         }
                                         else
                                         {
                                             sysActiveRecordDAL.SaveLog(userId, "Active7", "签到领现", num, "您签到领取了" + num + "元");
                                             _jsonstr = "签到领现成功" + num + "元";
                                             new LogSysDAL().Save("系统活动", string.Concat(new object[]
                                             {
                                                 userId,
                                                 "领取签到佣金",
                                                 num,
                                                 "元"
                                             }));
                                         }
                                     }
                                     else
                                     {
                                         _jsonstr = "签到领现失败,您的流水未得到50元!";
                                     }
                                 }
                             }
                             else
                             {
                                 _jsonstr = "签到领现失败,您未绑定银行!";
                             }
                         }
                         else
                         {
                             _jsonstr = "签到领现失败,您当前IP今天已领取!";
                         }
                     }
                     else
                     {
                         _jsonstr = "签到领现失败,您今天已领取!";
                     }
                 }
                 else
                 {
                     _jsonstr = "签到领现失败,今天领取已得到名额!";
                 }
             }
             else
             {
                 _jsonstr = "领取失败,活动时间已过!";
             }
         }
         else
         {
             _jsonstr = "领取失败,活动已关闭!";
         }
     }
 }