예제 #1
0
        //游戏时长排行
        public void BindGameTimeList()
        {
            DataTable dt = new BLL.Member().ListPlayTimeCount(10);

            rptGameTime.DataSource = dt.DefaultView;
            rptGameTime.DataBind();
        }
예제 #2
0
        protected void Login1_LoggedIn(object sender, EventArgs e)
        {
            bool signout = false;

            MembershipUser user = Membership.GetUser(Login1.UserName);
            Member member = new Member();
            member.GetMemberByUserId(new Guid(user.ProviderUserKey.ToString()));
            if (member.RowStatusID != (int)Helper.Enums.RowStatus.Enabled)
            {
                signout = true;
            }
            else
            {
                member.IsOnLine = true;
                CheckBox cb = (CheckBox)Login1.FindControl("uiCheckBoxInvisible");
                if (cb.Checked)
                    member.Status = (int)Helper.Enums.MemberStatus.Offline;
                member.Save();
                Session[SessionManager.loggedInMemberID] = member.s_MemberID;
                Response.Redirect("home.aspx");
            }
            if (signout)
            {
                FormsAuthentication.SignOut();
                ClientScript.RegisterStartupScript(this.GetType(), "notEnabled", "$(document).ready(function (){ $('#NotEnabled').modal('show'); });", true);
            }
        }
예제 #3
0
        //奖券排行
        public void BindLotteriesList()
        {
            DataTable dt = new BLL.Member().ListLotteries(10);

            rptLotteries.DataSource = dt.DefaultView;
            rptLotteries.DataBind();
        }
예제 #4
0
        //
        //public void BindGameList()
        //{
        //    Game game = new Game();
        //    rptGame1.DataSource = game.GetGameInfoList(0, 1);
        //    rptGame1.DataBind();
        //    rptGame2.DataSource = game.GetGameInfoList(0, 2);
        //    rptGame2.DataBind();
        //    rptGame3.DataSource = game.GetGameInfoList(0, 3);
        //    rptGame3.DataBind();
        //}



        //绑定热门游戏列表
        //public void BindHotGame()
        //{
        //    rpHotGameList.DataSource = new BLL.Game().List(5, 1).DefaultView;
        //    rpHotGameList.DataBind();
        //}

        //public void BindAllGame()
        //{
        //    rpAllGameList.DataSource = new BLL.Game().List(16, 0).DefaultView;
        //    rpAllGameList.DataBind();
        //}

        /*
         * /// <summary>
         * /// 绑定玩家鲜花排行
         * /// </summary>
         * private void BindTopFollows()
         * {
         *  DataTable dt = DbSession.Default.FromSql("select TOP 7 * from Web_vFaciSum order by fascisum desc").ToDataTable();
         *  if (dt.Rows.Count > 0)
         *  {
         *      rptFollowsTop.Visible = true;
         *      ltNonFollows.Visible = false;
         *      rptFollowsTop.DataSource = dt;
         *      rptFollowsTop.DataBind();
         *  }
         *  else
         *  {
         *      rptFollowsTop.Visible = false;
         *      ltNonFollows.Visible = true;
         *  }
         * }
         *
         * /// <summary>
         * /// 绑定新闻栏目列表
         * /// </summary>
         * private void BindNewsColumn()
         * {
         *  //DataTable dt = ( new BLL.News() ).TypeList(4);
         *  //if( dt.Rows.Count > 0 )
         *  //{
         *  //    ltNonNewsColumn.Visible = false;
         *  //    rptNewsColumnList.Visible = true;
         *  //    rptNewsColumnList.DataSource = dt;
         *  //    rptNewsColumnList.DataBind();
         *  //}
         *  //else
         *  //{
         *  //    ltNonNewsColumn.Visible = true;
         *  //    rptNewsColumnList.Visible = false;
         *  //}
         * }
         *
         *
         *
         * //兑奖名单
         * public void BindDuiJiangLog()
         * {
         *  //rpDuiJingLog.DataSource = new BLL.Member().ListDuiJiangLog(6);
         *  //rpDuiJingLog.DataBind();
         * }
         *
         *
         *
         * //绑定奖品数据 杨大胜 2009-4-14
         * public void BindJiangPin()
         * {
         *
         *  <asp:Repeater ID="rpJiangPin" runat="server" Visible="false">
         *      <ItemTemplate>
         *          <tr>
         *              <td>
         *                  <a href="/DuiJiang.aspx?id=<%#Eval("Award_ID") %>">
         *                      <img src="<%#Eval("Award_Pic") %>" alt="<%#Eval("Award_Name") %>" onerror="this.src='/Images/NoPicture/no_pic.gif'" height="100" width="265" /></a></td>
         *          </tr>
         *      </ItemTemplate>
         *      <SeparatorTemplate>
         *          <tr>
         *              <td>
         *                  &nbsp;</td>
         *          </tr>
         *      </SeparatorTemplate>
         *  </asp:Repeater>
         *
         *
         *  //DataTable dt = new BLL.JiangPin().List(3);
         *  //rpJiangPin.DataSource = dt.DefaultView;
         *  //rpJiangPin.DataBind();
         * }
         *
         * //绑定道具数据 杨大胜 2009-4-13
         * public void BindDaoJu()
         * {
         *  //DataTable dt = new BLL.DaoJu().List( 4 );
         *  //rpDaoJu.DataSource = dt.DefaultView;
         *  //rpDaoJu.DataBind();
         * }
         *
         * //绑定友情链接 杨大胜 2009-4-23
         * public void BindFriend()
         * {
         *  //rpFriend.DataSource = new BLL.FriendLink().List(0);
         *  //rpFriend.DataBind();
         * }
         */
        //玩家财富排行
        public void BindCaifu()
        {
            DataTable dt = new BLL.Member().ListCaifu(10);

            rpCaifu.DataSource = dt.DefaultView;
            rpCaifu.DataBind();
        }
예제 #5
0
        protected void uiButtonChangePass_Click(object sender, EventArgs e)
        {
            Member user = new Member();
            if (Request.QueryString["rc"] != null)
            {
                string querystring = Helper.General.DecryptString(Request.QueryString["rc"].ToString());
                string[] allkeys = querystring.Split('&');

                if (!(allkeys.Length < 2))
                {
                    int id = Convert.ToInt32(allkeys[0].Substring(4));
                    string mail = allkeys[1].Substring(6);

                    user.LoadByPrimaryKey(id);
                    if (user.Email == mail)
                    {
                        MembershipUser _user = Membership.GetUser(user.UserName);
                        if (_user.ChangePassword(_user.GetPassword(user.Answer), Password.Text))
                            ErrorMessage.Text = "تم تغيير كلمة السر بنجاح.";
                        else
                            ErrorMessage.Text = "حدث خطأ . من فضلك حاول مرة أخرى.";
                        ClearFields();
                    }
                    else
                        ErrorMessage.Text = "حدث خطأ . من فضلك حاول مرة أخرى.";
                }
                else
                    ErrorMessage.Text = "حدث خطأ . من فضلك حاول مرة أخرى.";

                ErrorMessage.Visible = true;
            }
            else
                Response.Redirect("default.aspx");
        }
예제 #6
0
    private void MatchApply()
    {
        string contestId = Common.FilterString(Common.GetStringOfUrl("id"));

        try
        {
            string uid = Common.FilterString(Common.GetIntOfUrl("uid").ToString());
            if (!UiCommon.UserLoginInfo.IsLogin)
            {
                //判断是否从平台跳转过来的

                string token = Common.FilterString(Common.GetStringOfUrl("token2").ToString());

                if (CommonManager.String.IsInteger(uid) && token.Trim().Length > 0)
                {
                    string un = new BLL.Member().GetNameByUserID(uid, token);
                    if (!string.IsNullOrEmpty(un))
                    {
                        UserLoginInfo.SetInfo(uid, un);
                    }
                    else
                    {
                        Response.Write("抱歉,报名失败,可能是服务器繁忙,请稍后再试!");
                        return;
                    }
                }
            }
            Dictionary <string, object> dic = new Dictionary <string, object>();
            DbSession.Default.FromProc("Web_pApplyMatch").AddInputParameter("@UserID", DbType.Int32, UserLoginInfo.UserID)
            .AddInputParameter("@ContestID", DbType.Int32, Request.QueryString["id"].ToString())
            .AddReturnValueParameter("@ReturnValue", DbType.Int32)
            .Execute(out dic);
            if (dic.Count <= 0)
            {
                Response.Write("抱歉,报名失败,可能是服务器繁忙,请稍后再试!");

                return;
            }

            if (dic["ReturnValue"].ToString() == "-1")
            {
                Response.Write("抱歉,报名失败,您银行的" + ConfigurationManager.AppSettings["moneyName"].ToString() + "不足!");

                return;
            }
            if (dic["ReturnValue"].ToString() == "-2")
            {
                Response.Write("已成功报名!");
                return;
            }
            Response.Write("报名成功!");
        }
        catch (Exception ex)
        {
            Response.Write("报名失败,服务器未知错误!");
        }
    }
예제 #7
0
        public void addToRoom(int memberID, int roomid)
        {
            Groups.Add(Context.ConnectionId, roomid.ToString());
            try
            {
                Member member = new Member();
                member.LoadByPrimaryKey(memberID);
                bool isHidden = member.Status == (int)Helper.Enums.MemberStatus.Offline &&
                    Roles.IsUserInRole(member.Name, Helper.Enums.MemberRoles.InvisibleInRoom.ToString());

                RoomMember roomMember = new RoomMember();
                if (!roomMember.LoadByPrimaryKey(memberID, roomid))
                {
                    roomMember.AddNew();
                    roomMember.MemberID = memberID;
                    roomMember.RoomID = roomid;
                }
                roomMember.LastJoinDate = DateTime.Now;
                roomMember.InRoom = !isHidden;
                Room room = new Room();
                room.LoadByPrimaryKey(roomid);
                if (!room.IsColumnNull("CreatedBy"))
                {
                    if (room.CreatedBy == roomMember.MemberID)
                        roomMember.RoomMemberLevelID = (int)Helper.Enums.RoomMemberLevel.Owner;
                }
                roomMember.Save();

                Helper.ChatMember chatMember = roomMember.LoadWithSettings(roomid, roomMember.MemberID, roomMember.MemberID, null).FirstOrDefault();

                if (!isHidden)
                    Clients.Group(roomid.ToString()).addNewMember(roomid.ToString(), chatMember);
                if (roomMember.RoomMemberLevelID > (int)Helper.Enums.RoomMemberLevel.Visitor)
                    Groups.Add(Context.ConnectionId, GetRoomAdminGroupName(roomid));

                BLL.MemberLog log = new BLL.MemberLog();
                Helper.Enums.LogType lgType = Helper.Enums.LogType.EnterRoom;
                if (isHidden)
                    lgType = Helper.Enums.LogType.EnterRoomHidden;
                log.AddNew(memberID, new BLL.Log.EnterRoom() { Type = lgType, RoomID = roomid, RoomName = room.Name }, null, roomid);

                RoomMember onlineroomMember = new RoomMember();
                onlineroomMember.GetAllOnlineMembersByRoomID(roomid);
                Clients.All.updateExistingCount(roomid, onlineroomMember.RowCount);

                var item = ConnectedUsers.FirstOrDefault(m => m.MemberID == memberID);
                if (item == null)
                {
                    var newMember = new Helper.SignalRUser { ConnectionId = Context.ConnectionId, MemberName = member.Name, MemberID = member.MemberID, ProfilePic = member.ProfilePic, MemberTypeSpecID = member.MemberType.MemberTypeSpecDuration.MemberTypeSpecID };
                    ConnectedUsers.Add(newMember);
                }
            }
            catch (Exception ex)
            {

            }
        }
예제 #8
0
    public void TuiguangBalance()
    {
        string tgUserId = Common.SqlEncode(Common.GetStringOfUrl("tguserid"));
        string userId   = Common.SqlEncode(Common.GetStringOfUrl("userid"));
        //返回值:-1未达到有效推广 , 0达到有效推广 , 或其它值
        int iRe = new BLL.Member().TuiguangBalance(tgUserId, userId);

        Response.Write(iRe);
    }
예제 #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Member member = new Member();
         member.GetMemberByUserId(new Guid(Membership.GetUser().ProviderUserKey.ToString()));
         ctrlSendMail.MemberID = member.MemberID;
         ctrlSendMail.MemberName = member.Name;
     }
 }
예제 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string billno = Utility.Common.GetStringOfUrl("billno"); //订单编号

            string amount = Utility.Common.GetStringOfUrl("amount");  //订单金额

            string date = Utility.Common.GetStringOfUrl("date"); //订单日期

            string succ = Utility.Common.GetStringOfUrl("succ"); //成功标志

            string ipsbillno = Utility.Common.GetStringOfUrl("ipsbillno"); //IPS订单编号

            string currency_Type = Utility.Common.GetStringOfUrl("Currency_type");  //币种

            string signature = Utility.Common.GetStringOfUrl("signature").ToLower(); //MD5签名

            string retencodetype = Utility.Common.GetStringOfUrl("retencodetype");//交易返回签名方式

            if (string.IsNullOrEmpty(billno) || string.IsNullOrEmpty(amount) || string.IsNullOrEmpty(date) ||
                string.IsNullOrEmpty(succ) || string.IsNullOrEmpty(ipsbillno) || string.IsNullOrEmpty(currency_Type) || string.IsNullOrEmpty(signature))
            {
                Server.Transfer("Default.aspx");
            }

            if (succ.Equals("Y"))
            {
                //交易成功

                if (currency_Type == null || currency_Type == "")
                {
                    currency_Type = "RMB";
                }
                string signatureVal = Utility.Common.md5("billno" + billno + "currencytype" + currency_Type + "amount" + amount + "date" + date + "succ" + succ + "ipsbillno" + ipsbillno + "retencodetype" + retencodetype + UiCommon.StringConfig.IPS_Letter).ToLower();

                if (signature.Equals(signatureVal.ToLower()))
                {
                    Member mem = new Member();
                    if (!mem.IsPaySuccess(billno))
                    {
                        mem.Update3PayOrder((int)(float.Parse(amount)), billno);

                    }
                }
                else
                {

                }

            }
            else
            {
                //交易失败
                //  lblMsg.Text = "充值失败,请稍后再试!";
            }
        }
