Beispiel #1
0
 private void Btn_Register_Click(object sender, EventArgs e)
 {
     ConfigurationStatus.SCAccountData pAccountData = new ConfigurationStatus.SCAccountData();
     if (this.Txt_RegisterID.Text == "")
     {
         CommFunc.PublicMessageAll("输入会员账号不能为空!", true, MessageBoxIcon.Asterisk, "");
         this.Txt_RegisterID.Focus();
     }
     else if (this.Txt_RegisterID.Text.Length > 0x10)
     {
         CommFunc.PublicMessageAll($"输入会员账号的长度不能超过{0x10}位!", true, MessageBoxIcon.Asterisk, "");
         this.Txt_RegisterID.Focus();
     }
     else if (this.Txt_RegisterPW.Text == "")
     {
         CommFunc.PublicMessageAll("输入会员密码不能为空!", true, MessageBoxIcon.Asterisk, "");
         this.Txt_RegisterPW.Focus();
     }
     else if (this.Txt_RegisterPW.Text.Length > 0x10)
     {
         CommFunc.PublicMessageAll($"输入会员密码的长度不能超过{0x10}位!", true, MessageBoxIcon.Asterisk, "");
         this.Txt_RegisterPW.Focus();
     }
     else
     {
         pAccountData.ID                    = this.Txt_RegisterID.Text;
         pAccountData.PW                    = this.Txt_RegisterPW.Text;
         pAccountData.MachineCode           = this.MachineCode;
         pAccountData.Type                  = ConfigurationStatus.SCAccountType.FULL;
         pAccountData.ActiveTime            = DateTime.Now.ToString("yyyy-MM-dd");
         pAccountData.AppName               = AppInfo.Account.AppName;
         pAccountData.Configuration.FreeDay = AppInfo.Account.Configuration.FreeDay;
         if (AppInfo.Account.Configuration.BTPTUser)
         {
             if (this.PTLineDic.Count == 0)
             {
                 string webData = HttpHelper.GetWebData(AppInfo.cPTLineFile(""), "");
                 CommFunc.AnalysisPTLine(ref this.PTLineDic, webData);
             }
             pAccountData.PTUser = CommFunc.CreatPTUserString(pAccountData.ID, this.PTLineDic);
         }
         string str2 = SQLData.AddUserRow(pAccountData);
         if (str2 == "1")
         {
             if (AppInfo.Account.Configuration.FreeHint != "")
             {
                 CommFunc.PublicMessageAll(AppInfo.Account.Configuration.FreeHint, true, MessageBoxIcon.Asterisk, "");
             }
             else
             {
                 CommFunc.PublicMessageAll("注册成功!", true, MessageBoxIcon.Asterisk, "");
             }
         }
         else
         {
             string str3 = "请联系客服人员!";
             if (str2.Contains("插入重复键"))
             {
                 str3 = "该用户名已经存在!";
                 this.Txt_RegisterID.Focus();
             }
             CommFunc.PublicMessageAll($"注册失败,{str3}", true, MessageBoxIcon.Asterisk, "");
         }
     }
 }