Ejemplo n.º 1
0
 public WaitBoxInfo(string text, float duration, float delay, OnWaitTimeOut delWaitTimeOutFun, PASSWORD password)
 {
     _text           = text;
     _duration       = duration;
     _delay          = delay;
     _delWaitTimeOut = delWaitTimeOutFun;
     _password       = password;
 }
Ejemplo n.º 2
0
 public void TrimFields()
 {
     ID                 = ID.Trim();
     NAME               = NAME.Trim();
     CELLPHONENUMBER    = CELLPHONENUMBER.Trim();
     GENDER             = GENDER.Trim();
     PASSWORD           = PASSWORD.Trim();
     DORMITORYBUILDINGS = DORMITORYBUILDINGS.Trim();
 }
Ejemplo n.º 3
0
 public OKCancelInfo(string text, string title = null, OnOKClick funcOKClicked = null, OnCancelClick funcCancelClicked = null, float fCountDown = GlobeVar.INVALID_ID, PASSWORD password = PASSWORD.INVALID, int nCountDownDicID = GlobeVar.INVALID_ID)
 {
     _text            = text;
     _title           = title;
     _delOkClick      = funcOKClicked;
     _delCancelClick  = funcCancelClicked;
     _fCountDown      = fCountDown;
     _nCountDownDicID = nCountDownDicID;
     _password        = password;
 }
Ejemplo n.º 4
0
 public override void Login(string pass)
 {
     if (PASSWORD.Equals(pass))
     {
         ctx.State = new LoginSucceed(ctx);
     }
     else
     {
         ctx.State = new LoginFailed(ctx);
     }
 }
Ejemplo n.º 5
0
 void CleanData()
 {
     deleOK         = null;
     deleCancel     = null;
     delWaitTimeOut = null;
     m_waitTimer    = 0;
     m_delayTimer   = 0;
     m_Type         = -1;
     m_ePassword    = PASSWORD.INVALID;
     CountDown      = 0;
     ShowBox();
 }
Ejemplo n.º 6
0
 public void TrimFields()
 {
     ID                      = ID.Trim();
     NAME                    = NAME.Trim();
     CELLPHONENUMBER         = CELLPHONENUMBER.Trim();
     GENDER                  = GENDER.Trim();
     PASSWORD                = PASSWORD.Trim();
     CLASSNUMBER             = CLASSNUMBER.Trim();
     DORMITORYADDRESS        = DORMITORYADDRESS.Trim();
     DIRECTORNAME            = DIRECTORNAME.Trim();
     DIRECTORCELLPHONENUMBER = DIRECTORCELLPHONENUMBER.Trim();
 }
        public long SetPassword(PASSWORD Password)//long HumanID ,string password,string confirmPassword,string email ,string answer)
        {
            //PASSWORD Password = new PASSWORD();
            //Password.ANSWER = answer;
            //Password.CONFIRMPASSWORD = confirmPassword;
            //Password.PASSWORD1 = password;
            //Password.EMAIL = email;
            //Password.HUMANID = HumanID;

            try
            {
                using (KARYABDBEntities db = new KARYABDBEntities())
                {
                    if (Password.PASSWORD1.Equals(Password.CONFIRMPASSWORD) &&
                        Password.ANSWER != null &&
                        Password.EMAIL != null &&
                        Password.HUMANID != null)
                    {
                        var EmailExist = db.PASSWORDS.Where(q => q.EMAIL == Password.EMAIL).ToList();
                        if (EmailExist.Any())
                        {
                            if (EmailExist.Any(q => q.ANSWER == Password.ANSWER))
                            {
                                return(-2);
                            }
                            else
                            {
                                return(-1);
                            }
                        }
                        else
                        {
                            db.PASSWORDS.Add(Password);
                            db.SaveChanges();
                            return(Password.ID);
                        }
                    }
                    else
                    {
                        return(0);
                    }
                }
            }
            catch (Exception e)
            {
                return(0);
            }
        }
Ejemplo n.º 8
0
            public string ToString(enumStruct e)
            {
                switch (e)
                {
                case enumStruct.ACCOUNT:
                    return(ACCOUNT.ToString());

                case enumStruct.PASSWORD:
                    return(PASSWORD.ToString());

                case enumStruct.ACCESS:
                    return(ACCESS.ToString());

                default:
                    return("");
                }
            }
Ejemplo n.º 9
0
        public override void Login(string password)
        {
            if (tries > 0)
            {
                if (PASSWORD.Equals(password))
                {
                    Console.WriteLine("Great! You have logged in!");
                    ctx.State = new LoginSucceed(ctx);
                }
                else
                {
                    Console.WriteLine("Wrong password");
                    tries--;
                }
            }

            ctx.State = new Locked(ctx);
        }
