@@ -7,11 +7,10 @@ namespace HKCardManager | |||||
public Form1() | public Form1() | ||||
{ | { | ||||
InitializeComponent(); | InitializeComponent(); | ||||
Task.Factory.StartNew(() => | |||||
Task.Factory.StartNew(() => | |||||
{ | { | ||||
DbContext.InitTable(); | DbContext.InitTable(); | ||||
}); | |||||
}); | |||||
} | } | ||||
private void ÈËԱ¼ÈëToolStripMenuItem_Click(object sender, EventArgs e) | private void ÈËԱ¼ÈëToolStripMenuItem_Click(object sender, EventArgs e) | ||||
@@ -1,4 +1,6 @@ | |||||
using HKLib.Logic; | |||||
using HKLib.Dto; | |||||
using HKLib.Interfaces; | |||||
using HKLib.Logic; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.ComponentModel; | using System.ComponentModel; | ||||
@@ -33,6 +35,10 @@ namespace HKCardManager | |||||
private void button2_Click(object sender, EventArgs e) | private void button2_Click(object sender, EventArgs e) | ||||
{ | { | ||||
HKLibHelper.AddUser(new UserDto() | |||||
{ | |||||
}); | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -0,0 +1,27 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Text.RegularExpressions; | |||||
using System.Threading.Tasks; | |||||
namespace HKCardManager | |||||
{ | |||||
public static class Extend | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
/// <param name="str"></param> | |||||
/// <param name="IsStrict"></param> | |||||
/// <returns></returns> | |||||
public static bool IsMobile(this string str, bool IsStrict = false) | |||||
{ | |||||
if (string.IsNullOrEmpty(str)) return false; | |||||
//string regex=@"^1[0123456789]\d{9}$"; | |||||
Regex.IsMatch(str, @"^(1)\d{10}$"); | |||||
string regex = IsStrict ? @"^[1][358]\d{9}$" : @"[1]\d{10}"; | |||||
return Regex.IsMatch(str, regex); | |||||
} | |||||
} | |||||
} |
@@ -29,7 +29,7 @@ namespace HKLib.DB | |||||
static string Route() | static string Route() | ||||
{ | { | ||||
var dir = SyncStatic.CreateDir(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Database")); | var dir = SyncStatic.CreateDir(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Database")); | ||||
var r= SyncStatic.CreateFile(Path.Combine(dir, "data.db3")); | |||||
var r = SyncStatic.CreateFile(Path.Combine(dir, "data.db3")); | |||||
return r; | return r; | ||||
} | } | ||||
public static void InitTable() | public static void InitTable() | ||||