예제 #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminPopedom.IsHoldModel("15");

        StringBuilder where = new StringBuilder( );
        string userName = string.Empty;
        string un       = CommonManager.Web.RequestUrlDecode("un", "");

        if (!string.IsNullOrEmpty(un))
        {
            userName = un;
            where.Append(" and UserName='******'");
        }
        where.Append(" and ID<>0");

        DataSet ds = DbSession.Default.FromProc("Web_pGetDataPager")
                     .AddInputParameter("@PageSize", DbType.Int32, anpPageIndex.PageSize)
                     .AddInputParameter("@CurrentPage", DbType.Int32, PageIndex)
                     .AddInputParameter("@Columns", DbType.String, "*")
                     .AddInputParameter("@TableName", DbType.String, "Web_VFasciClearPropLog")
                     .AddInputParameter("@Wheres", DbType.String, where.ToString())
                     .AddInputParameter("@KeyName", DbType.String, "ID")
                     .AddInputParameter("@OrderBy", DbType.String, "InputDate desc,ID desc")
                     .ToDataSet();

        if (ds.Tables.Count > 0)
        {
            anpPageIndex.RecordCount      = (int)ds.Tables[0].Rows[0][0];
            anpPageIndex.CurrentPageIndex = PageIndex;

            if (ds.Tables[1].Rows.Count > 0)
            {
                rptDataList.Visible    = true;
                lbNonData.Visible      = false;
                rptDataList.DataSource = ds.Tables[1];
                rptDataList.DataBind();
            }
            else
            {
                rptDataList.Visible = false;
                lbNonData.Visible   = true;
            }
        }

        DataRow dr = new BLL.Member().GetPropFasciStatLog(userName);

        if (dr != null)
        {
            GaoJiPropFasci   = dr["GaoJi"].ToString();
            ZhongJiPropFasci = dr["ZhongJi"].ToString();
            DiJiPropFasci    = dr["DiJi"].ToString();
        }
    }
예제 #12
0
        protected void uiLinkButtonConfirm_Click(object sender, EventArgs e)
        {
            MembershipUser user = Membership.GetUser();

            if (user.PasswordQuestion == uiDropDownListQuestion.SelectedValue && Member.CurrentMember.Answer == uiTextBoxAnswer.Text.Trim())
            {
                if (!string.IsNullOrEmpty(uiHiddenFieldFriendID.Value))
                {
                    try
                    {
                        int points = Convert.ToInt32(uiHiddenFieldPoints.Value);
                        if (Member.CurrentMember.Credit_Point < points)
                        {
                            ClientScript.RegisterStartupScript(this.GetType(), "Error3", @"$(document).ready(function () { notify('error', 'حدث خطأ . رصيدك الحالى لا يسمح لإتمام الشحن.'); });", true);
                            return;
                        }

                        Member ToMember = new Member();
                        ToMember.LoadByPrimaryKey(Convert.ToInt32(uiHiddenFieldFriendID.Value));

                        ToMember.Credit_Point = ToMember.Credit_Point + points;
                        Member.CurrentMember.Credit_Point -= points;
                        ToMember.Save();
                        Member.CurrentMember.Save();

                        ClientScript.RegisterStartupScript(this.GetType(), "Success1", @"$(document).ready(function () { notify('success', 'تم تحويل النقاط بنجاح.'); });", true);

                        // logging
                        BLL.MemberLog log = new BLL.MemberLog();
                        log.AddNew(Member.CurrentMemberID, new BLL.Log.RechargePoints() { FromMemberName=BLL.Member.CurrentMember.Name,ToMemberName = ToMember.Name, Points = points }, ToMember.MemberID, null);

                        LoadBalance();
                        uiHiddenFieldPrice.Value = "";
                        uiHiddenFieldPoints.Value = "";
                        uiHiddenFieldFriendID.Value = "";
                    }
                    catch (Exception ex)
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "Error11", @"$(document).ready(function () { notify('error', 'حدث خطأ . من فضلك أعد المحاولة.'); });", true);
                    }
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "Error4", @"$(document).ready(function () { notify('error', 'حدث خطأ . من فضلك أعد المحاولة.'); });", true);
                }
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "Error5", @"$(document).ready(function () { notify('error', 'حدث خطأ . من فضلك تأكد من السؤال والإجابة السرى.'); });", true);
                return;
            }
        }
예제 #13
0
        //魅力值排行
        public void BindMeiliList()
        {
            string where = " and meili>0";
            if (ConfigurationManager.AppSettings["RobotRank"] != null && ConfigurationManager.AppSettings["RobotRank"] == "0")
            {
                where += " and userid in (select userid from tusers where isrobot=0)";
            }
            int       counts;
            DataTable dt = new BLL.Member().PagerListFascination(10, 1, out counts, where);

            rpMeili.DataSource = dt.DefaultView;
            rpMeili.DataBind();
        }
예제 #14
0
    protected void Page_Load( object sender, EventArgs e )
    {
        AdminPopedom.IsHoldModel( "15" );

        StringBuilder where = new StringBuilder( );
        string userName = string.Empty;
        string un = CommonManager.Web.RequestUrlDecode( "un", "" );
        if (!string.IsNullOrEmpty(un))
        {
            userName = un;
            where.Append(" and UserName='******'");
        }
        where.Append(" and ID<>0");

        DataSet ds = DbSession.Default.FromProc( "Web_pGetDataPager" )
            .AddInputParameter( "@PageSize", DbType.Int32, anpPageIndex.PageSize )
            .AddInputParameter( "@CurrentPage", DbType.Int32, PageIndex )
            .AddInputParameter( "@Columns", DbType.String, "*" )
            .AddInputParameter( "@TableName", DbType.String, "Web_VFasciClearPropLog" )
            .AddInputParameter( "@Wheres", DbType.String, where.ToString() )
            .AddInputParameter( "@KeyName", DbType.String, "ID" )
            .AddInputParameter( "@OrderBy", DbType.String, "InputDate desc,ID desc" )
            .ToDataSet();

        if( ds.Tables.Count > 0 )
        {
            anpPageIndex.RecordCount = (int)ds.Tables[0].Rows[0][0];
            anpPageIndex.CurrentPageIndex = PageIndex;

            if( ds.Tables[1].Rows.Count > 0 )
            {
                rptDataList.Visible = true;
                lbNonData.Visible = false;
                rptDataList.DataSource = ds.Tables[1];
                rptDataList.DataBind();
            }
            else
            {
                rptDataList.Visible = false;
                lbNonData.Visible = true;
            }
        }

        DataRow dr = new BLL.Member().GetPropFasciStatLog(userName);
        if (dr != null)
        {
            GaoJiPropFasci = dr["GaoJi"].ToString();
            ZhongJiPropFasci = dr["ZhongJi"].ToString();
            DiJiPropFasci = dr["DiJi"].ToString();
        }
    }
예제 #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Member member=new Member();
                member.GetMemberByUserId(new Guid(Membership.GetUser().ProviderUserKey.ToString()));
                ctrlMail.MemberName = Membership.GetUser().UserName;
                ctrlMail.MemberID = member.MemberID;

                // logging
                BLL.MemberLog log = new BLL.MemberLog();
                log.AddNew(BLL.Member.CurrentMemberID, new BLL.Log.Log() { Type = Helper.Enums.LogType.ViewMailPage }, null, null);
            }
        }
예제 #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Member user = BLL.Member.CurrentMember;
            Member online = new Member();
            online.GetMemberFriendsByStatus(user.MemberID, true);
            Member offline = new Member();
            offline.GetMemberFriendsByStatus(user.MemberID, false);

            uiRepeaterOnline.DataSource = online.DefaultView;
            uiRepeaterOnline.DataBind();

            uiRepeaterOffline.DataSource = offline.DefaultView;
            uiRepeaterOffline.DataBind();
        }
예제 #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string position = CommonManager.Web.Request("position", "");
            if (!string.IsNullOrEmpty(position) && position == "index")
            {
                //校验验证码
                string vali = CommonManager.Web.Request("vali", "");
                if (string.IsNullOrEmpty(vali) || !CommonManager.String.IsInteger(vali))
                {
                    Response.Write("ValiError");
                    return;
                }
                if (Session["CodeImageV"] == null || vali != Session["CodeImageV"].ToString())
                {
                    Response.Write("ValidateExpair");
                    return;
                }
                Session["CodeImageV"] = "";
            }

            string sqlUserName = CommonManager.Web.RequestUrlDecode("username", "");
            string sqlpassword = CommonManager.Web.RequestUrlDecode("password", "");

            BLL.LoginResults lr = new BLL.Member().Login(sqlUserName, sqlpassword);
            if (lr == BLL.LoginResults.MemberNameInvalid || lr == BLL.LoginResults.PasswordInvalid)
            {
                Response.Write("False");
            }
            else if (lr == BLL.LoginResults.Locked)
            {
                Response.Write("NoPass");
            }
            else if (lr == BLL.LoginResults.Succeed)
            {
                new BLL.Member().UpdateLastLogin(sqlUserName, Utility.Common.RequestIP);

                Response.Write("True");
            }
        }
        catch (Exception ex)
        {
            Response.Write("Error");
            //Response.Write("Message:" + ex.Message + "Source:" + ex.Source + "StackTrace:" + ex.StackTrace);
        }
    }
예제 #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string position = CommonManager.Web.Request("position", "");
            if (!string.IsNullOrEmpty(position) && position == "index")
            {
                //校验验证码
                string vali = CommonManager.Web.Request("vali", "");
                if (string.IsNullOrEmpty(vali) || !CommonManager.String.IsInteger(vali))
                {
                    Response.Write("ValiError");
                    return;
                }
                if (Session["CodeImageV"] == null || vali != Session["CodeImageV"].ToString())
                {
                    Response.Write("ValidateExpair");
                    return;
                }
                Session["CodeImageV"] = "";
            }

            string sqlUserName = CommonManager.Web.RequestUrlDecode("username", "");
            string sqlpassword = CommonManager.Web.RequestUrlDecode("password", "");

            BLL.LoginResults lr = new BLL.Member().Login(sqlUserName, sqlpassword);
            if (lr == BLL.LoginResults.MemberNameInvalid || lr == BLL.LoginResults.PasswordInvalid)
            {
                Response.Write("False");
            }
            else if (lr == BLL.LoginResults.Locked)
            {
                Response.Write("NoPass");
            }
            else if (lr == BLL.LoginResults.Succeed)
            {
                new BLL.Member().UpdateLastLogin(sqlUserName, Utility.Common.RequestIP);

                Response.Write("True");
            }
        }
        catch (Exception ex)
        {
            Response.Write("Error");
            //Response.Write("Message:" + ex.Message + "Source:" + ex.Source + "StackTrace:" + ex.StackTrace);
        }
    }
예제 #19
0
        protected void uiLinkButtonCreateTempRoom_Click(object sender, EventArgs e)
        {
            if (Request.IsAuthenticated)
            {
                if (uiCheckBoxListFriends.Items.Cast<ListItem>().Where(i => i.Selected).Count() > 0)
                {
                    IHubContext _Ncontext = GlobalHost.ConnectionManager.GetHubContext<NotificationHub>();
                    Member member = new Member();
                    member.GetMemberByUserId(new Guid(Membership.GetUser().ProviderUserKey.ToString()));
                    Room room = new Room();
                    room.AddNew();

                    room.EnableCam = true;
                    room.EnableMic = true;
                    room.RowStatusID = 1;
                    room.CreatedDate = DateTime.Now;
                    room.Save();

                    room.Name = "غرفة مؤقتة - " + room.RoomID.ToString();
                    room.Save();

                    Session["TempRoomCreate"] = room.RoomID;

                    // notify friends with new temp room

                    for (int i = 0; i < uiCheckBoxListFriends.Items.Count; i++)
                    {
                        if (uiCheckBoxListFriends.Items[i].Selected)
                        {
                            Member temp = new Member();
                            temp.LoadByPrimaryKey(Convert.ToInt32(uiCheckBoxListFriends.Items[i].Value));
                            MembershipUser u = Membership.GetUser(temp.UserID);
                            _Ncontext.Clients.Group(u.UserName).inviteToTempRoom(room.RoomID, member.Name);
                        }
                    }

                    IHubContext _Rcontext = GlobalHost.ConnectionManager.GetHubContext<ChatRoomHub>();
                    _Rcontext.Clients.Group(member.UserName).openTempRoom(room.RoomID);
                    //ClientScript.RegisterStartupScript(this.GetType(), "initTempRoom", "self.parent.location='/home.aspx';", true);
                    //Response.Redirect("home.aspx");
                }
                else
                {

                }
            }
        }
예제 #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(ActivationCode))
                {
                    Guid ac;
                    Guid.TryParse(ActivationCode, out ac);
                    if (ac != Guid.Empty)
                    {
                        Member currentmember = Member.CurrentMember;
                        Member account = new Member();
                        account.GetMemberByActivationCode(ac);

                        if (account.MemberID == currentmember.MemberID)
                        {

                            account.IsMailActivated = true;
                            account.Save();
                            uiPanelActivationForm.Visible = false;
                            uiPanelMailSent.Visible = false;
                            uiPanelActivated.Visible = true;
                        }
                        else
                        {
                            uiPanelActivationForm.Visible = true;
                            uiPanelMailSent.Visible = false;
                            uiPanelActivated.Visible = false;
                        }

                    }
                    else
                    {
                        uiPanelActivationForm.Visible = true;
                        uiPanelMailSent.Visible = false;
                        uiPanelActivated.Visible = false;
                    }
                }
                else
                {
                    uiPanelActivationForm.Visible = true;
                    uiPanelMailSent.Visible = false;
                    uiPanelActivated.Visible = false;
                }
            }
        }
예제 #21
0
        protected void uiButtonRegister_Click(object sender, EventArgs e)
        {
            MembershipUser[] users = Membership.GetAllUsers().Cast<MembershipUser>().Where(m => m.Email == Email.Text).ToArray();
            if (users.Length == 15)
            {
                ErrorMessage.Text = GetLocalResourceObject("maxMailAccount").ToString();
                ErrorMessage.Visible = true;
                return;
            }

            MembershipCreateStatus objstatus;
            MembershipUser objUser = Membership.CreateUser(UserName.Text, Password.Text, Email.Text, Question.Text, Answer.Text, true, out objstatus);
            bool success = true;
            switch (objstatus)
            {
                case MembershipCreateStatus.DuplicateUserName:
                    ErrorMessage.Text = GetLocalResourceObject("duplicateUsername").ToString();
                    ErrorMessage.Visible = true;
                    success = false;
                    break;
                case MembershipCreateStatus.InvalidPassword:
                    ErrorMessage.Text = GetLocalResourceObject("invalidPass").ToString();
                    ErrorMessage.Visible = true;
                    success = false;
                    break;
                case MembershipCreateStatus.ProviderError:
                case MembershipCreateStatus.UserRejected:
                    ErrorMessage.Text = GetLocalResourceObject("generalError").ToString();
                    ErrorMessage.Visible = true;
                    success = false;
                    break;
                default:
                    break;
            }
            if (success)
            {
                Member member = new Member ();
                member.AddNew();
                member.UserID = new Guid(objUser.ProviderUserKey.ToString());
                member.Name = objUser.UserName;
                member.Save();
                FormsAuthentication.SetAuthCookie(objUser.Email, false);
                Response.Redirect("Account.aspx");
            }
        }
예제 #22
0
        protected void uiLinkButtonAddPhoto_Click(object sender, EventArgs e)
        {
            /*string path = "~/" + ConfigurationManager.AppSettings["accountpics"].ToString();
            DirectoryInfo dir = new DirectoryInfo(Server.MapPath(path + "/" + Membership.GetUser().ProviderUserKey.ToString()));
            if (!dir.Exists)
                dir.Create();
            Member member = new Member();
            member.GetMemberByUserId(new Guid(Membership.GetUser().ProviderUserKey.ToString()));
            path += "/" + Membership.GetUser().ProviderUserKey.ToString();
            if (uiFileUploadAddImage.HasFile)
            {
                path = path + "/" + DateTime.Now.ToString("ddMMyyyy_hhmmss_") + uiFileUploadAddImage.FileName;
                uiFileUploadAddImage.SaveAs(Server.MapPath(path));
                MemberPic pic = new MemberPic();
                pic.AddNew();
                pic.Description = uiTextBoxPhotoDesc.Text;
                pic.PicPath = path.Substring(1);
                pic.MemberID = member.MemberID;
                pic.Save();
            }*/
            Member member = new Member();
            member.GetMemberByUserId(new Guid(Membership.GetUser().ProviderUserKey.ToString()));
            if (Session["CurrentUploadedFiles"] != null)
            {
                Hashtable Files;
                Files = (Hashtable)Session["CurrentUploadedFiles"];

                if (Files.Count > 0)
                {
                    MemberPic pic = new MemberPic();
                    foreach (DictionaryEntry item in Files)
                    {
                        pic.AddNew();
                        pic.Description = "";
                        pic.PicPath = item.Value.ToString(); ;
                        pic.MemberID = member.MemberID;
                    }
                    pic.Save();
                    Session["CurrentUploadedFiles"] = null;
                }

            }
            LoadPics();
            ClientScript.RegisterStartupScript(this.GetType(), "donePic", "$(document).ready(function (){ notify('success','تم إضافة الصورة / الصور بنجاح.');}); ", true);
        }
예제 #23
0
    public void BindList()
    {
        string where = string.Empty;

        int counts;
        DataTable dt = new BLL.Member().PagerListPropTotal(WebPager1.PageSize, WebPager1.CurrentPageIndex, out counts);
        WebPager1.RecordCount = counts;
        Rowid = WebPager1.CurrentPageIndex * WebPager1.PageSize - WebPager1.PageSize;
        if (dt.Rows.Count <= 0)
        {
            this.NoDataList.Visible = true;
        }
        else
        {
            rpList.DataSource = dt.DefaultView;
            rpList.DataBind();
        }
    }
예제 #24
0
 private void BindRoomInfo()
 {
     clearFields();
     BLL.Room room = new BLL.Room();
     room.LoadByPrimaryKey(RoomID);
     if (!room.IsColumnNull("CreatedDate"))
         uiLabelCreatedDate.Text = Helper.Date.ToString(room.CreatedDate);
     BLL.Member creator = new BLL.Member ();
     if(!room.IsColumnNull("CreatedBy"))
     {
         creator.LoadByPrimaryKey(room.CreatedBy);
         uiLabelCreator.Text = creator.UserName;
         uiLabelName.Text = room.Name;
         loadAdminTable();
         uiGridViewAdmins.DataSource = AdminsTable;
         uiGridViewAdmins.DataBind();
     }
 }
예제 #25
0
 private void LoadFriends()
 {
     Member member = new Member();
     member.GetMemberByUserId(new Guid(Membership.GetUser().ProviderUserKey.ToString()));
     MemberFriend friends = new MemberFriend();
     friends.GetAllMemberOnlineFriends(member.MemberID);
     if (friends.RowCount > 0)
     {
         uiCheckBoxListFriends.DataSource = friends.DefaultView;
         uiCheckBoxListFriends.DataTextField = "UserName";
         uiCheckBoxListFriends.DataValueField = "FriendID";
         uiCheckBoxListFriends.DataBind();
     }
     else
     {
         uiPanelNoFriendsFound.Visible = true;
         uiCheckBoxListFriends.Visible = false;
     }
 }
예제 #26
0
    public void BindList()
    {
        string where = string.Empty;

        int       counts;
        DataTable dt = new BLL.Member().PagerListPropTotal(WebPager1.PageSize, WebPager1.CurrentPageIndex, out counts);

        WebPager1.RecordCount = counts;
        Rowid = WebPager1.CurrentPageIndex * WebPager1.PageSize - WebPager1.PageSize;
        if (dt.Rows.Count <= 0)
        {
            this.NoDataList.Visible = true;
        }
        else
        {
            rpList.DataSource = dt.DefaultView;
            rpList.DataBind();
        }
    }
예제 #27
0
    private void ExitMatch()
    {
        try
        {
            string contestId = Common.FilterString(Common.GetStringOfUrl("id"));
            string hids      = Common.FilterString(Common.GetStringOfUrl("hidTime"));
            string uid       = Common.FilterString(Common.GetIntOfUrl("uid").ToString());
            if (!UiCommon.UserLoginInfo.IsLogin)
            {
                //判断是否从平台跳转过来的

                string token = Common.FilterString(Common.GetStringOfUrl("token2").ToString());
                if (CommonManager.String.IsInteger(uid) && token.Trim().Length > 0)
                {
                    string un = new BLL.Member().GetNameByUserID(uid, token);
                    if (!string.IsNullOrEmpty(un))
                    {
                        UserLoginInfo.SetInfo(uid, un);
                    }
                    else
                    {
                        Response.Write("抱歉,退赛失败,可能是服务器繁忙,请稍后再试!");
                        return;
                    }
                }
            }
            DateTime dt1 = Convert.ToDateTime(hids);
            if (DateTime.Compare(dt1, DateTime.Now) < 0)
            {
                Response.Write("抱歉,比赛已开始,不能退赛!");
                return;
            }
            DbSession.Default.FromProc("Web_pExitMatch")
            .AddInputParameter("@UserID", DbType.Int32, UiCommon.UserLoginInfo.UserID)
            .AddInputParameter("@ContestID", DbType.Int32, contestId)
            .Execute();
            Response.Write("退赛成功!");
        }
        catch (Exception ex)
        {
            Response.Write("退赛失败,服务器未知错误!");
        }
    }
예제 #28
0
 protected void uiLinkButtonAdd_Click(object sender, EventArgs e)
 {
     string path = "~/" + ConfigurationManager.AppSettings["accountpics"].ToString();
     DirectoryInfo dir = new DirectoryInfo(Server.MapPath(path + "/" + Membership.GetUser().ProviderUserKey.ToString()));
     if (!dir.Exists)
         dir.Create();
     Member member = new Member();
     member.GetMemberByUserId(new Guid(Membership.GetUser().ProviderUserKey.ToString()));
     path += "/" + Membership.GetUser().ProviderUserKey.ToString();
     if (uiFileUploadImage.HasFile)
     {
         path = path + "/" + DateTime.Now.ToString("ddMMyyyy_hhmmss_") + uiFileUploadImage.FileName;
         uiFileUploadImage.SaveAs(Server.MapPath(path));
         MemberPic pic = new MemberPic ();
         pic.AddNew();
         pic.Description = path.Substring(1);
         pic.MemberID = member.MemberID;
         pic.Save();
     }
 }
예제 #29
0
        public void SendMailNotifications(int? memberID)
        {
            IHubContext context = GlobalHost.ConnectionManager.GetHubContext<NotificationHub>();
            if (!memberID.HasValue)
            {
                memberID = 0;
                BLL.Member member=new Member();
                if (member.GetMemberByUserId(new Guid(Membership.GetUser().ProviderUserKey.ToString())))
                {
                    memberID = member.MemberID;
                }
            }
            SendMailNotication(memberID.Value, context);

            if (Helper.Admin.IsAdmin() && Helper.Admin.HasRole(Helper.Enums.AdminRoles.Admin_SiteMails.ToString()))
            {
                foreach (var m in BLL.Member.SiteMembers)
                {
                    SendMailNotication(m.MemberID, context);
                }
            }
        }
예제 #30
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Member member = new Member();
         member.GetMemberByUserId(new Guid(Membership.GetUser().ProviderUserKey.ToString()));
         MemberFriend friends = new MemberFriend();
         friends.GetAllMemberOnlineFriends(member.MemberID);
         if (friends.RowCount > 0)
         {
             uiCheckBoxListFriends.DataSource = friends.DefaultView;
             uiCheckBoxListFriends.DataTextField = "UserName";
             uiCheckBoxListFriends.DataValueField = "FriendID";
             uiCheckBoxListFriends.DataBind();
         }
         else
         {
             uiPanelNoFriendsFound.Visible = true;
             uiCheckBoxListFriends.Visible = false;
         }
     }
 }
예제 #31
0
    protected void CreateUserClick(object sender, EventArgs e)
    {
        string username = string.Empty, nickname = string.Empty, pwd = string.Empty, idcard = string.Empty, realname = string.Empty;

        username = CommonManager.Web.RequestForm("u", "");

        BLL.Member member = new BLL.Member();
        if (member.ExistName(username))
        {
            this.ErrorLabel.Text = "该用户名已经存在!";
            return;
        }

        nickname = Server.HtmlDecode(CommonManager.Web.RequestForm("n", "").Replace(",", "''"));
        if (member.ExistNick(nickname))
        {
            this.ErrorLabel.Text = "该昵称已经存在!";
            return;
        }
        pwd = CommonManager.Web.RequestForm("pwd", "");

        idcard   = CommonManager.Web.RequestForm("idcard", "");
        realname = CommonManager.Web.RequestForm("realname", "");

        int dbLogoId = member.SetLogoID(1, 1);

        int userId = member.Add_UserInfo(username, nickname, string.Empty, 1, dbLogoId, pwd, pwd, idcard, string.Empty, string.Empty, Utility.Common.RequestIP, string.Empty, realname);

        if (userId > 0)
        {
            this.ErrorLabel.ForeColor = System.Drawing.Color.Green;
            this.ErrorLabel.Text      = "用户创建成功!";
        }
        else
        {
            this.ErrorLabel.Text = "抱歉,创建失败,可能是服务器繁忙,请稍后再试!!";
        }
    }
예제 #32
0
    public void DaoJuZS()
    {
        string userId     = UiCommon.UserLoginInfo.UserID;
        string userName   = UiCommon.UserLoginInfo.UserName;
        string propId     = Common.SqlEncode(Common.GetStringOfUrl("id"));
        string targetName = Common.GetStringOfUrl("targetname");
        int    count      = Common.GetIntOfUrl("count");

        BLL.Member member = new BLL.Member();
        if (userName.Trim() == targetName.Trim())
        {
            //1.如果被赠送用户是自己,不允许赠送
            Response.Write("myself");
        }
        else if (!member.ExistName(Common.SqlEncode(targetName)))
        {
            //2.被赠送的用户不存在
            Response.Write("nouser");
        }
        else if (count > member.GetDaoJuCount(userId, propId))
        {
            //3.赠送人道具库中的道具数量不足或没有
            Response.Write("nodaoju");
        }
        else
        {
            //4.赠送
            int iRows = member.ZengsongDaoJu(userId, member.GetUserID(targetName), propId, count);
            if (iRows > 0)
            {
                Response.Write("zsdjcg");
            }
            else
            {
                Response.Write("zsdjsb");
            }
        }
    }
예제 #33
0
    protected void CreateUserClick(object sender, EventArgs e)
    {
        string username = string.Empty, nickname = string.Empty, pwd = string.Empty,idcard=string.Empty,realname=string.Empty;
        username = CommonManager.Web.RequestForm("u", "");

        BLL.Member member = new BLL.Member();
        if (member.ExistName(username))
        {
            this.ErrorLabel.Text = "该用户名已经存在!";
            return;
        }

        nickname =Server.HtmlDecode(CommonManager.Web.RequestForm("n", "").Replace(",","''"));
        if (member.ExistNick(nickname))
        {
            this.ErrorLabel.Text = "该昵称已经存在!";
            return;
        }
        pwd = CommonManager.Web.RequestForm("pwd", "");

        idcard = CommonManager.Web.RequestForm("idcard", "");
        realname = CommonManager.Web.RequestForm("realname", "");

        int dbLogoId = member.SetLogoID(1, 1);

        int userId = member.Add_UserInfo(username, nickname, string.Empty, 1, dbLogoId, pwd, pwd, idcard, string.Empty, string.Empty, Utility.Common.RequestIP, string.Empty, realname);
        if( userId > 0 )
        {
            this.ErrorLabel.ForeColor=System.Drawing.Color.Green;
            this.ErrorLabel.Text = "用户创建成功!";
        }
        else
        {
            this.ErrorLabel.Text = "抱歉,创建失败,可能是服务器繁忙,请稍后再试!!";

        }
    }
예제 #34
0
 public int Insert(Member member)
 {
     return(memberDal.Insert(member));
 }
예제 #35
0
        protected void uiLinkButtonAddFriend_Click(object sender, EventArgs e)
        {
            Member member = new Member();
            member.GetMemberByUserId(new Guid(Membership.GetUser().ProviderUserKey.ToString()));

            try
            {
                MemberFriend newfriend = new MemberFriend();
                newfriend.AddNew();
                newfriend.MemberID = member.MemberID;
                newfriend.FriendID = Convert.ToInt32(uiHiddenFieldFriendID.Value);
                newfriend.Save();

                Member memberfriend = new Member();
                memberfriend.LoadByPrimaryKey(newfriend.FriendID);

                // logging
                BLL.MemberLog log = new BLL.MemberLog();
                log.AddNew(BLL.Member.CurrentMemberID, new BLL.Log.AddFriend() { FriendID = newfriend.FriendID, FriendName = memberfriend.Name }, newfriend.FriendID, null);
            }
            catch (Exception ex)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ErrorAddingFriend", "$(document).ready(function (){ notify('error','خطأ. حدث خطأ . من فضلك أعد المحاولة مرة أخرى أو تأكد من وجود الصديق فى قائمة الأصدقاء.');}); ", true);
            }
        }
예제 #36
0
        private void BindRooms()
        {
            string[] myparams = null;
            if (!string.IsNullOrEmpty(localParams))
            {
                myparams = localParams.Split('&');
            }

            if (myparams.Length > 0)
            {
                if (myparams[0] == "cat=1")
                {
                    int cid = Convert.ToInt32(myparams[1].Substring(2));
                    Room rooms = new Room();
                    rooms.GetRoomsByCategoryID(cid);
                    uiRepeaterRooms.DataSource = rooms.DefaultView;
                    uiRepeaterRooms.DataBind();
                }
                else if (myparams[0] == "subcat=1")
                {
                    int scid = Convert.ToInt32(myparams[1].Substring(2));
                    Room rooms = new Room();
                    rooms.GetRoomsBySubCategoryID(scid);
                    uiRepeaterRooms.DataSource = rooms.DefaultView;
                    uiRepeaterRooms.DataBind();
                }
                else if (myparams[0] == "vip=1")
                {
                    Room rooms = new Room();
                    rooms.GetPremiumRooms();
                    uiRepeaterRooms.DataSource = rooms.DefaultView;
                    uiRepeaterRooms.DataBind();
                }
                else if (myparams[0] == "cb=1")
                {
                    Member member = new Member();
                    member.GetMemberByUserId(new Guid(Membership.GetUser().ProviderUserKey.ToString()));

                    Room rooms = new Room();
                    rooms.GetRoomsByCreatorID(member.MemberID);
                    uiRepeaterRooms.DataSource = rooms.DefaultView;
                    uiRepeaterRooms.DataBind();
                }
                else if (myparams[0] == "fav=1")
                {
                    Member member = new Member();
                    member.GetMemberByUserId(new Guid(Membership.GetUser().ProviderUserKey.ToString()));

                    Room rooms = new Room();
                    rooms.GetFavoriteByMemberID(member.MemberID);
                    uiRepeaterRooms.DataSource = rooms.DefaultView;
                    uiRepeaterRooms.DataBind();
                }

            }
        }
예제 #37
0
파일: Reg.cs 프로젝트: hackerlank/robinerp
        protected void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            string validcode = Common.GetStringOfForm("validcode");

            if (ValidCode.CurrentCode != validcode)
            {
                /*Label1.Text = "温馨提示:验证码输入错误,请重新输入!";
                 * Label1.Visible = true;*/
                CommonManager.Web.RegJs(this, "alert('温馨提示:验证码输入错误,请重新输入!');location.href=location.href;", true);
                return;
            }

            string username = Common.FilterString(Common.GetStringOfForm("username"));
            //昵称可以输入任何字符,所以要对它进行HTML编码,防止恶意木马脚本字符串;过滤"'"为"''",避免SQL注入式攻击
            string nickname = Server.HtmlEncode(Common.GetStringOfForm("nickname").Replace("'", "''"));
            string sex      = Common.FilterString(Common.GetStringOfForm("sex"));
            string pwd      = Common.FilterString(Common.GetStringOfForm("pwd"));    //Common.FilterString(Common.GetStringOfForm("pwd"));
            string ejpwd    = Common.FilterString(Common.GetStringOfForm("ejpwd"));  //Common.FilterString(Common.GetStringOfForm("ejpwd"));
            string email    = Common.FilterString(Common.GetStringOfForm("email"));
            string mobile   = Common.FilterString(Common.GetStringOfForm("mobile")); //电话保存到TUserInfo表的PhoneNum列
            string promoter = Common.FilterString(Common.GetStringOfForm("promoter"));
            string logoid   = Common.FilterString(Common.GetStringOfForm("hidLogoID"));
            string idcard   = Common.FilterString(Common.GetStringOfForm("idcard"));
            string qqNum    = Common.FilterString(Common.GetStringOfForm("qqnum"));
            string realname = Common.FilterString(Common.GetStringOfForm("realname"));

            if (string.IsNullOrEmpty(sex) || !CommonManager.String.IsInteger(sex))
            {
                sex = "1";
            }
            if (string.IsNullOrEmpty(logoid) || !CommonManager.String.IsInteger(logoid))
            {
                logoid = "1";
            }

            //新增:注册时选择职业和地区
            //string occu = CommonManager.Web.RequestForm( "txtOccuPation", "" );
            //string prov = CommonManager.Web.RequestForm( "hidProvince", "" );
            //string city = CommonManager.Web.RequestForm( "hidCity", "" );
            //string address = Server.HtmlEncode( CommonManager.Web.RequestForm( "txtAddress", "" ) );
            //如果银行密码为空,就把它设为登录密码
            if (ejpwd.Trim().Length == 0)
            {
                ejpwd = pwd;
            }
            BLL.Member member   = new BLL.Member();
            int        dbLogoId = member.SetLogoID(int.Parse(sex), int.Parse(logoid));

            #region 增加判断是否在新手送礼包活动期间

            /*
             * bool isaction = false;
             * if (RookiePresentConfig.Config.IsEnable)
             * {
             * if (RookiePresentConfig.Config.BeginDate <= DateTime.Now && RookiePresentConfig.Config.EndDate >= DateTime.Now)
             * {
             *  isaction = true;
             *  //walletMoney += RookiePresentConfig.Config.Money;
             *  //赠送道具
             *  if (RookiePresentConfig.Config.PropPresent.Rows.Count > 0)
             *  {
             *      string select = "select Count(PropID) from TPropDefine where PropID=@PropID;";
             *      string sql = "insert into TUserProp (UserID,PropID,HoldCount) values ({0},{1},{2});";
             *      StringBuilder sqlCollection = new StringBuilder();
             *      foreach (DataRow row in RookiePresentConfig.Config.PropPresent.Rows)
             *      {
             *          int tmpcount = DbSession.Default.FromSql(select).AddInputParameter("@PropID", DbType.Int32, row["PropID"]).ToScalar<int>();
             *          if (tmpcount <= 0)
             *              continue;
             *          sqlCollection.AppendFormat(sql, userId, row["PropID"].ToString(), row["Amount"].ToString());
             *      }
             *      if (sqlCollection.ToString().Length > 0)
             *      {
             *          DbSession.Default.FromSql(sqlCollection.ToString()).Execute();
             *      }
             *  }
             * }
             * else
             * {
             *  isaction = false;
             *  RookiePresentConfig.Config.IsEnable = false;
             *  RookiePresentConfig.Save(RookiePresentConfig.Config);
             * }
             * }*/
            #endregion



            //2012-12-16 根据域名来获取代理商ID,域名设置在代理商资料修改中
            string agencyName = UiCommon.StringConfig.GetAgencyNameByTwoDname(); //获取域名获取代理商账号



            int userId = Convert.ToInt32(member.Add_UserInfo(username, nickname, promoter, int.Parse(sex), dbLogoId, pwd, ejpwd, idcard, mobile, email, Common.RequestIP, qqNum, realname, agencyName)["UserID"]);
            if (userId > 0)
            {
                //5.保存用户信息
                UiCommon.UserLoginInfo.SetInfo(userId.ToString(), username);

                //更新用户登陆信息
                new BLL.Member().UpdateLastLogin(username, Utility.Common.RequestIP);

                //6.记录当前客户机器上的注册时间到cookies
                BCSTCache.Default.Save <CookiesCache>("RegDateTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                Response.Redirect("/Manage/Default.aspx");
            }
            //else if (userId == -3)
            //{
            //    CommonManager.Web.RegJs(this, "alert('抱歉,注册失败,此IP今天注册人数已满!');location.href=location.href;", true);
            //}
            //else if (userId == -4)
            //{
            //    CommonManager.Web.RegJs(this, "alert('抱歉,注册失败,此身份证号已达到注册次数限制!');location.href=location.href;", true);
            //}
            else
            {
                CommonManager.Web.RegJs(this, "alert('抱歉,注册失败,可能是服务器繁忙,请稍后再试!');location.href=location.href;", true);
            }
        }
