/// <summary> /// /// </summary> /// <param name="appo"></param> public static void AddPlanPrint(AsmPlanPrintObject appo) { using (IDbConnection conn = ClsCommon.OpenConnection()) //这里访问的是Sqlite数据文件,这里OpenConnection即上边获取连接数据库对象方法 { var result = conn.Insert(appo); } }
public static int AddDeviceObject(AsmDeviceObject uo) { using (IDbConnection conn = ClsCommon.OpenConnection()) //这里访问的是Sqlite数据文件,这里OpenConnection即上边获取连接数据库对象方法 { var result = conn.Insert(uo); return(Convert.ToInt32(result)); } }
public static int UpdateDeviceObject(AsmDeviceObject uo) { var result = 0; using (IDbConnection conn = ClsCommon.OpenConnection()) //这里访问的是Sqlite数据文件,这里OpenConnection即上边获取连接数据库对象方法 { result = conn.Update(uo); } return(Convert.ToInt32(result)); }
/// <summary> /// 根据条件更新多个用户 /// </summary> /// <param name="sqlCondition"></param> /// <returns></returns> public static int UpdatePlanByCondition(string sqlCondition) { var a = 0; using (IDbConnection conn = ClsCommon.OpenConnection()) //这里访问的是Sqlite数据文件,这里OpenConnection即上边获取连接数据库对象方法 { a = conn.Update(sqlCondition); } return(Convert.ToInt32(a)); }
/// <summary> /// 根据条件查询单个对象必须要ID /// </summary> /// <param name="sqlCondition"></param> /// <returns></returns> public static AsmPlanObject GetOnePlanByCondition(string sqlCondition) { AsmPlanObject uo; using (IDbConnection conn = ClsCommon.OpenConnection()) //这里访问的是Sqlite数据文件,这里OpenConnection即上边获取连接数据库对象方法 { uo = conn.Get <AsmPlanObject>(sqlCondition); } return(uo); }
/// <summary> /// 根据条件查询多个对象 /// </summary> /// <param name="sqlCondition"></param> /// <returns></returns> public static List <AsmPlanObject> GetPlanByCondition(string sqlCondition) { IEnumerable <AsmPlanObject> user = null; using (IDbConnection conn = ClsCommon.OpenConnection()) //这里访问的是Sqlite数据文件,这里OpenConnection即上边获取连接数据库对象方法 { user = conn.GetList <AsmPlanObject>(sqlCondition); } return(user.ToList()); }
/// <summary> /// 根据对象删除用户 /// </summary> /// <param name="uo"></param> /// <returns></returns> public static int DeleteUserByObject(UsersObject uo) { var result = 0; using (IDbConnection conn = ClsCommon.OpenConnection()) //这里访问的是Sqlite数据文件,这里OpenConnection即上边获取连接数据库对象方法 { result = conn.Delete(uo); } return(Convert.ToInt32(result)); }
/// <summary> /// 根据条件删除用户 /// </summary> /// <param name="sqlCondition"></param> /// <returns></returns> public static int DeleteUserByCondition(string sqlCondition) { var a = 0; using (IDbConnection conn = ClsCommon.OpenConnection()) //这里访问的是Sqlite数据文件,这里OpenConnection即上边获取连接数据库对象方法 { a = conn.DeleteList <UsersObject>(sqlCondition); } return(Convert.ToInt32(a)); }
/// <summary> /// 查询所有用户 /// </summary> /// <returns></returns> public static List <UsersObject> GetAllUsers() { IEnumerable <UsersObject> users = null; using (IDbConnection conn = ClsCommon.OpenConnection()) //这里访问的是Sqlite数据文件,这里OpenConnection即上边获取连接数据库对象方法 { users = conn.GetList <UsersObject>(); } return(users.ToList()); }