Example #1
0
        //绑定密保卡
        protected void BindPasswordCard(object sender, EventArgs e)
        {
            PasswordCard pc = new PasswordCard( );

            pc.SerialNumber = Convert.ToInt32(lbSerialNumber.Text.Replace(" ", ""));
            string numberOne   = CtrlHelper.GetText(txtNumber1);
            string numberTwo   = CtrlHelper.GetText(txtNumber2);
            string numberThree = CtrlHelper.GetText(txtNumber3);

            if (string.IsNullOrEmpty(numberOne) || string.IsNullOrEmpty(numberTwo) || string.IsNullOrEmpty(numberThree))
            {
                Show("请填写坐标码");
                return;
            }
            string lbNumberOne   = pc.GetNumberByCoordinate(CtrlHelper.GetText(lbNumber1));
            string lbNumberTwo   = pc.GetNumberByCoordinate(CtrlHelper.GetText(lbNumber2));
            string lbNumberThree = pc.GetNumberByCoordinate(CtrlHelper.GetText(lbNumber3));

            if (numberOne != lbNumberOne || numberTwo != lbNumberTwo || numberThree != lbNumberThree)
            {
                Show("坐标码填写错误");
                return;
            }
            bool resutl = accountsFacade.UpdateUserPasswordCardID(Fetch.GetUserCookie( ).UserID, pc.SerialNumber);

            if (resutl)
            {
                ShowAndRedirect("绑定成功", "ApplyPasswordCard.aspx");
            }
            else
            {
                Show("绑定失败,请联系客服人员");
                return;
            }
        }