예제 #38
0
파일: Reg.cs 프로젝트: lincoln56/robinerp
        protected void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            string validcode = Common.GetStringOfForm("validcode");
            if (ValidCode.CurrentCode != validcode)
            {
                /*Label1.Text = "��ܰ��ʾ����֤������������������룡";
                Label1.Visible = true;*/
                CommonManager.Web.RegJs(this, "alert('��ܰ��ʾ����֤������������������룡');location.href=location.href;", true);
                return;
            }

            string username = Common.FilterString(Common.GetStringOfForm("username"));
            //�dzƿ��������κ��ַ�������Ҫ��������HTML���룬��ֹ����ľ��ű��ַ���������"'"Ϊ"''"������SQLע��ʽ����
            string nickname = Server.HtmlEncode(Common.GetStringOfForm("nickname").Replace("'", "''"));
            string sex = Common.FilterString(Common.GetStringOfForm("sex"));
            string pwd = Common.FilterString(Common.GetStringOfForm("pwd"));//Common.FilterString(Common.GetStringOfForm("pwd"));
            string ejpwd = Common.FilterString(Common.GetStringOfForm("ejpwd"));//Common.FilterString(Common.GetStringOfForm("ejpwd"));
            string email = Common.FilterString(Common.GetStringOfForm("email"));
            string mobile = Common.FilterString(Common.GetStringOfForm("mobile"));//�绰���浽TUserInfo���PhoneNum��
            string promoter = Common.FilterString(Common.GetStringOfForm("promoter"));
            string logoid = Common.FilterString(Common.GetStringOfForm("hidLogoID"));
            string idcard = Common.FilterString(Common.GetStringOfForm("idcard"));
            string qqNum = Common.FilterString(Common.GetStringOfForm("qqnum"));
            string realname = Common.FilterString(Common.GetStringOfForm("realname"));
            if (string.IsNullOrEmpty(sex) || !CommonManager.String.IsInteger(sex))
            {
                sex = "1";
            }
            if (string.IsNullOrEmpty(logoid) || !CommonManager.String.IsInteger(logoid))
            {
                logoid = "1";
            }

            //������ע��ʱѡ��ְҵ�͵���
            //string occu = CommonManager.Web.RequestForm( "txtOccuPation", "" );
            //string prov = CommonManager.Web.RequestForm( "hidProvince", "" );
            //string city = CommonManager.Web.RequestForm( "hidCity", "" );
            //string address = Server.HtmlEncode( CommonManager.Web.RequestForm( "txtAddress", "" ) );
            //�����������Ϊ�գ��Ͱ�����Ϊ��¼����
            if (ejpwd.Trim().Length == 0)
            {
                ejpwd = pwd;
            }
            BLL.Member member = new BLL.Member();
            int dbLogoId = member.SetLogoID(int.Parse(sex), int.Parse(logoid));

            #region �����ж��Ƿ��������������ڼ�
            /*
            bool isaction = false;
            if (RookiePresentConfig.Config.IsEnable)
            {
            if (RookiePresentConfig.Config.BeginDate <= DateTime.Now && RookiePresentConfig.Config.EndDate >= DateTime.Now)
            {
                isaction = true;
                //walletMoney += RookiePresentConfig.Config.Money;
                //���͵���
                if (RookiePresentConfig.Config.PropPresent.Rows.Count > 0)
                {
                    string select = "select Count(PropID) from TPropDefine where PropID=@PropID;";
                    string sql = "insert into TUserProp (UserID,PropID,HoldCount) values ({0},{1},{2});";
                    StringBuilder sqlCollection = new StringBuilder();
                    foreach (DataRow row in RookiePresentConfig.Config.PropPresent.Rows)
                    {
                        int tmpcount = DbSession.Default.FromSql(select).AddInputParameter("@PropID", DbType.Int32, row["PropID"]).ToScalar<int>();
                        if (tmpcount <= 0)
                            continue;
                        sqlCollection.AppendFormat(sql, userId, row["PropID"].ToString(), row["Amount"].ToString());
                    }
                    if (sqlCollection.ToString().Length > 0)
                    {
                        DbSession.Default.FromSql(sqlCollection.ToString()).Execute();
                    }
                }
            }
            else
            {
                isaction = false;
                RookiePresentConfig.Config.IsEnable = false;
                RookiePresentConfig.Save(RookiePresentConfig.Config);
            }
            }*/
            #endregion

            //2012-12-16 ������������ȡ������ID�����������ڴ����������޸���
            string agencyName = UiCommon.StringConfig.GetAgencyNameByTwoDname(); //��ȡ������ȡ�������˺�

            int userId = Convert.ToInt32(member.Add_UserInfo(username, nickname, promoter, int.Parse(sex), dbLogoId, pwd, ejpwd, idcard, mobile, email, Common.RequestIP, qqNum, realname, agencyName)["UserID"]);
            if (userId > 0)
            {
                //5.�����û���Ϣ
                UiCommon.UserLoginInfo.SetInfo(userId.ToString(), username);

                //�����û���½��Ϣ
                new BLL.Member().UpdateLastLogin(username, Utility.Common.RequestIP);

                //6.��¼��ǰ�ͻ������ϵ�ע��ʱ�䵽cookies
                BCSTCache.Default.Save<CookiesCache>("RegDateTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                Response.Redirect("/Manage/Default.aspx");
            }
            //else if (userId == -3)
            //{
            //    CommonManager.Web.RegJs(this, "alert('��Ǹ��ע��ʧ�ܣ���IP����ע������������');location.href=location.href;", true);
            //}
            //else if (userId == -4)
            //{
            //    CommonManager.Web.RegJs(this, "alert('��Ǹ��ע��ʧ�ܣ������֤���Ѵﵽע��������ƣ�');location.href=location.href;", true);
            //}
            else
            {
                CommonManager.Web.RegJs(this, "alert('��Ǹ��ע��ʧ�ܣ������Ƿ�������æ�����Ժ����ԣ�');location.href=location.href;", true);
            }
        }
예제 #39
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminPopedom.IsHoldModel("04");

        string isTrader = ConfigurationManager.AppSettings["IsOpenTrader"];

        if (isTrader == "0")
        {
            trIsTrader.Visible = false;
        }
        if (UserID == 0)
        {
            CommonManager.Web.RegJs(this, "alert('参数错误。');", false);
            return;
        }

        if (IsPostBack)
        {
            return;
        }

        string sql = @"select *,DATEADD([second],viptime,'1970-1-1 8:00:00') AS VipTimes,(select isnull(Convert(bigint,sum(ChangeTax)),0) as tax from TChangeRecordUser where UserID=@UserID) as AllTax from TUsers a inner join TUserInfo b on b.UserID=a.UserID inner join Web_Users c on c.UserID=a.UserID where a.UserID=@UserID";

        DataTable dt = DbSession.Default.FromSql(sql).AddInputParameter("@UserID", DbType.Int32, UserID).ToDataTable();

        if (dt.Rows.Count <= 0)
        {
            CommonManager.Web.RegJs(this, "alert('参数错误。');", false);
            return;
        }

        DataRow row = dt.Rows[0];

        #region 填充页面表单
        if (row["LockMathine"].ToString() == "1")
        {
            lockLB.Visible = true;
            LockLabel.Text = "已锁定";
        }
        else
        {
            LockLabel.Text = "未锁定";
        }
        txtBankMoney.Text   = row["BankMoney"].ToString();
        txtFascination.Text = row["Fascination"].ToString();
        txtNickName.Text    = row["NickName"].ToString();
        //LiteralNickName.Text = row["NickName"].ToString();
        txtPwd_anw.Text = row["Pwd_anw"].ToString();
        ltPwd_ques.Text = row["Pwd_ques"].ToString();
        //txtUserNames.Text = row["UserName"].ToString();
        LiteralUserName.Text = row["UserName"].ToString();
        if (UiCommon.StringConfig.BankVersion == "1")
        {
            txtWalletMoney.Text = row["WalletMoney"].ToString();
        }
        else
        {
            txtWalletMoney.Text     = (new BLL.Member()).GetWalletMoney(UserID.ToString()).ToString();
            txtWalletMoney.ReadOnly = true;
        }
        txtZJ_Number.Text = row["ZJ_Number"].ToString();
        CommonManager.Web.SetListControlSelectedFromValue(ddlMaster, row["Master"].ToString());
        CommonManager.Web.SetListControlSelectedFromValue(ddlMember, row["Member"].ToString());
        CommonManager.Web.SetListControlSelectedFromValue(ddlUserType, row["UserType"].ToString());
        CommonManager.Web.SetListControlSelectedFromValue(ddlZJ_Type, row["ZJ_type"].ToString());
        CommonManager.Web.SetListControlSelectedFromValue(rdolDisabled, row["Disabled"].ToString());
        CommonManager.Web.SetListControlSelectedFromValue(rdolSex, row["Sex"].ToString());
        CommonManager.Web.SetListControlSelectedFromValue(rdoIsTrader, row["Trader"].ToString());
        ltSignDesc.Text = row["SignDescr"].ToString();
        ltAddress.Text  = row["Address"].ToString();
        ltTelNo.Text    = row["TelNo"].ToString();
        //ltAdrCity.Text = row["AdrCity"].ToString();
        //ltAdrProvince.Text = row["AdrProvince"].ToString();
        //ltAdrZone.Text = row["AdrZone"].ToString();
        ltAllLoginTime.Text   = row["AllLoginTime"].ToString();
        ltCurrentVIPTime.Text = row["VipTimes"].ToString();
        ltEmail.Text          = row["Email"].ToString();
        ltqqnum.Text          = row["qqnum"].ToString();
        //设置头像图片显示
        int Sex    = Convert.ToInt32(row["Sex"]);
        int LogoID = (int)row["LogoID"];
        LogoID = new BLL.Member().GetLogoID(Sex, LogoID);
        string UserHeadImg = "";
        if (LogoID >= BLL.Member.LogoId_Const1 && LogoID <= BLL.Member.LogoId_Const2)
        {
            if (row["Sex"].ToString() == "1")
            {
                UserHeadImg = "/Image/Users/b_" + LogoID + ".png";
            }
            else
            {
                UserHeadImg = "/Image/Users/g_" + LogoID + ".png";
            }
        }
        else if (LogoID >= BLL.Member.LogoId_Const3 && LogoID <= BLL.Member.LogoId_Const4)          //上传的自定义头像 256<=LogoID<=512
        {
            int childDirName = UserID / 1000;
            UserHeadImg = "/Upload/" + UiCommon.StringConfig.UserCustHeadFolderName + "/" + childDirName + "/" + UserID + ".png";
        }
        else if (LogoID > BLL.Member.LogoId_Const4)          //上传的自定义头像 LogoID>512  需审核或有过期时间的自定义头像
        {
            int childDirName = UserID / 1000;
            UserHeadImg = "/Upload/" + UiCommon.StringConfig.UserCustHeadFolderName + "/" + childDirName + "/" + UserID + ".png";
        }
        ltHeadImg.Text = "<img src='" + UserHeadImg + "' onerror='this.src=\"/images/NoPicture/no_pic.gif\";this.onerror=\"\";' />";

        ltLastLoginIP.Text = row["LastLoginIP"].ToString();
        ltLastLoginTM.Text = ((DateTime)row["LastLoginTM"]).ToString("yyyy-MM-dd HH:mm:ss");
        //ltOccuPation.Text = row["OccuPation"].ToString();
        ltPhoneNum.Text   = row["Phone"].ToString();
        ltRegisterIP.Text = row["RegisterIP"].ToString();
        ltRegisterTM.Text = ((DateTime)row["RegisterTM"]).ToString("yyyy-MM-dd HH:mm:ss");
        ltUserName.Text   = row["UserName"].ToString();
        userName          = row["UserName"].ToString();
        //ltWebLoginTime.Text = row["WebLoginTime"].ToString();

        ltSourcePwd.Text    = row["Pass"].ToString();
        ltSourceTwoPwd.Text = row["TwoPassword"].ToString();

        ltAllTax.Text        = row["AllTax"].ToString();
        txtUserRealName.Text = row["RealName"].ToString();
        txtLotteries.Text    = row["Lotteries"].ToString();
        if (row["Disabled"].ToString() == "1")
        {
            txtBankMoney.Enabled   = false;
            txtWalletMoney.Enabled = false;
            rdolVip.Enabled        = false;
            txtCustomVIP.Enabled   = false;
        }
        #endregion
    }
예제 #40
0
    public void BuyDaoJu()
    {
        string userId = UiCommon.UserLoginInfo.UserID;
        string propId = Common.SqlEncode(Common.GetStringOfUrl("id"));

        DataRow drDaoju = new BLL.DaoJu().GetInfo(propId);

        if (drDaoju != null)
        {
            int count = Common.GetIntOfUrl("count");

            int price    = Convert.ToInt32(drDaoju["Price"]);// Common.GetIntOfUrl("price");
            int vipPrice = Convert.ToInt32(drDaoju["VipPrice"]);

            //1.读取当前登录用户的信息,UserID,BankMoney,VipTime
            DataRow dr        = new BLL.Member().GetInfoInTUserInfo(userId);
            string  vipTime   = "1970-01-01 08:00:00";
            Int64   bankMoney = 0;
            if (dr != null)
            {
                //购买vip的公式:当前日期+购买天数*60*60*24
                vipTime   = dr["VipTime2"].ToString();
                bankMoney = Convert.ToInt64(dr["BankMoney"]);
            }

            //2.判断是否有足够的金币购买该道具
            int buyMoney = 0;
            if (DateTime.Now < Convert.ToDateTime(vipTime))
            {
                buyMoney = vipPrice * count;
            }
            else
            {
                buyMoney = price * count;
            }

            if (buyMoney < 0)//数据溢出
            {
                Response.Write("buysb");
                return;
            }

            if (bankMoney < buyMoney)
            {
                Response.Write("notmoney");
            }
            else
            {
                //3.金币足够,判断三种类型的道具:普通道具、1小时双倍积分卡、3小时双倍积分卡
                int doublePointTime = 0;
                if (propId.Trim() == "6")
                {
                    //1小时双倍积分卡
                    doublePointTime = count * 60 * 60;
                }
                else if (propId.Trim() == "7")
                {
                    //3小时双倍积分卡
                    doublePointTime = count * 60 * 60 * 3;
                }

                //4.提交数据
                int iRows = new BLL.Member().BuyDaoJu(userId, propId, count, buyMoney, doublePointTime);
                if (iRows > 0)
                {
                    Response.Write("buycg");
                }
                else
                {
                    Response.Write("buysb");
                }
            }
        }
        else
        {
            Response.Write("nodaoju");
        }
    }
