public void SendMsg(string codes, string module) { try { Bll_Sys_Map mapInst = new Bll_Sys_Map(); var Map = mapInst.GetModel(string.Format(" AND Map_Module='{0}' AND Map_Source='{0}'", "SmsTemplate")); Bll_Audit auditInst = new Bll_Audit(); var TemlateKey = auditInst.GetTemplateModel(module); string[] code = codes.TrimEnd(',').Split(','); foreach (var c in code) { string content = string.Format(Map.Map_Object, TemlateKey.Template_Name, SessionConfig.UserName()); var model = stuffInstance.GetModelByCode(c); GSMHelper.SendMessage(model.Emp_Mobile, content); } } catch (Exception ex) { QX.Log.PlateLog.WriteError(SessionConfig.UserName(), "", "", "", "发送短信失败!", QX.Log.PlateLog.LogMessageType.Error, ex); } }
protected override ValidationResult IsValid(object value, ValidationContext validationContext) { var str = value as string; if (string.IsNullOrEmpty(str) || GSMHelper.ValidateMobileNumber(str)) { return(ValidationResult.Success); } return(new ValidationResult(ErrorMessageString)); }
protected override ValidationResult IsValid(object value, ValidationContext validationContext) { var name = value as string; if (string.IsNullOrEmpty(name)) { return(ValidationResult.Success); } return(GSMHelper.ValidateNaijaMobileNumber(name) ? ValidationResult.Success : new ValidationResult(ErrorMessageString)); }