简单的物流项目实战,WPF的MVVM设计模式(二)
往Models文件添加一个类,ConnectObject
/// <summary>
/// 链接数据库字符串
/// </summary>
public string SQLConnect { get; set; }
/// <summary>
/// 读取数据
/// </summary>
public string SQLRead { get; set; }
/// <summary>
/// 新增数据
/// </summary>
public string SQLInsert { get; set; }
/// <summary>
/// 删除数据
/// </summary>
public string SQLDelete { get; set; }
/// <summary>
/// 更新数据
/// </summary>
public string SQLUpdate { get; set; }
再添加一个User模型类
/// <summary> /// 登录账号 /// </summary> public string UserAccount { get; set; } /// <summary> /// 登录密码 /// </summary> public string Password { get; set; }
再添加一个Express模型类,
/// <summary> /// 省份 /// </summary> public string Province { get; set; } /// <summary> /// 城市 /// </summary> public string City { get; set; } /// <summary> /// 区域 /// </summary> public string Area { get; set; } /// <summary> /// 街道 /// </summary> public string Street { get; set; } /// <summary> /// 用户名 /// </summary> public string UserName { get; set; } /// <summary> /// 手机号码 /// </summary> public string PhoneNumber { get; set; } /// <summary> /// 创建时间 /// </summary> public string CteateTime { get; set; }
再往Data文件里面添加处理数据的类ConnectToDatabase
public SQLiteConnection SQLiteConnections; public ConnectObject connectObject = new ConnectObject(); public ConnectToDatabase() { connectObject.SQLConnect = "Data Source=WMS.db;Version=3;"; SQLiteConnections = new SQLiteConnection(connectObject.SQLConnect); SQLiteConnections.Open(); }
目前处理的模型类和数据链接类,本文先到这里。敬请期待下一篇详细描述。谢谢观赏!
多看书,少装逼!