예제 #41
0
        protected void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            string validcode = Common.GetStringOfForm("validcode");

            if (ValidCode.CurrentCode != validcode)
            {
                Label1.Text    = "温馨提示:验证码输入错误,请重新输入!";
                Label1.Visible = true;
                return;
            }

            string username = Common.FilterString(Common.GetStringOfForm("username"));
            //昵称可以输入任何字符,所以要对它进行HTML编码,防止恶意木马脚本字符串;过滤"'"为"''",避免SQL注入式攻击
            string nickname = Server.HtmlEncode(Common.GetStringOfForm("nickname").Replace("'", "''"));
            string sex      = Common.FilterString(Common.GetStringOfForm("sex"));
            string pwd      = Common.FilterString(Common.GetStringOfForm("pwd"));    //Common.FilterString( Common.GetStringOfForm( "hidPwd" ) );//
            string ejpwd    = "";                                                    //Common.FilterString( Common.GetStringOfForm( "hidPwd2" ) );//
            string email    = "";
            string mobile   = Common.FilterString(Common.GetStringOfForm("mobile")); //电话保存到TUserInfo表的PhoneNum列
            string promoter = Common.FilterString(Common.GetStringOfForm("promoter"));
            string logoid   = Common.FilterString(Common.GetStringOfForm("logoid"));
            string idcard   = Common.FilterString(Common.GetStringOfForm("idcard"));
            string signDsc  = Server.HtmlEncode(Common.GetStringOfForm("sign").Replace("'", "''"));
            string qqnum    = "";
            string realname = "";

            if (string.IsNullOrEmpty(sex) || !CommonManager.String.IsInteger(sex))
            {
                sex = "1";
            }

            if (string.IsNullOrEmpty(logoid) || !CommonManager.String.IsInteger(logoid))
            {
                logoid = "1";
            }

            //新增:注册时选择职业和地区
            //string occu = CommonManager.Web.RequestForm( "txtOccuPation", "" );
            //string prov = CommonManager.Web.RequestForm( "hidProvince", "" );
            //string city = CommonManager.Web.RequestForm( "hidCity", "" );
            //string address = Server.HtmlEncode( CommonManager.Web.RequestForm( "txtAddress", "" ) );
            //如果银行密码为空,就把它设为登录密码
            if (ejpwd.Trim().Length == 0)
            {
                ejpwd = pwd;
            }

            BLL.Member member   = new BLL.Member();
            int        dbLogoId = member.SetLogoID(int.Parse(sex), int.Parse(logoid));

            /*
             * string userId = Utility.SqlHelper.GetMaxID("UserID", "TUsers").ToString();
             *
             * //1.插入TUsers表
             *
             * member.Add2TUsers( userId, username, nickname, pwd, ejpwd, int.Parse( sex ), dbLogoId );
             *
             * //2.插入TUserInfo表
             * int walletMoney = BLL.Config.GoldCountOfReg();
             * BLL.Promotion promo = new BLL.Promotion();
             * bool isTg = false;
             * if( promoter.Trim().Length > 0 )
             * {
             *  if( member.ExistName( promoter ) && promo.ExistTGUser( promoter ) )
             *  {
             *      isTg = true;
             *      walletMoney += BLL.Config.GoldCountOfRegTG();
             *  }
             * }*/

            #region 增加判断是否在新手送礼包活动期间

            /*
             * bool isaction = false;
             * if (RookiePresentConfig.Config.IsEnable)
             * {
             * if (RookiePresentConfig.Config.BeginDate <= DateTime.Now && RookiePresentConfig.Config.EndDate >= DateTime.Now)
             * {
             *  isaction = true;
             *  //walletMoney += RookiePresentConfig.Config.Money;
             *  //赠送道具
             *  if (RookiePresentConfig.Config.PropPresent.Rows.Count > 0)
             *  {
             *      string select = "select Count(PropID) from TPropDefine where PropID=@PropID;";
             *      string sql = "insert into TUserProp (UserID,PropID,HoldCount) values ({0},{1},{2});";
             *      StringBuilder sqlCollection = new StringBuilder();
             *      foreach (DataRow row in RookiePresentConfig.Config.PropPresent.Rows)
             *      {
             *          int tmpcount = DbSession.Default.FromSql(select).AddInputParameter("@PropID", DbType.Int32, row["PropID"]).ToScalar<int>();
             *          if (tmpcount <= 0)
             *              continue;
             *          sqlCollection.AppendFormat(sql, userId, row["PropID"].ToString(), row["Amount"].ToString());
             *      }
             *      if (sqlCollection.ToString().Length > 0)
             *      {
             *          DbSession.Default.FromSql(sqlCollection.ToString()).Execute();
             *      }
             *  }
             * }
             * else
             * {
             *  isaction = false;
             *  RookiePresentConfig.Config.IsEnable = false;
             *  RookiePresentConfig.Save(RookiePresentConfig.Config);
             * }
             * }*/
            #endregion

            /*member.Add2TUserInfo(userId, walletMoney, Common.RequestIP);
             *  //修改为如下方法:
             *  //member.Add2TUserInfo( userId, walletMoney, Common.RequestIP, occu, prov, city, address, mobile );
             *
             *  //3.插入Web_Users表
             *  member.Add2Web_Users(userId, email, mobile, Common.RequestIP, idcard);
             *  //member.Add2Web_Users( userId, email, "", Common.RequestIP );
             *
             *  //4.插入推广日志信息
             *  if( isTg )
             *  {
             *          promo.AddLog( promoter, userId );
             *  }
             */
            string agencyName = UiCommon.StringConfig.GetAgencyNameByTwoDname();             //获取域名获取代理商账号
            int    userId     = Convert.ToInt32(member.Add_UserInfo(username, nickname, promoter, int.Parse(sex), dbLogoId, pwd, ejpwd, idcard, mobile, email, Common.RequestIP, qqnum, realname, agencyName, signDsc)["UserID"]);
            if (userId > 0)
            {
                //5.保存用户信息
                UiCommon.UserLoginInfo.SetInfo(userId.ToString(), username);


                //更新用户登陆信息
                new BLL.Member().UpdateLastLogin(username, Utility.Common.RequestIP);

                //6.记录当前客户机器上的注册时间到cookies
                BCSTCache.Default.Save <CookiesCache>("RegDateTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));


                //Limit.outMsgBox("温馨提示:\\n\\n会员注册成功!", "bzwp://regsucceed?username="******"", true);


                //Response.Write("<script language=javascript>window.alert('" + Message + "');" + str + "</script>");

                string ieEvent = "bzwp://regsucceed?username="******"&userid=" + userId;
                Response.Write("<script language=javascript>window.location.href='" + ieEvent + "';</script>");
            }
            else
            {
                Label1.Text = "抱歉,注册失败,可能是服务器繁忙,请稍后再试!";
                return;
            }

            /*
             * if (isaction)
             * {
             *  Response.Write("<script language=javascript>alert('现在是活动期间,您获得系统赠送给您的道具!\\r\\n快到游戏的道具箱中去体验我们的道具吧!');window.location.href='" + ieEvent + "';</script>");
             * }
             * else
             * {
             *  Response.Write("<script language=javascript>window.location.href='" + ieEvent + "';</script>");
             * }
             */
        }
예제 #42
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string UserId =Utility.Common.GetStringOfUrl( Request["P_UserId"]);
            string OrderId = Utility.Common.GetStringOfUrl(Request["P_OrderId"]);
            string CardId = Utility.Common.GetStringOfUrl(Request["P_CardId"]);
            string CardPass = Utility.Common.GetStringOfUrl(Request["P_CardPass"]);
            string FaceValue = Utility.Common.GetStringOfUrl(Request["P_FaceValue"]);
            string ChannelId = Utility.Common.GetStringOfUrl(Request["P_ChannelId"]);

            string subject = Utility.Common.GetStringOfUrl(Request["P_Subject"]);
            string description = Utility.Common.GetStringOfUrl(Request["P_Description"]);
            string price = Utility.Common.GetStringOfUrl(Request["P_Price"]);
            string quantity = Utility.Common.GetStringOfUrl(Request["P_Quantity"]);
            string notic = Utility.Common.GetStringOfUrl(Request["P_Notic"]);
            string ErrCode = Utility.Common.GetStringOfUrl(Request["P_ErrCode"]);
            string PostKey = Utility.Common.GetStringOfUrl(Request["P_PostKey"]);
            string payMoney = Utility.Common.GetStringOfUrl(Request["P_PayMoney"]);

            string SalfStr =UiCommon.StringConfig.KFPayKey;
            string preEncodeStr = UserId + "|" + OrderId + "|" + CardId + "|" + CardPass + "|" + FaceValue + "|" + ChannelId + "|" + SalfStr;

            string encodeStr = Utility.Common.md5(preEncodeStr);

              //   Response.Write(preEncodeStr + "<br>" + encodeStr+"<br>");//调试语句

             Response.Write("errCode=0");
             //string FilePath = Server.MapPath("/test/weather.txt");
             //if (!File.Exists(FilePath))
             //{
             //    FileStream fs = File.Create(FilePath);
             //    fs.Close();
             //}
             ////写入文本
             //StreamWriter sr = new StreamWriter(Server.MapPath("/test/weather.txt"), false, System.Text.Encoding.Default);
             //try
             //{
             //    string str = "P_UserId:" + UserId + "P_OrderId:" + OrderId + "P_CardId:"
             //        + CardId + "P_CardPass:"******"P_FaceValue:" + FaceValue
             //        + "P_ChannelId:" + ChannelId + "P_Subject:" + subject
             //        + "P_Description:" + description + "P_Price:" + price
             //        + "P_ErrCode:" + ErrCode + "P_PostKey:" + PostKey
             //        + "P_PayMoney:" + payMoney;
             //    sr.Write(str+"<br/>"+preEncodeStr + "<br/>" + encodeStr + "<br/>");
             //    sr.Close();

             //}
             //catch
             //{

             //}
            if (PostKey.ToUpper().CompareTo(encodeStr.ToUpper()) == 0)//表示数据合法
            {

                if (int.Parse(ErrCode) == 0)//说明是充值成功了的
                {
                    //这里进行订单更新
                    Member mem = new Member();
                    if (!mem.IsPaySuccess(OrderId))
                    {
                        mem.Update3PayOrder((int)(float.Parse(FaceValue)), OrderId);
                    }

                }
                else
                {
                 //   Response.Write("-Err");
                }
            }
            else
            {

               // Response.Write("-数据不合法");
            }
        }
예제 #43
0
        private void LoadRooms()
        {
            Member member = new Member();
            member.GetMemberByUserId(new Guid(Membership.GetUser().ProviderUserKey.ToString()));
            Room myrooms = new Room();
            myrooms.GetRoomsByCreatorID(member.MemberID);

            uiRepeaterMyRooms.DataSource = myrooms.DefaultView;
            uiRepeaterMyRooms.DataBind();
        }
예제 #44
0
        protected void Page_Load(object sender, EventArgs e)
        {
            String key = UiCommon.StringConfig.JFTpay_MemberKey; //配置文件密钥

            //返回参数
            String orderid = Request.QueryString["orderid"];//返回订单号
            String opstate = Request.QueryString["opstate"];//返回处理结果
            String ovalue = Request.QueryString["ovalue"];//返回充值金额
            String sign = Request.QueryString["sign"];//返回加密标记
            String Reply = Request.QueryString["Reply"];//同步发送:1代表同步发送,2代表异步发送
            String kaorderID = Request.QueryString["ekaorderid"];
            String time = Request.QueryString["ekatime"];//亿卡处理时间。

            //组织参数
            String param = String.Format("orderid={0}&opstate={1}&ovalue={2}{3}", orderid, opstate, ovalue, key);

            //比对参数是否有效
            if (sign.Equals(FormsAuthentication.HashPasswordForStoringInConfigFile(param, "MD5").ToLower()))
            {
                //执行操作方法
                if (opstate.Equals("0"))
                {
                    #region [add] jeffery

                    //if (Session["CouponInfo"] != null)
                    //{
                    //    string strCouponInfo = Session["CouponInfo"].ToString();
                    //    Session["CouponInfo"] = ""; // 用完后销毁
                    //    if (strCouponInfo != "")
                    //    {
                    //        int pos = strCouponInfo.IndexOf("!@#");
                    //        string username = strCouponInfo.Substring(0, pos);
                    //        int couponNum = Convert.ToInt32(
                    //            strCouponInfo.Substring(pos + 1)
                    //            );

                    //        string strsql =
                    //            "select UserID from TUsers where UserName=@username";
                    //        DataTable dt =
                    //            SqlHelper.ExecuteDataset(CommandType.Text,
                    //            strsql,
                    //            new SqlParameter[]
                    //            {
                    //                new SqlParameter("@username",username)
                    //            }
                    //            ).Tables[0];

                    //        if (dt.Rows.Count > 0)
                    //        {
                    //            int userid = Convert.ToInt32(dt.Rows[0]["UserID"]);

                    //            strsql = "insert into TCoupon(UserID,CouponNum,RechargeType,CreateTime)values(@userid,@coupon,@rechargeType,@createTime)";

                    //            int num =
                    //            SqlHelper.ExecuteNonQuery(CommandType.Text,strsql,
                    //                                new SqlParameter[]
                    //                                {
                    //                                    new SqlParameter("@userid",userid),
                    //                                    new SqlParameter("@coupon",couponNum),
                    //                                    new SqlParameter("@rechargeType",6),
                    //                                    new SqlParameter("@createTime",DateTime.Now)
                    //                                });

                    //            if (num != 1)
                    //            {
                    //                Response.Write("<script>alert('充值成功,但赠送奖劵失败!')</script>");
                    //            }
                    //        }

                    //    }
                    //}
                    #endregion

                    Member mem = new Member();

                    if (Reply == "1")
                    {
                        Response.Write("opstate=0");

                        //操作流程成功的情况
                        //注:不能打印其他的字符,否则不会同步
                        if (!mem.IsPaySuccess(orderid)) //防止重复刷新页面而带来的问题
                        {

                            //更新订单信息为完成状态
                            if (orderid.ToLower().Contains("ka"))
                                mem.Update3PayOrder2((int)(float.Parse(ovalue)), orderid);
                            else
                                mem.Update3PayOrder((int)(float.Parse(ovalue)), orderid);

                        }

                    }
                    else if (Reply == "2")
                    {

                        //防止重复刷新页面而带来的问题
                        if (!mem.IsPaySuccess(orderid))
                        {
                            if (orderid.ToLower().Contains("ka"))
                                mem.Update3PayOrder2((int)(float.Parse(ovalue)), orderid);
                            else
                                mem.Update3PayOrder((int)(float.Parse(ovalue)), orderid);

                        }
                        //返回到成功页面
                        Response.Redirect("NotityReceive.aspx?orderid=" + orderid + "&opstate=" + opstate);

                    }

                }
                if (opstate.Equals("-1"))
                {
                    //请求参数无效
                    Response.Write("请求参数无效");
                }
                if (opstate.Equals("-2"))
                {
                    //交易签名无效
                    Response.Write("签名错误");
                }
            }
        }
예제 #45
0
 public int Update(Member member)
 {
     return(memberDal.Update(member));
 }
예제 #46
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string billno = Utility.Common.GetStringOfUrl("billno"); //订单编号

            string amount = Utility.Common.GetStringOfUrl("amount");  //订单金额

            string date = Utility.Common.GetStringOfUrl("date"); //订单日期

            string succ = Utility.Common.GetStringOfUrl("succ"); //成功标志

            string ipsbillno = Utility.Common.GetStringOfUrl("ipsbillno"); //IPS订单编号

            string currency_Type = Utility.Common.GetStringOfUrl("Currency_type");  //币种

            string signature = Utility.Common.GetStringOfUrl("signature").ToLower(); //MD5签名

            string retencodetype = Utility.Common.GetStringOfUrl("retencodetype");//交易返回签名方式

            // [add] jeffery
            //string strAttach = Utility.Common.GetStringOfUrl("attach");
            // ---end

            if (string.IsNullOrEmpty(billno) || string.IsNullOrEmpty(amount) || string.IsNullOrEmpty(date) ||
                string.IsNullOrEmpty(succ) || string.IsNullOrEmpty(ipsbillno) || string.IsNullOrEmpty(currency_Type) || string.IsNullOrEmpty(signature))
            {
                Server.Transfer("Default.aspx");
            }

            PayOrderID = billno;

            PayMoney = amount;

            if (succ.Equals("Y"))
            {
                //交易成功
                PayResult = "恭喜您,充值成功!";
                if (currency_Type == null || currency_Type == "")
                {
                    currency_Type = "RMB";
                }
                string signatureVal = Utility.Common.md5("billno" + billno + "currencytype" + currency_Type + "amount" + amount + "date" + date + "succ" + succ + "ipsbillno" + ipsbillno + "retencodetype" + retencodetype + UiCommon.StringConfig.IPS_Letter).ToLower();

                if (signature.Equals(signatureVal.ToLower()))
                {
                    Member mem = new Member();
                    if (!mem.IsPaySuccess(billno))
                    {
                        mem.Update3PayOrder((int)(float.Parse(PayMoney)), PayOrderID);
                    }

                    #region [add] jeffery

                    //int pos = strAttach.IndexOf("!@#");
                    //string username = strAttach.Substring(0, pos);
                    //int couponNum =
                    //    Convert.ToInt32(
                    //    strAttach.Substring(pos + 1)
                    //    );
                    //string strsql =
                    //    "select UserID from TUsers where UserName=@username";

                    //DataTable dt =
                    //    SqlHelper.ExecuteDataset(CommandType.Text,
                    //    strsql,
                    //    new SqlParameter[]
                    //            {
                    //                new SqlParameter("@username",username)
                    //            }
                    //    ).Tables[0];

                    //int userid = Convert.ToInt32(dt.Rows[0]["UserID"]);

                    //strsql = "insert into TCoupon(UserID,CouponNum,RechargeType,CreateTime)values(@userid,@coupon,@rechargeType,@createTime)";
                    //int num =
                    //    SqlHelper.ExecuteNonQuery
                    //    (CommandType.Text,
                    //    strsql,
                    //    new SqlParameter[]
                    //            {
                    //                new SqlParameter("@userid",userid),
                    //                new SqlParameter("@coupon",couponNum),
                    //                new SqlParameter("@rechargeType",2),
                    //                new SqlParameter("@createTime",DateTime.Now)
                    //            });

                    //if (num != 1)
                    //{
                    //    Response.Write("<script>alert('充值成功,但赠送奖劵失败!')</script>");
                    //}

                    #endregion
                }
                else
                {
                    PayResult = "充值失败,请不要恶意删改数据";
                }

            }
            else
            {
                //交易失败
                PayResult = "充值失败,请稍后再试!";
            }
        }
예제 #47
0
        protected void uiLinkButtonConfirm_Click(object sender, EventArgs e)
        {
            MembershipUser user = Membership.GetUser();
            if (user.PasswordQuestion == uiDropDownListQuestion.SelectedValue && BLL.Member.CurrentMember.Answer == uiTextBoxAnswer.Text.Trim())
            {
                if (!String.IsNullOrEmpty(hdnMember.Value))
                {
                    Member upgrademember = new Member();
                    upgrademember.LoadByPrimaryKey(Convert.ToInt32(hdnMember.Value));

                    try
                    {
                        int durationID = Convert.ToInt32(hdnDuration.Value);
                        int specID = Convert.ToInt32(hdnSpec.Value);
                        BLL.MemberTypeSpecDuration bllMemberTypeSpecDuration = new MemberTypeSpecDuration();
                        bllMemberTypeSpecDuration.Where.TypeDurationID.Value = durationID;
                        bllMemberTypeSpecDuration.Where.MemberTypeSpecID.Value = specID;
                        bllMemberTypeSpecDuration.Query.Load();
                        int points = bllMemberTypeSpecDuration.Points;

                        if (BLL.Member.CurrentMember.Credit_Point < points)
                        {
                            Page.ClientScript.RegisterStartupScript(this.GetType(), "Error3", @"$(document).ready(function () { notify('error', 'حدث خطأ . رصيدك الحالى لا يسمح لإتمام العملية.'); });", true);
                            return;
                        }

                        BLL.Member.CurrentMember.Credit_Point -= points;
                        BLL.Member.CurrentMember.Save();

                        //delete old records
                        BLL.MemberType bllMemberType = new MemberType();
                        bllMemberType.DeleteMemberTypes(upgrademember.MemberID);

                        upgrademember.MemberType.MemberTypeSpecDurationID = bllMemberTypeSpecDuration.ID;
                        upgrademember.MemberType.CreateBy = BLL.Member.CurrentMember.MemberID;
                        upgrademember.MemberType.StartDate = DateTime.Now;
                        upgrademember.MemberType.EndDate = DateTime.Now.AddMonths(bllMemberTypeSpecDuration.TypeDuration.MonthesNumber);
                        upgrademember.MemberType.Save();

                        Page.ClientScript.RegisterStartupScript(this.GetType(), "Success1", @"$(document).ready(function () { notify('success', 'تم ترقية الإسم بنجاح.'); });", true);

                        BLL.MemberLog log = new BLL.MemberLog();
                        log.AddNew(BLL.Member.CurrentMemberID, new BLL.Log.ChangeMemberType() { MemberName = upgrademember.Name, NewTypeName = upgrademember.MemberType.MemberTypeSpecDuration.MemberTypeSpec.Name, NewTypeExpiryDate = upgrademember.MemberType.EndDate, Points = points }, upgrademember.MemberID, null);

                        lblPoints.Text = BLL.Member.CurrentMember.Credit_Point.ToString();

                        NotifyMember(upgrademember.MemberID, bllMemberTypeSpecDuration.MemberTypeSpecID);

                        LoadBalance();
                    }
                    catch (Exception ex)
                    {
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "Error11", @"$(document).ready(function () { notify('error', 'حدث خطأ . من فضلك أعد المحاولة.'); });", true);
                    }
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Error4", @"$(document).ready(function () { notify('error', 'حدث خطأ . من فضلك أعد المحاولة.'); });", true);
                }
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Error5", @"$(document).ready(function () { notify('error', 'حدث خطأ . من فضلك تأكد من السؤال والإجابة السرى.'); });", true);
                return;
            }
        }
예제 #48
0
        protected void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            string validcode = Common.GetStringOfForm("validcode");
            if (ValidCode.CurrentCode != validcode)
            {
                Label1.Text = "��ܰ��ʾ����֤������������������룡";
                Label1.Visible = true;
                return;
            }

            string username = Common.FilterString(Common.GetStringOfForm("username"));
            //�dzƿ��������κ��ַ�������Ҫ��������HTML���룬��ֹ����ľ��ű��ַ���������"'"Ϊ"''"������SQLע��ʽ����
            string nickname = Server.HtmlEncode(Common.GetStringOfForm("nickname").Replace("'", "''"));
            string sex = Common.FilterString(Common.GetStringOfForm("sex"));
            string pwd = Common.FilterString(Common.GetStringOfForm("pwd"));//Common.FilterString( Common.GetStringOfForm( "hidPwd" ) );//
            string ejpwd ="";//Common.FilterString( Common.GetStringOfForm( "hidPwd2" ) );//
            string email ="";
            string mobile = Common.FilterString(Common.GetStringOfForm("mobile"));//�绰���浽TUserInfo���PhoneNum��
            string promoter = Common.FilterString(Common.GetStringOfForm("promoter"));
            string logoid = Common.FilterString(Common.GetStringOfForm("logoid"));
            string idcard = Common.FilterString(Common.GetStringOfForm("idcard"));
            string signDsc = Server.HtmlEncode(Common.GetStringOfForm("sign").Replace("'", "''"));
            string qqnum = "";
            string realname ="";
            if (string.IsNullOrEmpty(sex) || !CommonManager.String.IsInteger(sex))
                sex = "1";

            if (string.IsNullOrEmpty(logoid) || !CommonManager.String.IsInteger(logoid))
                logoid = "1";

            //������ע��ʱѡ��ְҵ�͵���
            //string occu = CommonManager.Web.RequestForm( "txtOccuPation", "" );
            //string prov = CommonManager.Web.RequestForm( "hidProvince", "" );
            //string city = CommonManager.Web.RequestForm( "hidCity", "" );
            //string address = Server.HtmlEncode( CommonManager.Web.RequestForm( "txtAddress", "" ) );
            //�����������Ϊ�գ��Ͱ�����Ϊ��¼����
            if (ejpwd.Trim().Length == 0)
            {
                ejpwd = pwd;
            }

            BLL.Member member = new BLL.Member();
            int dbLogoId = member.SetLogoID(int.Parse(sex), int.Parse(logoid));
            /*
            string userId = Utility.SqlHelper.GetMaxID("UserID", "TUsers").ToString();

            //1.����TUsers��

            member.Add2TUsers( userId, username, nickname, pwd, ejpwd, int.Parse( sex ), dbLogoId );

            //2.����TUserInfo��
            int walletMoney = BLL.Config.GoldCountOfReg();
            BLL.Promotion promo = new BLL.Promotion();
            bool isTg = false;
            if( promoter.Trim().Length > 0 )
            {
                if( member.ExistName( promoter ) && promo.ExistTGUser( promoter ) )
                {
                    isTg = true;
                    walletMoney += BLL.Config.GoldCountOfRegTG();
                }
            }*/

            #region �����ж��Ƿ��������������ڼ�
            /*
            bool isaction = false;
            if (RookiePresentConfig.Config.IsEnable)
            {
            if (RookiePresentConfig.Config.BeginDate <= DateTime.Now && RookiePresentConfig.Config.EndDate >= DateTime.Now)
            {
                isaction = true;
                //walletMoney += RookiePresentConfig.Config.Money;
                //���͵���
                if (RookiePresentConfig.Config.PropPresent.Rows.Count > 0)
                {
                    string select = "select Count(PropID) from TPropDefine where PropID=@PropID;";
                    string sql = "insert into TUserProp (UserID,PropID,HoldCount) values ({0},{1},{2});";
                    StringBuilder sqlCollection = new StringBuilder();
                    foreach (DataRow row in RookiePresentConfig.Config.PropPresent.Rows)
                    {
                        int tmpcount = DbSession.Default.FromSql(select).AddInputParameter("@PropID", DbType.Int32, row["PropID"]).ToScalar<int>();
                        if (tmpcount <= 0)
                            continue;
                        sqlCollection.AppendFormat(sql, userId, row["PropID"].ToString(), row["Amount"].ToString());
                    }
                    if (sqlCollection.ToString().Length > 0)
                    {
                        DbSession.Default.FromSql(sqlCollection.ToString()).Execute();
                    }
                }
            }
            else
            {
                isaction = false;
                RookiePresentConfig.Config.IsEnable = false;
                RookiePresentConfig.Save(RookiePresentConfig.Config);
            }
            }*/
            #endregion

            /*member.Add2TUserInfo(userId, walletMoney, Common.RequestIP);
            //�޸�Ϊ���·�����
            //member.Add2TUserInfo( userId, walletMoney, Common.RequestIP, occu, prov, city, address, mobile );

            //3.����Web_Users��
            member.Add2Web_Users(userId, email, mobile, Common.RequestIP, idcard);
            //member.Add2Web_Users( userId, email, "", Common.RequestIP );

            //4.�����ƹ���־��Ϣ
            if( isTg )
            {
            promo.AddLog( promoter, userId );
            }
            */
            string agencyName = UiCommon.StringConfig.GetAgencyNameByTwoDname(); //��ȡ������ȡ�������˺�
            int userId =Convert.ToInt32(member.Add_UserInfo(username, nickname, promoter, int.Parse(sex), dbLogoId, pwd, ejpwd, idcard, mobile, email, Common.RequestIP, qqnum, realname,agencyName,signDsc)["UserID"]);
            if (userId > 0)
            {
                //5.�����û���Ϣ
                UiCommon.UserLoginInfo.SetInfo(userId.ToString(), username);

                //�����û���½��Ϣ
                new BLL.Member().UpdateLastLogin(username, Utility.Common.RequestIP);

                //6.��¼��ǰ�ͻ������ϵ�ע��ʱ�䵽cookies
                BCSTCache.Default.Save<CookiesCache>("RegDateTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

                //Limit.outMsgBox("��ܰ��ʾ��\\n\\n��Աע��ɹ���", "bzwp://regsucceed?username="******"", true);

                //Response.Write("<script language=javascript>window.alert('" + Message + "');" + str + "</script>");

                string ieEvent = "bzwp://regsucceed?username="******"&userid=" + userId;
                Response.Write("<script language=javascript>window.location.href='" + ieEvent + "';</script>");
            }
            else
            {
                Label1.Text = "��Ǹ��ע��ʧ�ܣ������Ƿ�������æ�����Ժ����ԣ�";
                return;
            }
            /*
            if (isaction)
            {
                Response.Write("<script language=javascript>alert('�����ǻ�ڼ䣬�����ϵͳ���͸����ĵ��ߣ�\\r\\n�쵽��Ϸ�ĵ�������ȥ�������ǵĵ��߰ɣ�');window.location.href='" + ieEvent + "';</script>");
            }
            else
            {
                Response.Write("<script language=javascript>window.location.href='" + ieEvent + "';</script>");
            }
            */
        }
