Пример #1
0
        private void initClass()
        {
            DataSetName = "dsmeta";
            Prefix      = "";
            Namespace   = "http://tempuri.org/dsmeta.xsd";

            #region create DataTables
            //////////////////// PAYMENT /////////////////////////////////
            var tpayment = new paymentTable();
            tpayment.addBaseColumns("kpay", "ypay", "npay", "kpaymenttransmission", "idstamphandling", "idtreasurer", "flag", "idreg", "idfin", "idman", "adate", "printdate", "txt", "rtf", "cu", "ct", "lu", "lt", "annulmentdate", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05", "npay_treasurer");
            Tables.Add(tpayment);
            tpayment.defineKey("kpay");

            //////////////////// STAMPHANDLING /////////////////////////////////
            var tstamphandling = new MetaTable("stamphandling");
            tstamphandling.defineColumn("idstamphandling", typeof(int), false);
            tstamphandling.defineColumn("description", typeof(string), false);
            tstamphandling.defineColumn("flagdefault", typeof(string), false);
            tstamphandling.defineColumn("cu", typeof(string), false);
            tstamphandling.defineColumn("ct", typeof(DateTime), false);
            tstamphandling.defineColumn("lu", typeof(string), false);
            tstamphandling.defineColumn("lt", typeof(DateTime), false);
            tstamphandling.defineColumn("active", typeof(string));
            Tables.Add(tstamphandling);
            tstamphandling.defineKey("idstamphandling");

            //////////////////// TREASURER /////////////////////////////////
            var ttreasurer = new treasurerTable();
            ttreasurer.addBaseColumns("idtreasurer", "description", "flagdefault", "cin", "idbank", "idcab", "cc", "address", "cap", "city", "country", "phoneprefix", "phonenumber", "faxprefix", "faxnumber", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05", "cu", "ct", "lu", "lt", "active");
            Tables.Add(ttreasurer);
            ttreasurer.defineKey("idtreasurer");

            //////////////////// MANAGER /////////////////////////////////
            var tmanager = new managerTable();
            tmanager.addBaseColumns("idman", "title", "iddivision", "email", "phonenumber", "userweb", "passwordweb", "txt", "rtf", "cu", "ct", "lu", "lt", "active", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05");
            Tables.Add(tmanager);
            tmanager.defineKey("idman");

            //////////////////// REGISTRY /////////////////////////////////
            var tregistry = new registryTable();
            tregistry.addBaseColumns("idreg", "title", "cf", "p_iva", "residence", "annotation", "birthdate", "gender", "surname", "forename", "foreigncf", "active", "txt", "rtf", "cu", "ct", "lu", "lt");
            Tables.Add(tregistry);
            tregistry.defineKey("idreg");

            //////////////////// EXPENSEPHASE /////////////////////////////////
            var texpensephase = new MetaTable("expensephase");
            texpensephase.defineColumn("nphase", typeof(byte), false);
            texpensephase.defineColumn("description", typeof(string), false);
            texpensephase.defineColumn("cu", typeof(string), false);
            texpensephase.defineColumn("ct", typeof(DateTime), false);
            texpensephase.defineColumn("lu", typeof(string), false);
            texpensephase.defineColumn("lt", typeof(DateTime), false);
            Tables.Add(texpensephase);
            texpensephase.defineKey("nphase");

            //////////////////// PAYMENTTRANSMISSION /////////////////////////////////
            var tpaymenttransmission = new paymenttransmissionTable();
            tpaymenttransmission.addBaseColumns("kpaymenttransmission", "ypaymenttransmission", "npaymenttransmission", "idman", "idtreasurer", "transmissiondate", "cu", "ct", "lu", "lt");
            Tables.Add(tpaymenttransmission);
            tpaymenttransmission.defineKey("kpaymenttransmission");

            //////////////////// EXPENSEVAR /////////////////////////////////
            var texpensevar = new expensevarTable();
            texpensevar.addBaseColumns("nvar", "idexp", "yvar", "description", "amount", "doc", "autokind", "idpayment", "docdate", "adate", "txt", "rtf", "cu", "ct", "lu", "lt", "idinvkind", "ninv", "yinv");
            Tables.Add(texpensevar);
            texpensevar.defineKey("nvar", "idexp");

            //////////////////// BANKTRANSACTION /////////////////////////////////
            var tbanktransaction = new banktransactionTable();
            tbanktransaction.addBaseColumns("yban", "nban", "kpay", "kind", "bankreference", "transactiondate", "valuedate", "amount", "kpro", "cu", "ct", "lu", "lt", "idexp", "idinc", "idpay", "idpro", "idbankimport");
            tbanktransaction.defineColumn("!nmov", typeof(int));
            Tables.Add(tbanktransaction);
            tbanktransaction.defineKey("yban", "nban", "kpay");

            //////////////////// PAYMENT_BANKVIEW /////////////////////////////////
            var tpayment_bankview = new MetaTable("payment_bankview");
            tpayment_bankview.defineColumn("kpay", typeof(int), false);
            tpayment_bankview.defineColumn("ypay", typeof(short), false);
            tpayment_bankview.defineColumn("npay", typeof(int), false);
            tpayment_bankview.defineColumn("idpay", typeof(int), false);
            tpayment_bankview.defineColumn("idreg", typeof(int), false);
            tpayment_bankview.defineColumn("registry", typeof(string), false);
            tpayment_bankview.defineColumn("description", typeof(string));
            tpayment_bankview.defineColumn("amount", typeof(decimal), false);
            tpayment_bankview.defineColumn("ct", typeof(DateTime), false);
            tpayment_bankview.defineColumn("cu", typeof(string), false);
            tpayment_bankview.defineColumn("lt", typeof(DateTime), false);
            tpayment_bankview.defineColumn("lu", typeof(string), false);
            Tables.Add(tpayment_bankview);
            tpayment_bankview.defineKey("kpay", "idpay");

            //////////////////// SORTINGKIND /////////////////////////////////
            var tsortingkind = new sortingkindTable();
            tsortingkind.addBaseColumns("idsorkind", "active", "ct", "cu", "description", "flagdate", "flag", "forcedN1", "forcedN2", "forcedN3", "forcedN4", "forcedN5", "forcedS1", "forcedS2", "forcedS3", "forcedS4", "forcedS5", "forcedv1", "forcedv2", "forcedv3", "forcedv4", "forcedv5", "labelfordate", "labeln1", "labeln2", "labeln3", "labeln4", "labeln5", "labels1", "labels2", "labels3", "labels4", "labels5", "labelv1", "labelv2", "labelv3", "labelv4", "labelv5", "lockedN1", "lockedN2", "lockedN3", "lockedN4", "lockedN5", "lockedS1", "lockedS2", "lockedS3", "lockedS4", "lockedS5", "lockedv1", "lockedv2", "lockedv3", "lockedv4", "lockedv5", "lt", "lu", "nodatelabel", "nphaseexpense", "nphaseincome", "totalexpression");
            Tables.Add(tsortingkind);
            tsortingkind.defineKey("idsorkind");

            //////////////////// EXPENSESORTED /////////////////////////////////
            var texpensesorted = new expensesortedTable();
            texpensesorted.addBaseColumns("idexp", "idsor", "idsubclass", "amount", "ayear", "ct", "cu", "description", "flagnodate", "lt", "lu", "paridsor", "paridsubclass", "rtf", "start", "stop", "tobecontinued", "txt", "valuen1", "valuen2", "valuen3", "valuen4", "valuen5", "values1", "values2", "values3", "values4", "values5", "valuev1", "valuev2", "valuev3", "valuev4", "valuev5");
            Tables.Add(texpensesorted);
            texpensesorted.defineKey("idexp", "idsor", "idsubclass");

            //////////////////// EXPENSELASTVIEW /////////////////////////////////
            var texpenselastview = new MetaTable("expenselastview");
            texpenselastview.defineColumn("idexp", typeof(int), false);
            texpenselastview.defineColumn("nphase", typeof(byte), false);
            texpenselastview.defineColumn("phase", typeof(string), false);
            texpenselastview.defineColumn("ymov", typeof(short), false);
            texpenselastview.defineColumn("nmov", typeof(int), false);
            texpenselastview.defineColumn("parentidexp", typeof(int));
            texpenselastview.defineColumn("parentymov", typeof(short));
            texpenselastview.defineColumn("parentnmov", typeof(int));
            texpenselastview.defineColumn("idformerexpense", typeof(int));
            texpenselastview.defineColumn("ayear", typeof(short), false);
            texpenselastview.defineColumn("idfin", typeof(int));
            texpenselastview.defineColumn("codefin", typeof(string));
            texpenselastview.defineColumn("finance", typeof(string));
            texpenselastview.defineColumn("idupb", typeof(string));
            texpenselastview.defineColumn("codeupb", typeof(string));
            texpenselastview.defineColumn("upb", typeof(string));
            texpenselastview.defineColumn("idreg", typeof(int));
            texpenselastview.defineColumn("registry", typeof(string));
            texpenselastview.defineColumn("idman", typeof(int));
            texpenselastview.defineColumn("manager", typeof(string));
            texpenselastview.defineColumn("kpay", typeof(int));
            texpenselastview.defineColumn("ypay", typeof(short), true, true);
            texpenselastview.defineColumn("npay", typeof(int));
            texpenselastview.defineColumn("paymentadate", typeof(DateTime));
            texpenselastview.defineColumn("doc", typeof(string));
            texpenselastview.defineColumn("docdate", typeof(DateTime));
            texpenselastview.defineColumn("description", typeof(string), false);
            texpenselastview.defineColumn("amount", typeof(decimal));
            texpenselastview.defineColumn("ayearstartamount", typeof(decimal));
            texpenselastview.defineColumn("curramount", typeof(decimal));
            texpenselastview.defineColumn("available", typeof(decimal));
            texpenselastview.defineColumn("idregistrypaymethod", typeof(int));
            texpenselastview.defineColumn("idpaymethod", typeof(int));
            texpenselastview.defineColumn("iban", typeof(string));
            texpenselastview.defineColumn("cin", typeof(string));
            texpenselastview.defineColumn("idbank", typeof(string));
            texpenselastview.defineColumn("idcab", typeof(string));
            texpenselastview.defineColumn("cc", typeof(string));
            texpenselastview.defineColumn("iddeputy", typeof(int));
            texpenselastview.defineColumn("deputy", typeof(string));
            texpenselastview.defineColumn("refexternaldoc", typeof(string));
            texpenselastview.defineColumn("biccode", typeof(string));
            texpenselastview.defineColumn("paymethod_flag", typeof(int));
            texpenselastview.defineColumn("paymethod_allowdeputy", typeof(string));
            texpenselastview.defineColumn("extracode", typeof(string));
            texpenselastview.defineColumn("paymentdescr", typeof(string));
            texpenselastview.defineColumn("idser", typeof(int));
            texpenselastview.defineColumn("service", typeof(string));
            texpenselastview.defineColumn("servicestart", typeof(DateTime));
            texpenselastview.defineColumn("servicestop", typeof(DateTime));
            texpenselastview.defineColumn("ivaamount", typeof(decimal));
            texpenselastview.defineColumn("flag", typeof(byte));
            texpenselastview.defineColumn("totflag", typeof(byte));
            texpenselastview.defineColumn("flagarrear", typeof(string), true, true);
            texpenselastview.defineColumn("autokind", typeof(byte));
            texpenselastview.defineColumn("idpayment", typeof(int));
            texpenselastview.defineColumn("expiration", typeof(DateTime));
            texpenselastview.defineColumn("adate", typeof(DateTime), false);
            texpenselastview.defineColumn("autocode", typeof(int));
            texpenselastview.defineColumn("idclawback", typeof(int));
            texpenselastview.defineColumn("clawback", typeof(string));
            texpenselastview.defineColumn("nbill", typeof(int));
            texpenselastview.defineColumn("idpay", typeof(int));
            texpenselastview.defineColumn("txt", typeof(string));
            texpenselastview.defineColumn("cu", typeof(string), false);
            texpenselastview.defineColumn("ct", typeof(DateTime), false);
            texpenselastview.defineColumn("lu", typeof(string), false);
            texpenselastview.defineColumn("lt", typeof(DateTime), false);
            texpenselastview.defineColumn("idsor01", typeof(int));
            texpenselastview.defineColumn("idsor02", typeof(int));
            texpenselastview.defineColumn("idsor03", typeof(int));
            texpenselastview.defineColumn("idsor04", typeof(int));
            texpenselastview.defineColumn("idsor05", typeof(int));
            texpenselastview.defineColumn("idchargehandling", typeof(int));
            texpenselastview.defineColumn("net", typeof(decimal));
            Tables.Add(texpenselastview);
            texpenselastview.defineKey("idexp");

            //////////////////// CONFIG /////////////////////////////////
            var tconfig = new configTable();
            tconfig.addBaseColumns("ayear", "automanagekind", "agencycode", "appname", "appropriationphasecode", "assessmentphasecode", "asset_flagnumbering", "asset_flagrestart", "flag_autodocnumbering", "assetload_flag", "boxpartitiontitle", "cashvaliditykind", "casualcontract_flagrestart", "ct", "cu", "currpartitiontitle", "deferredexpensephase", "deferredincomephase", "electronicimport", "electronictrasmission", "expense_expiringdays", "expensephase", "flag_paymentamount", "flagautopayment", "flagautoproceeds", "flagcredit", "flagepexp", "flagfruitful", "flagpayment", "flagproceeds", "flagrefund", "taxvaliditykind", "foreignhours", "idacc_accruedcost", "idacc_accruedrevenue", "idacc_customer", "idacc_deferredcost", "idacc_deferredcredit", "idacc_deferreddebit", "idacc_deferredrevenue", "idacc_ivapayment", "idacc_ivarefund", "idacc_patrimony", "idacc_pl", "idacc_supplier", "idaccmotive_admincar", "idaccmotive_foot", "idaccmotive_owncar", "idclawback", "idfinexpense", "idfinexpensesurplus", "idfinincomesurplus", "idfinivapayment", "idfinivarefund", "idivapayperiodicity", "idregauto", "idsortingkind1", "idsortingkind2", "idsortingkind3", "importappname", "income_expiringdays", "incomephase", "linktoinvoice", "lt", "lu", "minpayment", "minrefund", "motivelen", "motiveprefix", "motiveseparator", "payment_finlevel", "payment_flag", "payment_flagautoprintdate", "paymentagency", "flagbank_grouping", "fin_kind", "prevpartitiontitle", "proceeds_finlevel", "proceeds_flag", "proceeds_flagautoprintdate", "profservice_flagrestart", "refundagency", "wageaddition_flagrestart");
            Tables.Add(tconfig);
            tconfig.defineKey("ayear");

            //////////////////// FIN /////////////////////////////////
            var tfin = new finTable();
            tfin.addBaseColumns("ayear", "codefin", "ct", "cu", "lt", "lu", "printingorder", "rtf", "title", "txt", "nlevel", "idfin", "paridfin", "flag");
            Tables.Add(tfin);
            tfin.defineKey("idfin");

            //////////////////// EXPENSE1 /////////////////////////////////
            var texpense1 = new MetaTable("expense1");
            texpense1.defineColumn("adate", typeof(DateTime), false);
            texpense1.defineColumn("ct", typeof(DateTime), false);
            texpense1.defineColumn("cu", typeof(string), false);
            texpense1.defineColumn("description", typeof(string), false);
            texpense1.defineColumn("doc", typeof(string));
            texpense1.defineColumn("docdate", typeof(DateTime));
            texpense1.defineColumn("expiration", typeof(DateTime));
            texpense1.defineColumn("idreg", typeof(int));
            texpense1.defineColumn("lt", typeof(DateTime), false);
            texpense1.defineColumn("lu", typeof(string), false);
            texpense1.defineColumn("nmov", typeof(int), false);
            texpense1.defineColumn("rtf", typeof(Byte[]));
            texpense1.defineColumn("txt", typeof(string));
            texpense1.defineColumn("ymov", typeof(short), false);
            texpense1.defineColumn("idclawback", typeof(int));
            texpense1.defineColumn("idman", typeof(int));
            texpense1.defineColumn("nphase", typeof(byte), false);
            texpense1.defineColumn("idexp", typeof(int), false);
            texpense1.defineColumn("parentidexp", typeof(int));
            texpense1.defineColumn("idpayment", typeof(int));
            texpense1.defineColumn("idformerexpense", typeof(int));
            texpense1.defineColumn("autokind", typeof(byte));
            texpense1.defineColumn("autocode", typeof(int));
            Tables.Add(texpense1);
            texpense1.defineKey("idexp");

            //////////////////// PAYDISPOSITION /////////////////////////////////
            var tpaydisposition = new paydispositionTable();
            tpaydisposition.addBaseColumns("idpaydisposition", "ayear", "description", "motive", "kpay", "ct", "cu", "lt", "lu");
            Tables.Add(tpaydisposition);
            tpaydisposition.defineKey("idpaydisposition");

            //////////////////// PAYDISPOSITIONDETAIL /////////////////////////////////
            var tpaydispositiondetail = new paydispositiondetailTable();
            tpaydispositiondetail.addBaseColumns("idpaydisposition", "iddetail", "surname", "forename", "gender", "birthdate", "idcity", "idnation", "cf", "address", "location", "cap", "abi", "cab", "motive", "amount", "ct", "cu", "lt", "lu");
            Tables.Add(tpaydispositiondetail);
            tpaydispositiondetail.defineKey("idpaydisposition", "iddetail");

            //////////////////// SORTING01 /////////////////////////////////
            var tsorting01 = new MetaTable("sorting01");
            tsorting01.defineColumn("ct", typeof(DateTime), false);
            tsorting01.defineColumn("cu", typeof(string), false);
            tsorting01.defineColumn("defaultN1", typeof(decimal));
            tsorting01.defineColumn("defaultN2", typeof(decimal));
            tsorting01.defineColumn("defaultN3", typeof(decimal));
            tsorting01.defineColumn("defaultN4", typeof(decimal));
            tsorting01.defineColumn("defaultN5", typeof(decimal));
            tsorting01.defineColumn("defaultS1", typeof(string));
            tsorting01.defineColumn("defaultS2", typeof(string));
            tsorting01.defineColumn("defaultS3", typeof(string));
            tsorting01.defineColumn("defaultS4", typeof(string));
            tsorting01.defineColumn("defaultS5", typeof(string));
            tsorting01.defineColumn("defaultv1", typeof(decimal));
            tsorting01.defineColumn("defaultv2", typeof(decimal));
            tsorting01.defineColumn("defaultv3", typeof(decimal));
            tsorting01.defineColumn("defaultv4", typeof(decimal));
            tsorting01.defineColumn("defaultv5", typeof(decimal));
            tsorting01.defineColumn("description", typeof(string), false);
            tsorting01.defineColumn("flagnodate", typeof(string));
            tsorting01.defineColumn("lt", typeof(DateTime), false);
            tsorting01.defineColumn("lu", typeof(string), false);
            tsorting01.defineColumn("movkind", typeof(string));
            tsorting01.defineColumn("printingorder", typeof(string));
            tsorting01.defineColumn("rtf", typeof(Byte[]));
            tsorting01.defineColumn("sortcode", typeof(string), false);
            tsorting01.defineColumn("txt", typeof(string));
            tsorting01.defineColumn("idsorkind", typeof(int), false);
            tsorting01.defineColumn("idsor", typeof(int), false);
            tsorting01.defineColumn("paridsor", typeof(int));
            tsorting01.defineColumn("nlevel", typeof(byte), false);
            tsorting01.defineColumn("start", typeof(short));
            tsorting01.defineColumn("stop", typeof(short));
            Tables.Add(tsorting01);
            tsorting01.defineKey("idsor");

            //////////////////// SORTING02 /////////////////////////////////
            var tsorting02 = new MetaTable("sorting02");
            tsorting02.defineColumn("ct", typeof(DateTime), false);
            tsorting02.defineColumn("cu", typeof(string), false);
            tsorting02.defineColumn("defaultN1", typeof(decimal));
            tsorting02.defineColumn("defaultN2", typeof(decimal));
            tsorting02.defineColumn("defaultN3", typeof(decimal));
            tsorting02.defineColumn("defaultN4", typeof(decimal));
            tsorting02.defineColumn("defaultN5", typeof(decimal));
            tsorting02.defineColumn("defaultS1", typeof(string));
            tsorting02.defineColumn("defaultS2", typeof(string));
            tsorting02.defineColumn("defaultS3", typeof(string));
            tsorting02.defineColumn("defaultS4", typeof(string));
            tsorting02.defineColumn("defaultS5", typeof(string));
            tsorting02.defineColumn("defaultv1", typeof(decimal));
            tsorting02.defineColumn("defaultv2", typeof(decimal));
            tsorting02.defineColumn("defaultv3", typeof(decimal));
            tsorting02.defineColumn("defaultv4", typeof(decimal));
            tsorting02.defineColumn("defaultv5", typeof(decimal));
            tsorting02.defineColumn("description", typeof(string), false);
            tsorting02.defineColumn("flagnodate", typeof(string));
            tsorting02.defineColumn("lt", typeof(DateTime), false);
            tsorting02.defineColumn("lu", typeof(string), false);
            tsorting02.defineColumn("movkind", typeof(string));
            tsorting02.defineColumn("printingorder", typeof(string));
            tsorting02.defineColumn("rtf", typeof(Byte[]));
            tsorting02.defineColumn("sortcode", typeof(string), false);
            tsorting02.defineColumn("txt", typeof(string));
            tsorting02.defineColumn("idsorkind", typeof(int), false);
            tsorting02.defineColumn("idsor", typeof(int), false);
            tsorting02.defineColumn("paridsor", typeof(int));
            tsorting02.defineColumn("nlevel", typeof(byte), false);
            tsorting02.defineColumn("start", typeof(short));
            tsorting02.defineColumn("stop", typeof(short));
            Tables.Add(tsorting02);
            tsorting02.defineKey("idsor");

            //////////////////// SORTING03 /////////////////////////////////
            var tsorting03 = new MetaTable("sorting03");
            tsorting03.defineColumn("ct", typeof(DateTime), false);
            tsorting03.defineColumn("cu", typeof(string), false);
            tsorting03.defineColumn("defaultN1", typeof(decimal));
            tsorting03.defineColumn("defaultN2", typeof(decimal));
            tsorting03.defineColumn("defaultN3", typeof(decimal));
            tsorting03.defineColumn("defaultN4", typeof(decimal));
            tsorting03.defineColumn("defaultN5", typeof(decimal));
            tsorting03.defineColumn("defaultS1", typeof(string));
            tsorting03.defineColumn("defaultS2", typeof(string));
            tsorting03.defineColumn("defaultS3", typeof(string));
            tsorting03.defineColumn("defaultS4", typeof(string));
            tsorting03.defineColumn("defaultS5", typeof(string));
            tsorting03.defineColumn("defaultv1", typeof(decimal));
            tsorting03.defineColumn("defaultv2", typeof(decimal));
            tsorting03.defineColumn("defaultv3", typeof(decimal));
            tsorting03.defineColumn("defaultv4", typeof(decimal));
            tsorting03.defineColumn("defaultv5", typeof(decimal));
            tsorting03.defineColumn("description", typeof(string), false);
            tsorting03.defineColumn("flagnodate", typeof(string));
            tsorting03.defineColumn("lt", typeof(DateTime), false);
            tsorting03.defineColumn("lu", typeof(string), false);
            tsorting03.defineColumn("movkind", typeof(string));
            tsorting03.defineColumn("printingorder", typeof(string));
            tsorting03.defineColumn("rtf", typeof(Byte[]));
            tsorting03.defineColumn("sortcode", typeof(string), false);
            tsorting03.defineColumn("txt", typeof(string));
            tsorting03.defineColumn("idsorkind", typeof(int), false);
            tsorting03.defineColumn("idsor", typeof(int), false);
            tsorting03.defineColumn("paridsor", typeof(int));
            tsorting03.defineColumn("nlevel", typeof(byte), false);
            tsorting03.defineColumn("start", typeof(short));
            tsorting03.defineColumn("stop", typeof(short));
            Tables.Add(tsorting03);
            tsorting03.defineKey("idsor");

            //////////////////// SORTING04 /////////////////////////////////
            var tsorting04 = new MetaTable("sorting04");
            tsorting04.defineColumn("ct", typeof(DateTime), false);
            tsorting04.defineColumn("cu", typeof(string), false);
            tsorting04.defineColumn("defaultN1", typeof(decimal));
            tsorting04.defineColumn("defaultN2", typeof(decimal));
            tsorting04.defineColumn("defaultN3", typeof(decimal));
            tsorting04.defineColumn("defaultN4", typeof(decimal));
            tsorting04.defineColumn("defaultN5", typeof(decimal));
            tsorting04.defineColumn("defaultS1", typeof(string));
            tsorting04.defineColumn("defaultS2", typeof(string));
            tsorting04.defineColumn("defaultS3", typeof(string));
            tsorting04.defineColumn("defaultS4", typeof(string));
            tsorting04.defineColumn("defaultS5", typeof(string));
            tsorting04.defineColumn("defaultv1", typeof(decimal));
            tsorting04.defineColumn("defaultv2", typeof(decimal));
            tsorting04.defineColumn("defaultv3", typeof(decimal));
            tsorting04.defineColumn("defaultv4", typeof(decimal));
            tsorting04.defineColumn("defaultv5", typeof(decimal));
            tsorting04.defineColumn("description", typeof(string), false);
            tsorting04.defineColumn("flagnodate", typeof(string));
            tsorting04.defineColumn("lt", typeof(DateTime), false);
            tsorting04.defineColumn("lu", typeof(string), false);
            tsorting04.defineColumn("movkind", typeof(string));
            tsorting04.defineColumn("printingorder", typeof(string));
            tsorting04.defineColumn("rtf", typeof(Byte[]));
            tsorting04.defineColumn("sortcode", typeof(string), false);
            tsorting04.defineColumn("txt", typeof(string));
            tsorting04.defineColumn("idsorkind", typeof(int), false);
            tsorting04.defineColumn("idsor", typeof(int), false);
            tsorting04.defineColumn("paridsor", typeof(int));
            tsorting04.defineColumn("nlevel", typeof(byte), false);
            tsorting04.defineColumn("start", typeof(short));
            tsorting04.defineColumn("stop", typeof(short));
            Tables.Add(tsorting04);
            tsorting04.defineKey("idsor");

            //////////////////// SORTING05 /////////////////////////////////
            var tsorting05 = new MetaTable("sorting05");
            tsorting05.defineColumn("ct", typeof(DateTime), false);
            tsorting05.defineColumn("cu", typeof(string), false);
            tsorting05.defineColumn("defaultN1", typeof(decimal));
            tsorting05.defineColumn("defaultN2", typeof(decimal));
            tsorting05.defineColumn("defaultN3", typeof(decimal));
            tsorting05.defineColumn("defaultN4", typeof(decimal));
            tsorting05.defineColumn("defaultN5", typeof(decimal));
            tsorting05.defineColumn("defaultS1", typeof(string));
            tsorting05.defineColumn("defaultS2", typeof(string));
            tsorting05.defineColumn("defaultS3", typeof(string));
            tsorting05.defineColumn("defaultS4", typeof(string));
            tsorting05.defineColumn("defaultS5", typeof(string));
            tsorting05.defineColumn("defaultv1", typeof(decimal));
            tsorting05.defineColumn("defaultv2", typeof(decimal));
            tsorting05.defineColumn("defaultv3", typeof(decimal));
            tsorting05.defineColumn("defaultv4", typeof(decimal));
            tsorting05.defineColumn("defaultv5", typeof(decimal));
            tsorting05.defineColumn("description", typeof(string), false);
            tsorting05.defineColumn("flagnodate", typeof(string));
            tsorting05.defineColumn("lt", typeof(DateTime), false);
            tsorting05.defineColumn("lu", typeof(string), false);
            tsorting05.defineColumn("movkind", typeof(string));
            tsorting05.defineColumn("printingorder", typeof(string));
            tsorting05.defineColumn("rtf", typeof(Byte[]));
            tsorting05.defineColumn("sortcode", typeof(string), false);
            tsorting05.defineColumn("txt", typeof(string));
            tsorting05.defineColumn("idsorkind", typeof(int), false);
            tsorting05.defineColumn("idsor", typeof(int), false);
            tsorting05.defineColumn("paridsor", typeof(int));
            tsorting05.defineColumn("nlevel", typeof(byte), false);
            tsorting05.defineColumn("start", typeof(short));
            tsorting05.defineColumn("stop", typeof(short));
            Tables.Add(tsorting05);
            tsorting05.defineKey("idsor");

            #endregion


            #region DataRelation creation
            this.defineRelation("paydisposition_paydispositiondetail", "paydisposition", "paydispositiondetail", "idpaydisposition");
            this.defineRelation("payment_paydisposition", "payment", "paydisposition", "kpay");
            this.defineRelation("paymentexpenselastview", "payment", "expenselastview", "kpay");
            this.defineRelation("expenseview_expensesorted", "expenselastview", "expensesorted", "idexp");
            this.defineRelation("paymentpayment_bankview", "payment", "payment_bankview", "kpay");
            this.defineRelation("expense1_banktransaction", "expense1", "banktransaction", "idexp");
            this.defineRelation("paymentbanktransaction", "payment", "banktransaction", "kpay");
            this.defineRelation("expenseviewexpensevar", "expenselastview", "expensevar", "idexp");
            var cPar   = new [] { sorting05.Columns["idsor"] };
            var cChild = new [] { payment.Columns["idsor05"] };
            Relations.Add(new DataRelation("sorting05_payment", cPar, cChild, false));

            cPar   = new [] { sorting04.Columns["idsor"] };
            cChild = new [] { payment.Columns["idsor04"] };
            Relations.Add(new DataRelation("sorting04_payment", cPar, cChild, false));

            cPar   = new [] { sorting03.Columns["idsor"] };
            cChild = new [] { payment.Columns["idsor03"] };
            Relations.Add(new DataRelation("sorting03_payment", cPar, cChild, false));

            cPar   = new [] { sorting02.Columns["idsor"] };
            cChild = new [] { payment.Columns["idsor02"] };
            Relations.Add(new DataRelation("sorting02_payment", cPar, cChild, false));

            cPar   = new [] { sorting01.Columns["idsor"] };
            cChild = new [] { payment.Columns["idsor01"] };
            Relations.Add(new DataRelation("sorting01_payment", cPar, cChild, false));

            this.defineRelation("registrypayment", "registry", "payment", "idreg");
            this.defineRelation("treasurerpayment", "treasurer", "payment", "idtreasurer");
            this.defineRelation("stamphandlingpayment", "stamphandling", "payment", "idstamphandling");
            this.defineRelation("managerpayment", "manager", "payment", "idman");
            this.defineRelation("paymenttransmissionpayment", "paymenttransmission", "payment", "kpaymenttransmission");
            this.defineRelation("fin_payment", "fin", "payment", "idfin");
            #endregion
        }
Пример #2
0
        private void initClass()
        {
            DataSetName = "dsmeta";
            Prefix      = "";
            Namespace   = "http://tempuri.org/dsmeta.xsd";

            #region create DataTables
            //////////////////// INVOICEDETAIL /////////////////////////////////
            var tinvoicedetail = new invoicedetailTable();
            tinvoicedetail.addBaseColumns("idinvkind", "yinv", "ninv", "rownum", "idgroup", "idivakind", "detaildescription", "annotations", "taxable", "tax", "unabatable", "cu", "ct", "lu", "lt", "discount", "idmankind", "yman", "nman", "manrownum", "number", "idupb", "idsor1", "idsor2", "idsor3", "competencystart", "competencystop", "idexp_taxable", "idexp_iva", "idaccmotive", "idestimkind", "estimrownum", "nestim", "yestim", "idintrastatcode", "idintrastatmeasure", "weight", "va3type", "idlist", "idpackage", "idunit", "npackage", "unitsforpackage", "flag", "intrastatoperationkind", "intra12operationkind", "exception12", "move12", "idupb_iva", "idintrastatservice", "idintrastatsupplymethod", "leasing", "usedmodesospesometro", "resetresidualmandate", "idcostpartition", "idpccdebitmotive", "idpccdebitstatus", "expensekind", "rounding", "idepexp", "idepacc", "ycon", "ncon", "idsor_siope");
            tinvoicedetail.defineColumn("!codeupb", typeof(string));
            tinvoicedetail.defineColumn("!disponibile", typeof(decimal));
            tinvoicedetail.defineColumn("!idexptolink", typeof(string));
            tinvoicedetail.defineColumn("!monomandate", typeof(string));
            tinvoicedetail.defineColumn("!tipoiva", typeof(string));
            tinvoicedetail.defineColumn("!totaleriga", typeof(decimal));
            tinvoicedetail.defineColumn("!aliquota", typeof(decimal));
            tinvoicedetail.defineColumn("!codeupb_iva", typeof(string));
            Tables.Add(tinvoicedetail);
            tinvoicedetail.defineKey("idinvkind", "yinv", "ninv", "rownum");

            //////////////////// EXPENSEPHASE /////////////////////////////////
            var texpensephase = new MetaTable("expensephase");
            texpensephase.defineColumn("nphase", typeof(byte), false);
            texpensephase.defineColumn("ct", typeof(DateTime), false);
            texpensephase.defineColumn("cu", typeof(string), false);
            texpensephase.defineColumn("description", typeof(string), false);
            texpensephase.defineColumn("lt", typeof(DateTime), false);
            texpensephase.defineColumn("lu", typeof(string), false);
            Tables.Add(texpensephase);
            texpensephase.defineKey("nphase");

            //////////////////// INVOICEKIND /////////////////////////////////
            var tinvoicekind = new invoicekindTable();
            tinvoicekind.addBaseColumns("idinvkind", "flag", "ct", "cu", "description", "lt", "lu", "active", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05");
            Tables.Add(tinvoicekind);
            tinvoicekind.defineKey("idinvkind");

            //////////////////// IVAKIND /////////////////////////////////
            var tivakind = new ivakindTable();
            tivakind.addBaseColumns("idivakind", "ct", "cu", "description", "lt", "lu", "rate", "unabatabilitypercentage", "active");
            Tables.Add(tivakind);
            tivakind.defineKey("idivakind");

            //////////////////// EXPENSE /////////////////////////////////
            var texpense = new expenseTable();
            texpense.addBaseColumns("adate", "ct", "cu", "description", "doc", "docdate", "expiration", "idreg", "lt", "lu", "nmov", "rtf", "txt", "ymov", "idclawback", "idman", "nphase", "idexp", "parentidexp", "idpayment", "idformerexpense", "autokind", "autocode");
            Tables.Add(texpense);
            texpense.defineKey("idexp");

            //////////////////// REGISTRY /////////////////////////////////
            var tregistry = new registryTable();
            tregistry.addBaseColumns("idreg", "active", "annotation", "badgecode", "birthdate", "cf", "ct", "cu", "extmatricula", "foreigncf", "forename", "gender", "idcategory", "idcentralizedcategory", "idcity", "idmaritalstatus", "idnation", "idregistryclass", "idtitle", "location", "lt", "lu", "maritalsurname", "p_iva", "residence", "rtf", "surname", "title", "txt");
            Tables.Add(tregistry);
            tregistry.defineKey("idreg");

            //////////////////// EXPENSEYEAR /////////////////////////////////
            var texpenseyear = new expenseyearTable();
            texpenseyear.addBaseColumns("ayear", "idexp", "amount", "ct", "cu", "idfin", "idupb", "lt", "lu");
            Tables.Add(texpenseyear);
            texpenseyear.defineKey("ayear", "idexp");

            //////////////////// FIN /////////////////////////////////
            var tfin = new finTable();
            tfin.addBaseColumns("idfin", "ayear", "flag", "codefin", "paridfin", "nlevel", "printingorder", "title", "cu", "ct", "lu", "lt");
            Tables.Add(tfin);
            tfin.defineKey("idfin");

            //////////////////// UPB /////////////////////////////////
            var tupb = new upbTable();
            tupb.addBaseColumns("idupb", "active", "assured", "codeupb", "ct", "cu", "expiration", "granted", "idman", "idunderwriter", "lt", "lu", "paridupb", "previousappropriation", "previousassessment", "printingorder", "requested", "rtf", "title", "txt", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05");
            Tables.Add(tupb);
            tupb.defineKey("idupb");

            //////////////////// TIPOMOVIMENTO /////////////////////////////////
            var ttipomovimento = new MetaTable("tipomovimento");
            ttipomovimento.defineColumn("idtipo", typeof(string), false);
            ttipomovimento.defineColumn("descrizione", typeof(string), false);
            Tables.Add(ttipomovimento);
            ttipomovimento.defineKey("idtipo");

            //////////////////// INVOICE /////////////////////////////////
            var tinvoice = new invoiceTable();
            tinvoice.addBaseColumns("idinvkind", "ninv", "yinv", "active", "adate", "ct", "cu", "description", "doc", "docdate", "exchangerate", "flagdeferred", "idcurrency", "idexpirationkind", "idreg", "lt", "lu", "officiallyprinted", "packinglistdate", "packinglistnum", "paymentexpiring", "registryreference", "rtf", "txt", "idaccmotivedebit", "idaccmotivedebit_crg", "flag", "idblacklist", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05", "flag_enable_split_payment", "flag_auto_split_payment", "requested_doc", "flagbit", "flagintracom");
            Tables.Add(tinvoice);
            tinvoice.defineKey("idinvkind", "ninv", "yinv");

            //////////////////// EXPENSEINVOICE /////////////////////////////////
            var texpenseinvoice = new MetaTable("expenseinvoice");
            texpenseinvoice.defineColumn("idexp", typeof(int), false);
            texpenseinvoice.defineColumn("idinvkind", typeof(int), false);
            texpenseinvoice.defineColumn("ninv", typeof(int), false);
            texpenseinvoice.defineColumn("yinv", typeof(short), false);
            texpenseinvoice.defineColumn("ct", typeof(DateTime), false);
            texpenseinvoice.defineColumn("cu", typeof(string), false);
            texpenseinvoice.defineColumn("lt", typeof(DateTime), false);
            texpenseinvoice.defineColumn("lu", typeof(string), false);
            texpenseinvoice.defineColumn("movkind", typeof(short));
            Tables.Add(texpenseinvoice);
            texpenseinvoice.defineKey("idexp", "idinvkind", "ninv", "yinv");

            //////////////////// EXPENSELAST /////////////////////////////////
            var texpenselast = new expenselastTable();
            texpenselast.addBaseColumns("idexp", "cc", "cin", "ct", "cu", "flag", "idbank", "idcab", "iddeputy", "idpay", "idpaymethod", "idregistrypaymethod", "idser", "ivaamount", "lt", "lu", "nbill", "paymentdescr", "servicestart", "servicestop", "refexternaldoc", "kpay", "iban", "idaccdebit", "biccode", "paymethod_flag", "paymethod_allowdeputy", "extracode", "idchargehandling");
            Tables.Add(texpenselast);
            texpenselast.defineKey("idexp");

            //////////////////// BILL /////////////////////////////////
            var tbill = new billTable();
            tbill.addBaseColumns("ybill", "nbill", "billkind", "registry", "covered", "total", "adate", "active", "motive", "cu", "ct", "lu", "lt");
            Tables.Add(tbill);
            tbill.defineKey("nbill");

            //////////////////// BILLVIEW /////////////////////////////////
            var tbillview = new MetaTable("billview");
            tbillview.defineColumn("ybill", typeof(short), false);
            tbillview.defineColumn("nbill", typeof(int), false);
            tbillview.defineColumn("billkind", typeof(string), false);
            tbillview.defineColumn("active", typeof(string));
            tbillview.defineColumn("adate", typeof(DateTime));
            tbillview.defineColumn("registry", typeof(string));
            tbillview.defineColumn("motive", typeof(string));
            tbillview.defineColumn("total", typeof(decimal));
            tbillview.defineColumn("covered", typeof(decimal));
            tbillview.defineColumn("cu", typeof(string), false);
            tbillview.defineColumn("ct", typeof(DateTime), false);
            tbillview.defineColumn("lu", typeof(string), false);
            tbillview.defineColumn("lt", typeof(DateTime), false);
            tbillview.defineColumn("idtreasurer", typeof(int));
            tbillview.defineColumn("treasurer", typeof(string));
            tbillview.defineColumn("regularizationnote", typeof(string));
            tbillview.defineColumn("idsor01", typeof(int));
            tbillview.defineColumn("idsor02", typeof(int));
            tbillview.defineColumn("idsor03", typeof(int));
            tbillview.defineColumn("idsor04", typeof(int));
            tbillview.defineColumn("idsor05", typeof(int));
            Tables.Add(tbillview);

            //////////////////// ACCOUNT /////////////////////////////////
            var taccount = new accountTable();
            taccount.addBaseColumns("idacc", "ayear", "codeacc", "ct", "cu", "flagregistry", "flagtransitory", "flagupb", "idaccountkind", "lt", "lu", "nlevel", "paridacc", "printingorder", "rtf", "title", "txt", "idpatrimony", "idplaccount", "flagprofit", "flagloss", "placcount_sign", "patrimony_sign", "flagcompetency", "flag");
            Tables.Add(taccount);
            taccount.defineKey("idacc");

            //////////////////// EXPENSECLAWBACK /////////////////////////////////
            var texpenseclawback = new MetaTable("expenseclawback");
            texpenseclawback.defineColumn("idexp", typeof(int), false);
            texpenseclawback.defineColumn("idclawback", typeof(int), false);
            texpenseclawback.defineColumn("amount", typeof(decimal));
            texpenseclawback.defineColumn("cu", typeof(string), false);
            texpenseclawback.defineColumn("ct", typeof(DateTime), false);
            texpenseclawback.defineColumn("lu", typeof(string), false);
            texpenseclawback.defineColumn("lt", typeof(DateTime), false);
            texpenseclawback.defineColumn("!clawbackref", typeof(string));
            texpenseclawback.defineColumn("fiscaltaxcode", typeof(string));
            texpenseclawback.defineColumn("identifying_marks", typeof(string));
            texpenseclawback.defineColumn("code", typeof(string));
            texpenseclawback.defineColumn("tiporiga", typeof(string));
            texpenseclawback.defineColumn("rifb_month", typeof(int));
            texpenseclawback.defineColumn("rifb_year", typeof(int));
            texpenseclawback.defineColumn("rifa_month", typeof(int));
            texpenseclawback.defineColumn("rifa_year", typeof(int));
            texpenseclawback.defineColumn("rifa", typeof(string));
            Tables.Add(texpenseclawback);
            texpenseclawback.defineKey("idexp", "idclawback");

            //////////////////// CLAWBACK /////////////////////////////////
            var tclawback = new MetaTable("clawback");
            tclawback.defineColumn("idclawback", typeof(int), false);
            tclawback.defineColumn("description", typeof(string), false);
            tclawback.defineColumn("cu", typeof(string), false);
            tclawback.defineColumn("ct", typeof(DateTime), false);
            tclawback.defineColumn("lu", typeof(string), false);
            tclawback.defineColumn("lt", typeof(DateTime), false);
            tclawback.defineColumn("clawbackref", typeof(string));
            tclawback.defineColumn("active", typeof(string));
            tclawback.defineColumn("flagf24ep", typeof(string));
            Tables.Add(tclawback);
            tclawback.defineKey("idclawback");

            //////////////////// CONFIG /////////////////////////////////
            var tconfig = new configTable();
            tconfig.addBaseColumns("ayear", "agencycode", "appname", "appropriationphasecode", "assessmentphasecode", "asset_flagnumbering", "asset_flagrestart", "assetload_flag", "boxpartitiontitle", "casualcontract_flagrestart", "ct", "cu", "currpartitiontitle", "deferredexpensephase", "deferredincomephase", "electronicimport", "electronictrasmission", "expense_expiringdays", "expensephase", "flagautopayment", "flagautoproceeds", "flagcredit", "flagepexp", "flagfruitful", "flagpayment", "flagproceeds", "flagrefund", "foreignhours", "idacc_accruedcost", "idacc_accruedrevenue", "idacc_customer", "idacc_deferredcost", "idacc_deferredcredit", "idacc_deferreddebit", "idacc_deferredrevenue", "idacc_ivapayment", "idacc_ivarefund", "idacc_patrimony", "idacc_pl", "idacc_supplier", "idaccmotive_admincar", "idaccmotive_foot", "idaccmotive_owncar", "idclawback", "idfinexpense", "idfinexpensesurplus", "idfinincomesurplus", "idfinivapayment", "idfinivarefund", "idregauto", "importappname", "income_expiringdays", "incomephase", "linktoinvoice", "lt", "lu", "minpayment", "minrefund", "motivelen", "motiveprefix", "motiveseparator", "payment_finlevel", "payment_flag", "payment_flagautoprintdate", "paymentagency", "prevpartitiontitle", "proceeds_finlevel", "proceeds_flag", "proceeds_flagautoprintdate", "profservice_flagrestart", "refundagency", "wageaddition_flagrestart", "idivapayperiodicity", "idsortingkind1", "idsortingkind2", "idsortingkind3", "fin_kind", "taxvaliditykind", "flag_paymentamount", "automanagekind", "flag_autodocnumbering", "flagbank_grouping", "cashvaliditykind");
            Tables.Add(tconfig);
            tconfig.defineKey("ayear");

            //////////////////// INVOICEDETAILDEFERRED /////////////////////////////////
            var tinvoicedetaildeferred = new MetaTable("invoicedetaildeferred");
            tinvoicedetaildeferred.defineColumn("idinvkind", typeof(int), false);
            tinvoicedetaildeferred.defineColumn("yinv", typeof(short), false);
            tinvoicedetaildeferred.defineColumn("ninv", typeof(int), false);
            tinvoicedetaildeferred.defineColumn("rownum", typeof(int), false);
            tinvoicedetaildeferred.defineColumn("yivapay", typeof(short), false);
            tinvoicedetaildeferred.defineColumn("nivapay", typeof(int), false);
            tinvoicedetaildeferred.defineColumn("ivatotalpayed", typeof(decimal));
            tinvoicedetaildeferred.defineColumn("taxable", typeof(decimal));
            tinvoicedetaildeferred.defineColumn("cu", typeof(string));
            tinvoicedetaildeferred.defineColumn("ct", typeof(DateTime));
            tinvoicedetaildeferred.defineColumn("lu", typeof(string));
            tinvoicedetaildeferred.defineColumn("lt", typeof(string));
            tinvoicedetaildeferred.defineColumn("idivaregisterkind", typeof(int), false);
            Tables.Add(tinvoicedetaildeferred);
            tinvoicedetaildeferred.defineKey("idinvkind", "yinv", "ninv", "rownum", "yivapay", "nivapay", "idivaregisterkind");

            //////////////////// EXPENSESORTED /////////////////////////////////
            var texpensesorted = new expensesortedTable();
            texpensesorted.addBaseColumns("idsor", "idexp", "idsubclass", "amount", "valuen1", "valuen2", "valuen3", "valuen4", "valuen5", "values1", "values2", "values3", "values4", "values5", "valuev1", "valuev2", "valuev3", "valuev4", "valuev5", "ayear", "description", "txt", "rtf", "cu", "ct", "lu", "lt", "flagnodate", "tobecontinued", "start", "stop", "paridsor", "paridsubclass");
            Tables.Add(texpensesorted);
            texpensesorted.defineKey("idexp", "idsor", "idsubclass");

            #endregion


            #region DataRelation creation
            this.defineRelation("invoicedetail_invoicedetaildeferred", "invoicedetail", "invoicedetaildeferred", "idinvkind", "yinv", "ninv", "rownum");
            this.defineRelation("expense_expenseclawback", "expense", "expenseclawback", "idexp");
            this.defineRelation("clawback_expenseclawback", "clawback", "expenseclawback", "idclawback");
            var cPar   = new [] { account.Columns["idacc"] };
            var cChild = new [] { expenselast.Columns["idaccdebit"] };
            Relations.Add(new DataRelation("account_expenselast", cPar, cChild, false));

            this.defineRelation("bill_expenselast", "bill", "expenselast", "nbill");
            this.defineRelation("expense_expenselast", "expense", "expenselast", "idexp");
            this.defineRelation("FK_expense_expenseinvoice", "expense", "expenseinvoice", "idexp");
            this.defineRelation("FK_invoice_expenseinvoice", "invoice", "expenseinvoice", "idinvkind", "ninv", "yinv");
            this.defineRelation("invoicekind_invoice", "invoicekind", "invoice", "idinvkind");
            this.defineRelation("upb_expenseyear", "upb", "expenseyear", "idupb");
            this.defineRelation("fin_expenseyear", "fin", "expenseyear", "idfin");
            this.defineRelation("expense_expenseyear", "expense", "expenseyear", "idexp");
            this.defineRelation("registry_expense", "registry", "expense", "idreg");
            cPar   = new [] { expense.Columns["idexp"] };
            cChild = new [] { expense.Columns["parentidexp"] };
            Relations.Add(new DataRelation("expense_expense", cPar, cChild, false));

            cPar   = new [] { expense.Columns["idexp"] };
            cChild = new [] { invoicedetail.Columns["idexp_iva"] };
            Relations.Add(new DataRelation("expense_invoicedetail1", cPar, cChild, false));

            this.defineRelation("invoice_invoicedetail", "invoice", "invoicedetail", "idinvkind", "ninv", "yinv");
            cPar   = new [] { expense.Columns["idexp"] };
            cChild = new [] { invoicedetail.Columns["idexp_taxable"] };
            Relations.Add(new DataRelation("expense_invoicedetail", cPar, cChild, false));

            this.defineRelation("ivakind_invoicedetail", "ivakind", "invoicedetail", "idivakind");
            this.defineRelation("expense_expensesorted", "expense", "expensesorted", "idexp");
            #endregion
        }