Пример #1
0
 public void OkButton()
 {
     if (!string.IsNullOrEmpty(_nickNameField.text))
     {
         if (_selectedIndex != 0)
         {
             if (CheckRule.IsValidNickName(_nickNameField.text))
             {
                 ClientManager._instance.OverlapCheck_NickName(_nickNameField.text);
             }
             else
             {
                 SystemMessageUI.Open(SystemMessageUI.eSystemMessageType.NickName_Rule);
             }
         }
         else
         {
             SystemMessageUI.Open(SystemMessageUI.eSystemMessageType.Character_NonSelect);
         }
     }
     else
     {
         SystemMessageUI.Open(SystemMessageUI.eSystemMessageType.NickName_NonEnter);
     }
 }
Пример #2
0
 public void OkButton()
 {
     if (!string.IsNullOrEmpty(_idField.text))
     {
         if (!string.IsNullOrEmpty(_pwField.text))
         {
             if (_isCheckOverlap)
             {
                 if (CheckRule.IsValidPassword(_pwField.text))
                 {
                     ClientManager._instance.EnrollTry(_idField.text, _pwField.text);
                 }
                 else
                 {
                     SystemMessageUI.Open(SystemMessageUI.eSystemMessageType.Pw_Rule);
                 }
             }
             else
             {
                 SystemMessageUI.Open(SystemMessageUI.eSystemMessageType.ID_Overlap_NonCheck);
             }
         }
         else
         {
             SystemMessageUI.Open(SystemMessageUI.eSystemMessageType.Pw_NonEnter);
         }
     }
     else
     {
         SystemMessageUI.Open(SystemMessageUI.eSystemMessageType.ID_NonEnter);
     }
 }
Пример #3
0
        private CheckRule Check(string ruleName)
        {
            //TODO::此处改造成本地库读取方式
            var type          = checkRuleTypeList.Where(kv => kv.Key == ruleName).First().Value;
            var checkRuleInfo = checkRuleList.Find(t => t.name == ruleName);

            //TODO::此处统一了各地方CheckRule的model,可以直接用反射后的返回值复制。
            checkRuleInfo.begin_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            if (type != null)
            {
                CheckRule result;
                try
                {
                    var rule = Activator.CreateInstance(type) as ICheckRule;
                    result = rule.Check(null);
                }
                catch (Exception ex)
                {
                    //return null;
                    result = new CheckRule
                    {
                        err_msg  = "运行规则失败!",
                        err_code = "-1"
                    };
                }
                //结果记录
                checkRuleInfo.is_check = 1;
                checkRuleInfo.ex_list  = result.ex_list;
            }
            checkRuleInfo.end_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            sync_check_rule(checkRuleInfo);
            return(checkRuleInfo);
        }
Пример #4
0
 public void OverlapCheck()
 {
     if (!string.IsNullOrEmpty(_idField.text))
     {
         if (CheckRule.IsValidID(_idField.text))
         {
             ClientManager._instance.OverlapCheck_ID(_idField.text);
         }
         else
         {
             SystemMessageUI.Open(SystemMessageUI.eSystemMessageType.ID_Rule);
         }
     }
     else
     {
         SystemMessageUI.Open(SystemMessageUI.eSystemMessageType.ID_NonEnter);
     }
 }
Пример #5
0
 private void sync_check_rule(CheckRule rule)
 {
     //ruleinfo.CheckResult.ex_list;
     string sql = string.Format(@"update p_check_rule set begin_time={1},end_time={2},result_count={3},is_check={4},check_count={5},err_code={6},err_msg={7} where name={0}",
                                rule.name, rule.begin_time, rule.end_time, 55, 1, rule.check_count, rule.err_code, rule.err_msg);
 }