static void TestS() { IDynaRecord dynaRecord = dataMod.GetDynaRecord("Invoice"); using (FileStream wfs = new FileStream("Stored_Procs.txt", FileMode.Create)) { StreamWriter sw = new StreamWriter(wfs); sw.WriteLine(dynaRecord.GetInfo("create")); sw.WriteLine(dynaRecord.GetInfo("select")); sw.WriteLine(dynaRecord.GetInfo("detail")); sw.WriteLine(dynaRecord.GetInfo("insert")); sw.WriteLine(dynaRecord.GetInfo("update")); sw.Close(); } }
static void TestU() { Console.WriteLine(); IDynaRecord dynaRecord = dataMod.GetDynaRecord("Invo"); dynaRecord.FieldDict["Dt_Fst"].Value = "2017.04.01"; dynaRecord.FieldDict["Dt_Lst"].Value = "2017.04.10"; if (dynaRecord == null) { Console.WriteLine(dataMod.lastError); return; } QueryInvo queryInvo = new QueryInvo(dynaRecord); var query = from invo in queryInvo where invo.Val > 0 orderby invo.Dt_Invo select invo; int count = 0; foreach (Invo invo in query) { Console.WriteLine("{0} {1} {2} {3} {4}", count++, invo.Idn, invo.Dt_Invo, invo.Val, invo.Note); } Console.WriteLine("Done U. Count={0}", count); Invo first = query.First(); Console.WriteLine("Исход.: {0} {1} {2} {3}", first.Idn, first.Dt_Invo, first.Val, first.Note); first.Dt_Invo = DateTime.Parse("07.04.2017"); first.Val = -1500; first.Note = "Попытка изменения данных"; queryInvo.Action(first, "upd"); Console.WriteLine("Измен.: {0} {1} {2} {3}", first.Idn, first.Dt_Invo, first.Val, first.Note); Console.WriteLine(dynaRecord.GetInfo("fields")); }