/// <summary> /// 更新 /// </summary> /// <param name="pDataObject"></param> /// <param name="sqLiteTransaction"></param> public void Update(Obj_YIJDF_TX pDataObject, SQLiteTransaction sqLiteTransaction) { const string mySqlString = "update YIJDF_TX set DFJS=$DFJS,YJDF=$YJDF,YJDFQZ=$YJDFQZ,JFYS=$JFYS,JFZE=$JFZE where NAME=$NAME and JFQZYF=$JFQZYF"; using (SQLiteCommand myCommand = sqLiteTransaction.Connection.CreateCommand()) { myCommand.CommandText = mySqlString; myCommand.Parameters.Add(new SQLiteParameter("NAME", pDataObject.Name)); myCommand.Parameters.Add(new SQLiteParameter("DFJS", pDataObject.DFJS)); myCommand.Parameters.Add(new SQLiteParameter("YJDF", pDataObject.YJDF)); myCommand.Parameters.Add(new SQLiteParameter("YJDFQZ", pDataObject.YJDFQZ)); myCommand.Parameters.Add(new SQLiteParameter("JFQZYF", pDataObject.JFQZYF)); myCommand.Parameters.Add(new SQLiteParameter("JFYS", pDataObject.JFYS)); myCommand.Parameters.Add(new SQLiteParameter("JFZE", pDataObject.JFZE)); myCommand.ExecuteNonQuery(); } }
/// <summary> /// 添加 /// </summary> /// <param name="pDataObject"></param> /// <param name="sqLiteTransaction"></param> public void Add(Obj_YIJDF_TX pDataObject, SQLiteTransaction sqLiteTransaction) { const string mySqlString = "insert into YIJDF_TX (NAME,DFJS,YJDF,YJDFQZ,JFQZYF,JFYS,JFZE) values ($NAME,$DFJS,$YJDF,$YJDFQZ,$JFQZYF,$JFYS,$JFZE)"; using (SQLiteCommand myCommand = sqLiteTransaction.Connection.CreateCommand()) { myCommand.CommandText = mySqlString; myCommand.Parameters.Add(new SQLiteParameter("NAME", pDataObject.Name)); myCommand.Parameters.Add(new SQLiteParameter("DFJS", pDataObject.DFJS)); myCommand.Parameters.Add(new SQLiteParameter("YJDF", pDataObject.YJDF)); myCommand.Parameters.Add(new SQLiteParameter("YJDFQZ", pDataObject.YJDFQZ)); myCommand.Parameters.Add(new SQLiteParameter("JFQZYF", pDataObject.JFQZYF)); myCommand.Parameters.Add(new SQLiteParameter("JFYS", pDataObject.JFYS)); myCommand.Parameters.Add(new SQLiteParameter("JFZE", pDataObject.JFZE)); myCommand.ExecuteNonQuery(); } }