예제 #49
0
    protected void Edit_Users(object sender, EventArgs e)
    {
        if (!CommonManager.Web.CheckPostSource())
        {
            return;
        }

        if (UserID == 0)
        {
            return;
        }
        DataRow row = new BLL.Member().GetInfo(UserID.ToString());

        if (row == null)
        {
            return;
        }

        using (DbTrans trans = DbSession.Default.BeginTrans())
        {
            try
            {
                #region 对TUsers表的修改
                if (txtNickName.Text.Trim() == "")
                {
                    CommonManager.Web.RegJs(this, "alert('昵称不能为空!');location.href=location.href;", false);
                    return;
                }
                string        nickName = txtNickName.Text.Trim();
                StringBuilder sql      = new StringBuilder("update TUsers set ");
                sql.Append(" Sex=@Sex,");
                sql.Append(" Disabled=@Disabled,");
                sql.Append(" NickName=@NickName ");
                if (!string.IsNullOrEmpty(txtPassWord.Text.Trim()))
                {
                    sql.Append(" ,Pass=@Password");
                }
                if (!string.IsNullOrEmpty(txtTwoPassWord.Text.Trim()))
                {
                    sql.Append(" ,TwoPassword=@TwoPassword");
                }
                sql.Append(" where UserID=@UserID;");

                SqlSection sect = trans.FromSql(sql.ToString())
                                  .AddInputParameter("@Sex", DbType.Int16, rdolSex.SelectedItem.Value)
                                  .AddInputParameter("@Disabled", DbType.Int32, rdolDisabled.SelectedItem.Value)
                                  .AddInputParameter("@UserID", DbType.Int32, UserID)
                                  .AddInputParameter("@NickName", DbType.Int32, nickName);


                if (!string.IsNullOrEmpty(txtPassWord.Text.Trim()))
                {
                    sect.AddInputParameter("@Password", DbType.String, Utility.Common.md5(txtPassWord.Text.Trim()) /*CommonManager.String.EncryptMD5SystemDefaultMethod(txtPassWord.Text.Trim(),false,true)*/);
                }

                if (!string.IsNullOrEmpty(txtTwoPassWord.Text.Trim()))
                {
                    sect.AddInputParameter("@TwoPassword", DbType.String, Utility.Common.md5(txtTwoPassWord.Text.Trim()) /*CommonManager.String.EncryptMD5SystemDefaultMethod( txtTwoPassWord.Text.Trim(), false, true )*/);
                }

                sect.Execute();
                #endregion

                #region 判断是否需要修改TMatchTable
                if (row["Master"].ToString() != ddlMaster.SelectedItem.Value)
                {
                    sql = new StringBuilder();
                    if (ddlMaster.SelectedItem.Value == "3")
                    {
                        sql.Append("update TMatchTable set MasterPower=268435455 where UserID=@UserID;");
                    }
                    else if (ddlMaster.SelectedItem.Value == "0")
                    {
                        sql.Append("update TMatchTable set MasterPower=0 where UserID=@UserID;");
                    }
                    trans.FromSql(sql.ToString()).AddInputParameter("@UserID", DbType.Int32, UserID).Execute();
                }
                #endregion

                #region 计算VIP时间
                int addvip = (int)row["VipTime"];                //得到原来的时间,秒数

                if (rdolVip.SelectedIndex != -1 || (!string.IsNullOrEmpty(txtCustomVIP.Text.Trim())))
                {
                    int tmp = 0;
                    if (rdolVip.SelectedIndex != -1)                     //预设值优先
                    {
                        tmp = int.Parse(rdolVip.SelectedItem.Value);
                    }
                    else
                    {
                        if (!CommonManager.String.IsInteger(txtCustomVIP.Text.Trim()))
                        {
                            CommonManager.Web.RegJs(this, "alert('自定义天数必须为数字!');location.href=location.href;", false);
                            return;
                        }
                        tmp = (int.Parse(txtCustomVIP.Text.Trim()) * 24 * 3600);
                    }

                    //如果不是取消vip,则补齐时间差
                    if (tmp > 0)
                    {
                        DateTime curVIP = (DateTime)row["VipTime2"];                        //得到原来时间的DateTime格式
                        if (curVIP == new DateTime(1970, 1, 1, 8, 0, 0))
                        {
                            //从未设置过vip时间,则用当前时间与初始时间的时间差加上要增加的时间。
                            addvip = (int)(DateTime.Now - new DateTime(1970, 1, 1, 8, 0, 0)).TotalSeconds + tmp;
                        }
                        else if (curVIP < DateTime.Now)
                        {
                            //有过vip,但已到期,则补齐时间差
                            addvip += (int)(DateTime.Now - curVIP).TotalSeconds + tmp;
                        }
                        else
                        {
                            //有vip,且未到期,则在原来基础上增加
                            addvip += tmp;
                        }
                    }
                    else
                    {
                        //取消vip
                        addvip = 0;
                    }
                }
                #endregion

                Int64 mon;
                Int64 bmon;

                #region 判断是否需要插入金币修改表
                if (!Int64.TryParse(txtWalletMoney.Text.Trim(), out mon))
                {
                    CommonManager.Web.RegJs(this, "alert('钱包金币数必须为数字,或超出整数范围');location.href=location.href;", false);
                    return;
                }
                if (!Int64.TryParse(txtBankMoney.Text.Trim(), out bmon))
                {
                    CommonManager.Web.RegJs(this, "alert('银行金币数必须为数字,或超出整数范围');location.href=location.href;", false);
                    return;
                }
                if (!CommonManager.String.IsInteger(txtFascination.Text.Trim()))
                {
                    CommonManager.Web.RegJs(this, "alert('魅力数必须为数字!');location.href=location.href;", false);
                    return;
                }
                string newWM = string.IsNullOrEmpty(txtWalletMoney.Text.Trim()) ? "0" : txtWalletMoney.Text.Trim();
                string newBM = string.IsNullOrEmpty(txtBankMoney.Text.Trim()) ? "0" : txtBankMoney.Text.Trim();

                #region Old code

                /*
                 * if( row["WalletMoney"].ToString() != newWM )
                 * {
                 *      sql = new StringBuilder();
                 *      sql.Append( "insert into Web_MoneyChangeLog (userid,username,frontmoney,aftermoney,changetype,addtime,adduser)" );
                 *      sql.Append( " values (@UserID,@UserName,@OldWalletMoney,@WalletMoney,0,getdate(),@AdminName);" );
                 *
                 *      trans.FromSql( sql.ToString() )
                 *                      .AddInputParameter( "@UserID", DbType.Int32, UserID )
                 *                      .AddInputParameter( "@UserName", DbType.String, row["UserName"].ToString() )
                 * .AddInputParameter("@OldWalletMoney", DbType.Int32, row["WalletMoney"])
                 * .AddInputParameter("@WalletMoney", DbType.Int32, newWM)
                 *                      .AddInputParameter( "@AdminName", DbType.Int16, AdminInfo["UserName"].ToString() )
                 *                      .Execute();
                 *      //int dvalue = int.Parse( newWM ) - (int)row["WalletMoney"];
                 *      //if( dvalue > 0 )
                 *      //{
                 *      //    MoneyOperator.Default.Add_Web_Record_MoneyIncrease( dvalue, Session["AdminName"].ToString() + "管理员手动给玩家" + row["UserName"].ToString() + "添加钱包金币" );
                 *      //}
                 *      //else
                 *      //{
                 *      //    MoneyOperator.Default.Add_Web_Record_MoneyDecrease( Math.Abs( dvalue ), Session["AdminName"].ToString() + "管理员手动减去玩家" + row["UserName"].ToString() + "钱包金币" );
                 *      //}
                 * }
                 * if( row["BankMoney"].ToString() != newBM )
                 * {
                 *      sql = new StringBuilder();
                 *      sql.Append( "insert into Web_MoneyChangeLog (userid,username,frontmoney,aftermoney,changetype,addtime,adduser)" );
                 *      sql.Append( " values (@UserID,@UserName,@OldBankMoney,@BankMoney,0,getdate(),@AdminName);" );
                 *
                 *      trans.FromSql( sql.ToString() )
                 *                      .AddInputParameter( "@UserID", DbType.Int32, UserID )
                 *                      .AddInputParameter( "@UserName", DbType.String, row["UserName"].ToString() )
                 * .AddInputParameter("@OldBankMoney", DbType.Int32, row["WalletMoney"])
                 * .AddInputParameter("@BankMoney", DbType.Int32, newBM)
                 *                      .AddInputParameter( "@AdminName", DbType.Int16, AdminInfo["UserName"].ToString() )
                 *                      .Execute();
                 *
                 *      //int dvalue = int.Parse( newBM ) - (int)row["BankMoney"];
                 *      //if( dvalue > 0 )
                 *      //{
                 *      //    MoneyOperator.Default.Add_Web_Record_MoneyIncrease( dvalue, Session["AdminName"].ToString() + "管理员手动给玩家" + row["UserName"].ToString() + "添加银行金币" );
                 *      //}
                 *      //else
                 *      //{
                 *      //    MoneyOperator.Default.Add_Web_Record_MoneyDecrease( Math.Abs( dvalue ), Session["AdminName"].ToString() + "管理员手动减去玩家" + row["UserName"].ToString() + "银行金币" );
                 *      //}
                 *
                 * }
                 */
                #endregion

                if (row["WalletMoney"].ToString() != newWM || row["BankMoney"].ToString() != newBM)                     //如果修改金币,则插入金币变化日志
                {
                    Int64  startMoney  = Convert.ToInt64(row["WalletMoney"]) + Convert.ToInt64(row["BankMoney"]);
                    Int64  changeMoney = (Convert.ToInt64(newWM) + Convert.ToInt64(newBM)) - startMoney;
                    string remark      = ChineseMessage.adminManageNameMessage + AdminUserName + " " + ChineseMessage.adminManageIdMessage + AdminUserID;
                    BLL.Member.WriteMoneyExChangeLog(UserID.ToString(), startMoney, changeMoney, (int)Library.MoneyChangeType.管理员修改金币, remark);
                }

                #endregion

                #region 对TUserInfo表的修改
                sql = new StringBuilder();
                sql.Append("update TUserInfo set ");
                sql.Append(" Member=@Member,");
                sql.Append(" Master=@Master,");
                sql.Append(" WalletMoney=@WalletMoney,");
                sql.Append(" BankMoney=@BankMoney,");
                sql.Append(" Fascination=@Fascination,");
                sql.Append(" Viptime=@Viptime,");
                sql.Append(" UserType=@UserType,");
                sql.Append(" Trader=@Trader");
                sql.Append(" where UserID=@UserID;");
                trans.FromSql(sql.ToString())
                .AddInputParameter("@Member", DbType.Int32, ddlMember.SelectedItem.Value)
                .AddInputParameter("@Master", DbType.Int32, ddlMaster.SelectedItem.Value)
                .AddInputParameter("@WalletMoney", DbType.Int32, newWM)
                .AddInputParameter("@BankMoney", DbType.Int32, newBM)
                .AddInputParameter("@Fascination", DbType.Int32, string.IsNullOrEmpty(txtFascination.Text.Trim()) ? "0" : txtFascination.Text.Trim())
                .AddInputParameter("@UserType", DbType.Int32, ddlUserType.SelectedItem.Value)
                .AddInputParameter("@Viptime", DbType.Int32, addvip)
                .AddInputParameter("@Trader", DbType.Int32, rdoIsTrader.SelectedValue)
                .AddInputParameter("@UserID", DbType.Int32, UserID)
                .Execute();
                #endregion

                #region 对Web_Users表的修改
                if (!CommonManager.String.IsInteger(txtLotteries.Text.Trim()))
                {
                    CommonManager.Web.RegJs(this, "alert('" + UiCommon.StringConfig.GoldName + "数必须为数字!');location.href=location.href;", false);
                    return;
                }
                sql = new StringBuilder();
                sql.Append("update Web_Users set ");
                sql.Append(" Pwd_anw=@Pwd_anw,");
                //sql.Append( " Pwd_ques=@Pwd_ques," );
                sql.Append(" ZJ_type=@ZJ_type,");
                sql.Append(" ZJ_Number=@ZJ_Number,");
                sql.Append("RealName=@RealName,");
                sql.Append(" Lotteries=@Lotteries ");
                sql.Append(" where UserID=@UserID;");


                trans.FromSql(sql.ToString())
                .AddInputParameter("@Pwd_anw", DbType.String, txtPwd_anw.Text.Trim())
                .AddInputParameter("@ZJ_Number", DbType.String, txtZJ_Number.Text.Trim())
                .AddInputParameter("@ZJ_type", DbType.Int16, ddlZJ_Type.SelectedItem.Value)
                .AddInputParameter("@RealName", DbType.String, txtUserRealName.Text.Trim())
                .AddInputParameter("@Lotteries", DbType.Int32, txtLotteries.Text.Trim())
                .AddInputParameter("@UserID", DbType.Int32, UserID)
                .Execute();
                #endregion

                trans.Commit();

                CommonManager.Web.RegJs(this, "alert('修改成功!');location.href=location.href;", false);
            }
            catch (Exception ex)
            {
                trans.Rollback();
                CommonManager.Web.RegJs(this, "alert('发生错误,错误信息:" + ex.Message + "。\\r\\n未对数据库进行任何操作。');location.href=location.href;", false);
            }
        }
    }