Ejemplo n.º 10
0
        internal async Task <int> SignUpAsync(IDapperHelper db)
        {
            EMAIL = EmailReplace(EMAIL);

            if (EMAIL.IsNull())
            {
                throw new Exception("이메일을 정확히 입력해주세요");
            }
            if (PASSWORD.IsNull())
            {
                throw new Exception("비밀번호를 정확히 입력해주세요");
            }
            if (USER_NAME.IsNull())
            {
                throw new Exception("닉네임을 정확히 입력해주세요");
            }

            EMAIL     = EMAIL.Trim();
            PASSWORD  = PASSWORD.Trim();
            USER_NAME = USER_NAME.Trim();

            if (PASSWORD.Length < 8)
            {
                throw new Exception("비밀번호를 8자이상 입력해주세요");
            }

            //이메일 중복 확인
            if ((await db.GetQueryFromXmlAsync <int>("User.xml", "GetCheckEmail", this)).FirstOrDefault() > 0)
            {
                throw new Exception("이미 사용중인 이메일 입니다");
            }

            await CheckUserNameAsync(db);

            //U_ID 가져옴
            this.U_ID = (await db.GetQueryFromXmlAsync <uint>("User.xml", "GetSignUp_Uid", new { })).FirstOrDefault();

            //PASSWORD 암호화
            PASSWORD = HMacSha256.GetHMac(PASSWORD, U_ID.ToString());

            //Insert
            return(await db.ExecuteFromXmlAsync("User.xml", "InsertSignUp", this));
        }
Ejemplo n.º 11
0
 public static void OpenWaitBox(int textDicID, float duration = GameDefines.CONNECT_TIMEOUT, float delay = GameDefines.CONNECT_WAIT_DELAY, OnWaitTimeOut delWaitTimeOutFun = null, PASSWORD password = PASSWORD.INVALID)
 {
     MessageBoxLogic.OpenWaitBox(Utils.GetDicByID(textDicID), duration, delay, delWaitTimeOutFun, password);
 }
Ejemplo n.º 12
0
 public static void OpenOKCancelBox(int textDicID, int titleDicID = -1, OnOKClick funcOKClicked = null, OnCancelClick funcCancelClicked = null, PASSWORD password = PASSWORD.INVALID)
 {
     MessageBoxLogic.OpenOKCancelBox(Utils.GetDicByID(textDicID), Utils.GetDicByID((int)titleDicID), funcOKClicked, funcCancelClicked, GlobeVar.INVALID_ID, password);
 }
Ejemplo n.º 13
0
 //----------------------------------重载便捷函数-------------------------------------------------------/
 public static void OpenOKBox(int textDicID, int titleDicID = -1, OnOKClick funcOKClicked = null, PASSWORD password = PASSWORD.INVALID)
 {
     MessageBoxLogic.OpenOKBox(Utils.GetDicByID(textDicID), titleDicID == -1 ? "" : Utils.GetDicByID((int)titleDicID), funcOKClicked, password);
 }
Ejemplo n.º 14
0
    // 等待界面
    // duration 等待时间,如果<=0 则无限等待,
    // delay 延时弹出时间,如有延时,则会先以透明底版的形式弹出,延时结束后显示内容
    public static void OpenWaitBox(string text, float duration = 0, float delay = 0, OnWaitTimeOut delWaitTimeOutFun = null, PASSWORD password = PASSWORD.INVALID)
    {
        WaitBoxInfo curInfo = new WaitBoxInfo(text, duration, delay, delWaitTimeOutFun, password);

        UIManager.ShowUI(UIInfo.MessageBox, OnOpenWaitBox, curInfo);
    }
Ejemplo n.º 15
0
    // 有确定取消按钮
    public static void OpenOKCancelBox(string text, string title = null, OnOKClick funcOKClicked = null, OnCancelClick funcCancelClicked = null, int nCountDown = GlobeVar.INVALID_ID, PASSWORD password = PASSWORD.INVALID, int nCountDownDicID = GlobeVar.INVALID_ID)
    {
        OKCancelInfo curInfo = new OKCancelInfo(text, title, funcOKClicked, funcCancelClicked, nCountDown, password, nCountDownDicID);

        UIManager.ShowUI(UIInfo.MessageBox, OnOpenOkCancelBox, curInfo);
    }
Ejemplo n.º 16
0
    //============================================================================================
    // 只有一个确定按钮
    public static void OpenOKBox(string text, string title = null, OnOKClick funcOKClicked = null, PASSWORD password = PASSWORD.INVALID)
    {
        OKCancelInfo curInfo = new OKCancelInfo(text, title, funcOKClicked, null, GlobeVar.INVALID_ID, password);

        UIManager.ShowUI(UIInfo.MessageBox, OnOpenOkBox, curInfo);
    }
 //重置两个框中输入的内容
 private void CLEAR_Click(object sender, EventArgs e)
 {
     USERNAME.Clear();
     PASSWORD.Clear();
 }