Commit 20d178bc authored by 黄奎's avatar 黄奎

页面修改

parent 9d2c3611
......@@ -1234,31 +1234,22 @@ namespace Edu.Common.Plugin
/// <returns></returns>
public static List<int> StringToListInt(string str)
{
string[] ary = str.Split(',');
List<int> val = new List<int>();
for (int i = 0; i < ary.LongLength; i++)
if (!string.IsNullOrEmpty(str))
{
val.Add(Convert.ToInt32(ary[i]));
string[] ary = str.Split(',');
for (int i = 0; i < ary.LongLength; i++)
{
Int32.TryParse(ary[i], out int result);
if (result > 0)
{
val.Add(result);
}
}
}
return val;
}
/// <summary>
/// 将字符串转换为List int
/// </summary>
/// <param name="str">eg: (1,2,3,4)</param>
/// <returns></returns>
public static List<string> StringToListString(string str)
{
string[] ary = str.Split(',');
List<string> val = new List<string>();
for (int i = 0; i < ary.LongLength; i++)
{
val.Add(ary[i]);
}
return val;
}
#endregion
#region 验证码
......@@ -1614,5 +1605,16 @@ namespace Edu.Common.Plugin
}
return new string(array);
}
/// <summary>
/// 判断输入的字符串是否是一个合法的手机号
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public static bool IsMobilePhone(string input)
{
Regex regex = new Regex("^1[3456789]\\d{9}$");
return regex.IsMatch(input);
}
}
}
......@@ -502,11 +502,11 @@ namespace Edu.Module.Customer
StuId = StuId
});
List<int> ids1 = new List<int>();
if (AssistList != null)
if (AssistList != null&&AssistList.Count>0)
{
ids1 = Common.Plugin.StringHelper.StringToListInt(string.Join(",", AssistList.Select(qitem => qitem.AssistId)));
}
if (oldAssistList != null)
if (oldAssistList != null&&oldAssistList.Count>0)
{
List<int> ids2 = Common.Plugin.StringHelper.StringToListInt(string.Join(",", oldAssistList.Select(qitem => qitem.AssistId)));
if (ids2 != null && ids2.Count > 0)
......@@ -526,7 +526,7 @@ namespace Edu.Module.Customer
//以前没有协同人员【直接新增】
if (oldAssistList == null || (oldAssistList != null && oldAssistList.Count == 0))
{
foreach (var item in oldAssistList)
foreach (var item in AssistList)
{
student_AssistRepository.Insert(new Model.Entity.Customer.RB_Student_Assist()
{
......
......@@ -763,6 +763,14 @@ namespace Edu.WebApi.Controllers.User
{
extModel.CreateType = 1;
}
if (string.IsNullOrEmpty(extModel.StuTel))
{
return ApiResult.Failed("请填写手机号码!");
}
if (!Common.Plugin.StringHelper.IsMobilePhone(extModel.StuTel))
{
return ApiResult.Failed("手机号码不正确,请重新填写!");
}
extModel.Status = DateStateEnum.Normal;
extModel.StuStatus = 1;
extModel.CreateTime = DateTime.Now;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment