12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Reflection.Emit;
- using System.Text;
- using WpfTest1.SQLite;
- namespace WpfTest1.SQLite
- {
- public class SQLiteLogic
- {
- static void Main_1(string[] args)
- { /*
-
- //CreateTable();
- //InsertData();
- Console.WriteLine("开始创建数据表!");
- SQLiteModel.CreatePatientTable();
- Console.WriteLine("插入数据!");
- SQLiteModel.InsertPatientData("620523199509051700", "张三", 175.1, 68.5, 144, 2, 3, DateTime.Now.Date,"13718141455", "护士", "北京市海淀区", "1", "1", "ZS", "状态良好", new DateTime(111111), false);
- SQLiteModel.InsertPatientData("620523199509051720", "李四", 145.1, 58.5, 134, 1, 3,DateTime.Now.Date, "12718141455", "教授", "西安市海淀区", "4", "1", "LS", "状态一般", new DateTime(111111), false);
- SQLiteModel.InsertPatientData("620523199509051702", "古丽 ", 165.1, 88.5, 154, 1, 3, DateTime.Now.Date,"15718141455", "司机", "上海市海淀区", "3", "1", "GL", "差", new DateTime(111111), false);
- Console.WriteLine("更新数据!");
- SQLiteModel.UpdatePatientData("620523199509051702", "张丽 ", 195.1, 98.5, 154, 1, 3, DateTime.Now.Date,"25718141455", "学生", "上海市海淀区", "3", "1", "ZL", "差", new DateTime(111111), false);
- Console.WriteLine("删除数据!");
- Console.WriteLine(SQLiteModel.DeletePatientItem("620523199509051702"));
- Console.WriteLine("获取数据!");
- //查询的一个问题是怎么返回值
- //根据姓名或者简写模糊查询
- SQLiteModel.getPatientByPY("G");
- SQLiteModel.getPatientByName("张");
- //根据条件进行查询 每个条件前面加AND
- //姓名name 身份证号 病例编号 孕次pregnancy_times 产次birth_times 身高height 体重weight 心率base_heartrate
- SQLiteModel.getPatientByCondition("AND name like\'%张丽%\'");
- Console.WriteLine("操作完毕!");
- Console.ReadLine();
- */
- }
- public SQLiteLogic(){}
- public static void createDBAndTables() {
- if (!System.IO.File.Exists(System.Environment.CurrentDirectory + "\\Junde.db3"))
- {
- SQLiteModel.CreatePatientTable();
- SQLiteModel.CreateRecordTable();
- SQLiteModel.CreateDoctorTable();
- SQLiteModel.CreateExpressionTable();
- SQLiteModel.CreateCommonWordsTable();
- SQLiteModel.CreateTreatmentTable();
- }
- }
- }
- }
|