Ejemplo n.º 1
0
        private void initClass()
        {
            DataSetName = "dsmeta";
            Prefix      = "";
            Namespace   = "http://tempuri.org/dsmeta.xsd";

            #region create DataTables
            //////////////////// ESTIMATEDETAIL /////////////////////////////////
            var testimatedetail = new estimatedetailTable();
            testimatedetail.addBaseColumns("idestimkind", "nestim", "rownum", "yestim", "annotations", "ct", "cu", "detaildescription", "discount", "idinc_iva", "idinc_taxable", "idsor1", "idsor2", "idsor3", "idupb", "lt", "lu", "ninvoiced", "number", "start", "stop", "tax", "taxable", "taxrate", "toinvoice", "idaccmotive", "idivakind", "idreg", "idgroup", "competencystart", "competencystop", "idaccmotiveannulment", "epkind", "idrevenuepartition", "idupb_iva", "idepacc", "idlist", "cigcode", "iduniqueformcode", "nform", "idfinmotive", "flag", "proceedsexpiring", "idsor_siope", "idepacc_pre");
            Tables.Add(testimatedetail);
            testimatedetail.defineKey("idestimkind", "nestim", "rownum", "yestim");

            //////////////////// 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");

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

            //////////////////// INVOICEDETAIL /////////////////////////////////
            var tinvoicedetail = new invoicedetailTable();
            tinvoicedetail.addBaseColumns("idinvkind", "ninv", "rownum", "yinv", "annotations", "competencystart", "competencystop", "ct", "cu", "detaildescription", "discount", "idaccmotive", "idivakind", "idmankind", "idsor1", "idsor2", "idsor3", "idupb", "lt", "lu", "manrownum", "nman", "number", "tax", "taxable", "unabatable", "yman", "idestimkind", "yestim", "nestim", "estimrownum", "idgroup");
            tinvoicedetail.defineColumn("!tipodocumento", typeof(string));
            Tables.Add(tinvoicedetail);
            tinvoicedetail.defineKey("idinvkind", "ninv", "rownum", "yinv");

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

            //////////////////// SORTING1 /////////////////////////////////
            var tsorting1 = new sortingTable();
            tsorting1.TableName = "sorting1";
            tsorting1.addBaseColumns("idsor", "idsorkind", "ct", "cu", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5", "description", "flagnodate", "lt", "lu", "movkind", "nlevel", "paridsor", "printingorder", "rtf", "sortcode", "txt");
            tsorting1.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting1);
            tsorting1.defineKey("idsor");

            //////////////////// SORTING2 /////////////////////////////////
            var tsorting2 = new sortingTable();
            tsorting2.TableName = "sorting2";
            tsorting2.addBaseColumns("idsor", "idsorkind", "ct", "cu", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5", "description", "flagnodate", "lt", "lu", "movkind", "nlevel", "paridsor", "printingorder", "rtf", "sortcode", "txt");
            tsorting2.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting2);
            tsorting2.defineKey("idsor");

            //////////////////// SORTING3 /////////////////////////////////
            var tsorting3 = new sortingTable();
            tsorting3.TableName = "sorting3";
            tsorting3.addBaseColumns("idsor", "idsorkind", "ct", "cu", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5", "description", "flagnodate", "lt", "lu", "movkind", "nlevel", "paridsor", "printingorder", "rtf", "sortcode", "txt");
            tsorting3.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting3);
            tsorting3.defineKey("idsor");

            //////////////////// ACCMOTIVEAPPLIED /////////////////////////////////
            var taccmotiveapplied = new accmotiveappliedTable();
            taccmotiveapplied.addBaseColumns("idaccmotive", "paridaccmotive", "codemotive", "motive", "cu", "ct", "lu", "lt", "active", "idepoperation", "epoperation", "in_use", "flagdep", "flagamm");
            Tables.Add(taccmotiveapplied);
            taccmotiveapplied.defineKey("idaccmotive");

            //////////////////// INCOME_IMPONIBILE /////////////////////////////////
            var tincome_imponibile = new incomeTable();
            tincome_imponibile.TableName = "income_imponibile";
            tincome_imponibile.addBaseColumns("idinc", "nphase", "ymov", "nmov", "parentidinc", "idreg", "idman", "doc", "docdate", "description", "autokind", "autocode", "idpayment", "expiration", "adate", "cu", "ct", "lu", "lt");
            tincome_imponibile.ExtendedProperties["TableForReading"] = "income";
            Tables.Add(tincome_imponibile);
            tincome_imponibile.defineKey("idinc");

            //////////////////// INCOME_IVA /////////////////////////////////
            var tincome_iva = new incomeTable();
            tincome_iva.TableName = "income_iva";
            tincome_iva.addBaseColumns("idinc", "nphase", "ymov", "nmov", "parentidinc", "idreg", "idman", "doc", "docdate", "description", "autokind", "autocode", "idpayment", "expiration", "adate", "cu", "ct", "lu", "lt");
            tincome_iva.ExtendedProperties["TableForReading"] = "income";
            Tables.Add(tincome_iva);
            tincome_iva.defineKey("idinc");

            //////////////////// REGISTRYMAINVIEW /////////////////////////////////
            var tregistrymainview = new MetaTable("registrymainview");
            tregistrymainview.defineColumn("idreg", typeof(int), false);
            tregistrymainview.defineColumn("title", typeof(string), false);
            tregistrymainview.defineColumn("idregistryclass", typeof(string));
            tregistrymainview.defineColumn("registryclass", typeof(string));
            tregistrymainview.defineColumn("surname", typeof(string));
            tregistrymainview.defineColumn("forename", typeof(string));
            tregistrymainview.defineColumn("cf", typeof(string));
            tregistrymainview.defineColumn("p_iva", typeof(string));
            tregistrymainview.defineColumn("residence", typeof(int), false);
            tregistrymainview.defineColumn("residencekind", typeof(string));
            tregistrymainview.defineColumn("annotation", typeof(string));
            tregistrymainview.defineColumn("birthdate", typeof(DateTime));
            tregistrymainview.defineColumn("idcity", typeof(int));
            tregistrymainview.defineColumn("city", typeof(string));
            tregistrymainview.defineColumn("gender", typeof(string));
            tregistrymainview.defineColumn("foreigncf", typeof(string));
            tregistrymainview.defineColumn("idtitle", typeof(string));
            tregistrymainview.defineColumn("qualification", typeof(string));
            tregistrymainview.defineColumn("idmaritalstatus", typeof(string));
            tregistrymainview.defineColumn("maritalstatus", typeof(string));
            tregistrymainview.defineColumn("sortcode", typeof(string));
            tregistrymainview.defineColumn("registrykind", typeof(string));
            tregistrymainview.defineColumn("human", typeof(string));
            tregistrymainview.defineColumn("active", typeof(string), false);
            tregistrymainview.defineColumn("badgecode", typeof(string));
            tregistrymainview.defineColumn("maritalsurname", typeof(string));
            tregistrymainview.defineColumn("idcategory", typeof(string));
            tregistrymainview.defineColumn("extmatricula", typeof(string));
            tregistrymainview.defineColumn("idcentralizedcategory", typeof(string));
            tregistrymainview.defineColumn("cu", typeof(string), false);
            tregistrymainview.defineColumn("ct", typeof(DateTime), false);
            tregistrymainview.defineColumn("lu", typeof(string), false);
            tregistrymainview.defineColumn("lt", typeof(DateTime), false);
            tregistrymainview.defineColumn("location", typeof(string));
            tregistrymainview.defineColumn("idnation", typeof(int));
            tregistrymainview.defineColumn("nation", typeof(string));
            Tables.Add(tregistrymainview);
            tregistrymainview.defineKey("idreg");

            //////////////////// ACCMOTIVEAPPLIEDANNULMENT /////////////////////////////////
            var taccmotiveappliedannulment = new MetaTable("accmotiveappliedannulment");
            taccmotiveappliedannulment.defineColumn("idaccmotive", typeof(string), false);
            taccmotiveappliedannulment.defineColumn("paridaccmotive", typeof(string));
            taccmotiveappliedannulment.defineColumn("codemotive", typeof(string), false);
            taccmotiveappliedannulment.defineColumn("motive", typeof(string), false);
            taccmotiveappliedannulment.defineColumn("cu", typeof(string), false);
            taccmotiveappliedannulment.defineColumn("ct", typeof(DateTime), false);
            taccmotiveappliedannulment.defineColumn("lu", typeof(string), false);
            taccmotiveappliedannulment.defineColumn("lt", typeof(DateTime), false);
            taccmotiveappliedannulment.defineColumn("active", typeof(string));
            taccmotiveappliedannulment.defineColumn("idepoperation", typeof(string));
            taccmotiveappliedannulment.defineColumn("epoperation", typeof(string));
            taccmotiveappliedannulment.defineColumn("in_use", typeof(string));
            taccmotiveappliedannulment.defineColumn("flagdep", typeof(string));
            taccmotiveappliedannulment.defineColumn("flagamm", typeof(string));
            Tables.Add(taccmotiveappliedannulment);
            taccmotiveappliedannulment.defineKey("idaccmotive");

            //////////////////// REVENUEPARTITION /////////////////////////////////
            var trevenuepartition = new MetaTable("revenuepartition");
            trevenuepartition.defineColumn("idrevenuepartition", typeof(int), false);
            trevenuepartition.defineColumn("title", typeof(string));
            trevenuepartition.defineColumn("kind", typeof(string));
            trevenuepartition.defineColumn("lt", typeof(DateTime));
            trevenuepartition.defineColumn("lu", typeof(string));
            trevenuepartition.defineColumn("ct", typeof(DateTime));
            trevenuepartition.defineColumn("cu", typeof(string));
            trevenuepartition.defineColumn("revenuepartitioncode", typeof(string));
            trevenuepartition.defineColumn("active", typeof(string));
            trevenuepartition.defineColumn("description", typeof(string));
            Tables.Add(trevenuepartition);
            trevenuepartition.defineKey("idrevenuepartition");

            //////////////////// UPB_IVA /////////////////////////////////
            var tupb_iva = new upbTable();
            tupb_iva.TableName = "upb_iva";
            tupb_iva.addBaseColumns("idupb", "active", "assured", "codeupb", "ct", "cu", "expiration", "granted", "lt", "lu", "paridupb", "previousappropriation", "previousassessment", "printingorder", "requested", "rtf", "title", "txt", "idman", "idunderwriter", "cupcode", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05", "flagactivity", "flagkind", "newcodeupb", "idtreasurer", "start", "stop", "cigcode", "idepupbkind");
            tupb_iva.ExtendedProperties["TableForReading"] = "upb";
            Tables.Add(tupb_iva);
            tupb_iva.defineKey("idupb");

            //////////////////// LISTVIEW /////////////////////////////////
            var tlistview = new MetaTable("listview");
            tlistview.defineColumn("idlist", typeof(int), false);
            tlistview.defineColumn("description", typeof(string), false);
            tlistview.defineColumn("intcode", typeof(string), false);
            tlistview.defineColumn("intbarcode", typeof(string));
            tlistview.defineColumn("extcode", typeof(string));
            tlistview.defineColumn("extbarcode", typeof(string));
            tlistview.defineColumn("validitystop", typeof(DateTime));
            tlistview.defineColumn("active", typeof(string), false);
            tlistview.defineColumn("idpackage", typeof(int));
            tlistview.defineColumn("package", typeof(string));
            tlistview.defineColumn("idunit", typeof(int));
            tlistview.defineColumn("unit", typeof(string));
            tlistview.defineColumn("unitsforpackage", typeof(int));
            tlistview.defineColumn("has_expiry", typeof(string), false);
            tlistview.defineColumn("idlistclass", typeof(string), false);
            tlistview.defineColumn("codelistclass", typeof(string), false);
            tlistview.defineColumn("listclass", typeof(string), false);
            tlistview.defineColumn("pic", typeof(Byte[]));
            tlistview.defineColumn("timesupply", typeof(int));
            tlistview.defineColumn("nmaxorder", typeof(decimal));
            tlistview.defineColumn("authrequired", typeof(string));
            tlistview.defineColumn("assetkind", typeof(string));
            tlistview.defineColumn("flagvisiblekind", typeof(byte));
            Tables.Add(tlistview);
            tlistview.defineKey("idlist");

            //////////////////// LISTCLASS /////////////////////////////////
            var tlistclass = new MetaTable("listclass");
            tlistclass.defineColumn("idlistclass", typeof(string), false);
            tlistclass.defineColumn("active", typeof(string), false);
            tlistclass.defineColumn("codelistclass", typeof(string), false);
            tlistclass.defineColumn("paridlistclass", typeof(string));
            tlistclass.defineColumn("printingorder", typeof(string), false);
            tlistclass.defineColumn("title", typeof(string), false);
            tlistclass.defineColumn("rtf", typeof(Byte[]));
            tlistclass.defineColumn("txt", typeof(string));
            tlistclass.defineColumn("ct", typeof(DateTime), false);
            tlistclass.defineColumn("cu", typeof(string), false);
            tlistclass.defineColumn("lt", typeof(DateTime), false);
            tlistclass.defineColumn("lu", typeof(string), false);
            tlistclass.defineColumn("authrequired", typeof(string));
            tlistclass.defineColumn("idaccmotive", typeof(string));
            tlistclass.defineColumn("idinv", typeof(int));
            tlistclass.defineColumn("assetkind", typeof(string));
            tlistclass.defineColumn("va3type", typeof(string));
            tlistclass.defineColumn("flag", typeof(int));
            tlistclass.defineColumn("idintrastatsupplymethod", typeof(int));
            tlistclass.defineColumn("intra12operationkind", typeof(string));
            tlistclass.defineColumn("flagvisiblekind", typeof(byte));
            Tables.Add(tlistclass);
            tlistclass.defineKey("idlistclass");

            //////////////////// EPACC /////////////////////////////////
            var tepacc = new MetaTable("epacc");
            tepacc.defineColumn("idepacc", typeof(int), false);
            tepacc.defineColumn("adate", typeof(DateTime), false);
            tepacc.defineColumn("ct", typeof(DateTime), false);
            tepacc.defineColumn("cu", typeof(string), false);
            tepacc.defineColumn("description", typeof(string), false);
            tepacc.defineColumn("doc", typeof(string));
            tepacc.defineColumn("docdate", typeof(DateTime));
            tepacc.defineColumn("idman", typeof(int));
            tepacc.defineColumn("idreg", typeof(int));
            tepacc.defineColumn("idrelated", typeof(string));
            tepacc.defineColumn("lt", typeof(DateTime), false);
            tepacc.defineColumn("lu", typeof(string), false);
            tepacc.defineColumn("nepacc", typeof(int), false);
            tepacc.defineColumn("nphase", typeof(short), false);
            tepacc.defineColumn("paridepacc", typeof(int));
            tepacc.defineColumn("rtf", typeof(Byte[]));
            tepacc.defineColumn("start", typeof(DateTime));
            tepacc.defineColumn("stop", typeof(DateTime));
            tepacc.defineColumn("txt", typeof(string));
            tepacc.defineColumn("yepacc", typeof(short), false);
            tepacc.defineColumn("flagvariation", typeof(string));
            Tables.Add(tepacc);
            tepacc.defineKey("idepacc");

            //////////////////// FINMOTIVE_INCOME /////////////////////////////////
            var tfinmotive_income = new MetaTable("finmotive_income");
            tfinmotive_income.defineColumn("idfinmotive", typeof(string), false);
            tfinmotive_income.defineColumn("active", typeof(string), false);
            tfinmotive_income.defineColumn("codemotive", typeof(string), false);
            tfinmotive_income.defineColumn("paridfinmotive", typeof(string));
            tfinmotive_income.defineColumn("title", typeof(string), false);
            tfinmotive_income.defineColumn("lt", typeof(DateTime));
            tfinmotive_income.defineColumn("lu", typeof(string));
            tfinmotive_income.defineColumn("ct", typeof(DateTime));
            tfinmotive_income.defineColumn("cu", typeof(string));
            tfinmotive_income.ExtendedProperties["TableForReading"] = "finmotive";
            Tables.Add(tfinmotive_income);
            tfinmotive_income.defineKey("idfinmotive");

            //////////////////// SORTING_SIOPE /////////////////////////////////
            var tsorting_siope = new sortingTable();
            tsorting_siope.TableName = "sorting_siope";
            tsorting_siope.addBaseColumns("ct", "cu", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5", "description", "flagnodate", "lt", "lu", "movkind", "printingorder", "rtf", "sortcode", "txt", "idsorkind", "idsor", "paridsor", "nlevel", "start", "stop", "email");
            tsorting_siope.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting_siope);
            tsorting_siope.defineKey("idsor");

            //////////////////// PRE_EPACC /////////////////////////////////
            var tpre_epacc = new MetaTable("pre_epacc");
            tpre_epacc.defineColumn("idepacc", typeof(int), false);
            tpre_epacc.defineColumn("adate", typeof(DateTime), false);
            tpre_epacc.defineColumn("ct", typeof(DateTime), false);
            tpre_epacc.defineColumn("cu", typeof(string), false);
            tpre_epacc.defineColumn("description", typeof(string), false);
            tpre_epacc.defineColumn("doc", typeof(string));
            tpre_epacc.defineColumn("docdate", typeof(DateTime));
            tpre_epacc.defineColumn("idman", typeof(int));
            tpre_epacc.defineColumn("idreg", typeof(int));
            tpre_epacc.defineColumn("idrelated", typeof(string));
            tpre_epacc.defineColumn("lt", typeof(DateTime), false);
            tpre_epacc.defineColumn("lu", typeof(string), false);
            tpre_epacc.defineColumn("nepacc", typeof(int), false);
            tpre_epacc.defineColumn("nphase", typeof(short), false);
            tpre_epacc.defineColumn("paridepacc", typeof(int));
            tpre_epacc.defineColumn("rtf", typeof(Byte[]));
            tpre_epacc.defineColumn("start", typeof(DateTime));
            tpre_epacc.defineColumn("stop", typeof(DateTime));
            tpre_epacc.defineColumn("txt", typeof(string));
            tpre_epacc.defineColumn("yepacc", typeof(short), false);
            tpre_epacc.defineColumn("flagvariation", typeof(string));
            tpre_epacc.ExtendedProperties["TableForReading"] = "epacc";
            Tables.Add(tpre_epacc);
            tpre_epacc.defineKey("idepacc");

            #endregion


            #region DataRelation creation
            var cPar   = new [] { estimatedetail.Columns["idestimkind"], estimatedetail.Columns["nestim"], estimatedetail.Columns["rownum"], estimatedetail.Columns["yestim"] };
            var cChild = new [] { invoicedetail.Columns["idestimkind"], invoicedetail.Columns["nestim"], invoicedetail.Columns["estimrownum"], invoicedetail.Columns["yestim"] };
            Relations.Add(new DataRelation("estimatedetailinvoicedetail", cPar, cChild, false));

            this.defineRelation("invoicekindinvoicedetail", "invoicekind", "invoicedetail", "idinvkind");
            this.defineRelation("FK_epacc_estimatedetail", "epacc", "estimatedetail", "idepacc");
            this.defineRelation("FK_listview_estimatedetail", "listview", "estimatedetail", "idlist");
            cPar   = new [] { upb_iva.Columns["idupb"] };
            cChild = new [] { estimatedetail.Columns["idupb_iva"] };
            Relations.Add(new DataRelation("FK_upb_iva_estimatedetail", cPar, cChild, false));

            this.defineRelation("registrymainviewestimatedetail", "registrymainview", "estimatedetail", "idreg");
            cPar   = new [] { income_iva.Columns["idinc"] };
            cChild = new [] { estimatedetail.Columns["idinc_iva"] };
            Relations.Add(new DataRelation("income_ivaestimatedetail", cPar, cChild, false));

            cPar   = new [] { income_imponibile.Columns["idinc"] };
            cChild = new [] { estimatedetail.Columns["idinc_taxable"] };
            Relations.Add(new DataRelation("income_imponibileestimatedetail", cPar, cChild, false));

            cPar   = new [] { sorting3.Columns["idsor"] };
            cChild = new [] { estimatedetail.Columns["idsor3"] };
            Relations.Add(new DataRelation("sorting3invoicedetail", cPar, cChild, false));

            cPar   = new [] { sorting2.Columns["idsor"] };
            cChild = new [] { estimatedetail.Columns["idsor2"] };
            Relations.Add(new DataRelation("sorting2invoicedetail", cPar, cChild, false));

            cPar   = new [] { sorting1.Columns["idsor"] };
            cChild = new [] { estimatedetail.Columns["idsor1"] };
            Relations.Add(new DataRelation("sorting1invoicedetail", cPar, cChild, false));

            this.defineRelation("upbestimatedetail", "upb", "estimatedetail", "idupb");
            this.defineRelation("ivakindestimatedetail", "ivakind", "estimatedetail", "idivakind");
            this.defineRelation("accmotiveappliedestimatedetail", "accmotiveapplied", "estimatedetail", "idaccmotive");
            cPar   = new [] { accmotiveappliedannulment.Columns["idaccmotive"] };
            cChild = new [] { estimatedetail.Columns["idaccmotiveannulment"] };
            Relations.Add(new DataRelation("accmotiveappliedannulment_estimatedetail", cPar, cChild, false));

            this.defineRelation("revenuepartition_estimatedetail", "revenuepartition", "estimatedetail", "idrevenuepartition");
            this.defineRelation("finmotive_income_estimatedetail", "finmotive_income", "estimatedetail", "idfinmotive");
            cPar   = new [] { sorting_siope.Columns["idsor"] };
            cChild = new [] { estimatedetail.Columns["idsor_siope"] };
            Relations.Add(new DataRelation("sorting_siope_estimatedetail", cPar, cChild, false));

            cPar   = new [] { pre_epacc.Columns["idepacc"] };
            cChild = new [] { estimatedetail.Columns["idepacc_pre"] };
            Relations.Add(new DataRelation("pre_epacc_estimatedetail", cPar, cChild, false));

            #endregion
        }
Ejemplo n.º 2
0
        private void initClass()
        {
            DataSetName = "dsmeta";
            Prefix      = "";
            Namespace   = "http://tempuri.org/dsmeta.xsd";

            #region create DataTables
            //////////////////// IVAKIND /////////////////////////////////
            var tivakind = new ivakindTable();
            tivakind.addBaseColumns("idivakind", "description", "rate", "unabatabilitypercentage", "cu", "ct", "lu", "lt", "active", "idivataxablekind", "flag", "idfenature");
            Tables.Add(tivakind);
            tivakind.defineKey("idivakind");

            //////////////////// INVOICEDETAIL /////////////////////////////////
            var tinvoicedetail = new invoicedetailTable();
            tinvoicedetail.addBaseColumns("idinvkind", "yinv", "ninv", "rownum", "idivakind", "detaildescription", "annotations", "taxable", "tax", "unabatable", "cu", "ct", "lu", "lt", "discount", "idmankind", "yman", "nman", "manrownum", "number", "idupb", "idsor1", "idsor2", "idsor3", "competencystart", "competencystop", "paymentcompetency", "idaccmotive", "idestimkind", "yestim", "nestim", "estimrownum", "idexp_iva", "idexp_taxable", "idinc_iva", "idinc_taxable", "idgroup", "yinv_main", "ninv_main", "va3type", "idintrastatcode", "idintrastatmeasure", "weight", "intrastatoperationkind", "idintrastatservice", "idintrastatsupplymethod", "idlist", "idunit", "idpackage", "unitsforpackage", "npackage", "flag", "exception12", "intra12operationkind", "move12", "idupb_iva", "idinvkind_main", "leasing", "usedmodesospesometro", "resetresidualmandate", "idfetransfer", "fereferencerule", "cupcode", "cigcode", "idcostpartition", "idpccdebitmotive", "idpccdebitstatus", "expensekind", "rounding", "idepexp", "idepacc", "flagbit", "idfinmotive", "iduniqueformcode", "ycon", "ncon", "codicetipo", "codicevalore", "idsor_siope", "idepexp_pre");
            Tables.Add(tinvoicedetail);
            tinvoicedetail.defineKey("idinvkind", "yinv", "ninv", "rownum");

            //////////////////// SORTING1 /////////////////////////////////
            var tsorting1 = new sortingTable();
            tsorting1.TableName = "sorting1";
            tsorting1.addBaseColumns("idsorkind", "idsor", "sortcode", "paridsor", "nlevel", "description", "txt", "rtf", "cu", "ct", "lu", "lt", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "flagnodate", "movkind", "printingorder", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5");
            tsorting1.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting1);
            tsorting1.defineKey("idsor");

            //////////////////// SORTING2 /////////////////////////////////
            var tsorting2 = new sortingTable();
            tsorting2.TableName = "sorting2";
            tsorting2.addBaseColumns("idsorkind", "idsor", "sortcode", "paridsor", "nlevel", "description", "txt", "rtf", "cu", "ct", "lu", "lt", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "flagnodate", "movkind", "printingorder", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5");
            tsorting2.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting2);
            tsorting2.defineKey("idsor");

            //////////////////// SORTING3 /////////////////////////////////
            var tsorting3 = new sortingTable();
            tsorting3.TableName = "sorting3";
            tsorting3.addBaseColumns("idsorkind", "idsor", "sortcode", "paridsor", "nlevel", "description", "txt", "rtf", "cu", "ct", "lu", "lt", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "flagnodate", "movkind", "printingorder", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5");
            tsorting3.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting3);
            tsorting3.defineKey("idsor");

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

            //////////////////// MANDATEKIND /////////////////////////////////
            var tmandatekind = new mandatekindTable();
            tmandatekind.addBaseColumns("idmankind", "description", "idupb", "rtf", "txt", "cu", "ct", "lu", "lt", "active");
            Tables.Add(tmandatekind);
            tmandatekind.defineKey("idmankind");

            //////////////////// ACCMOTIVEAPPLIED /////////////////////////////////
            var taccmotiveapplied = new accmotiveappliedTable();
            taccmotiveapplied.addBaseColumns("idaccmotive", "paridaccmotive", "codemotive", "motive", "cu", "ct", "lu", "lt", "active", "idepoperation", "epoperation", "in_use", "expensekind");
            Tables.Add(taccmotiveapplied);
            taccmotiveapplied.defineKey("idaccmotive");

            //////////////////// ESTIMATEKIND /////////////////////////////////
            var testimatekind = new estimatekindTable();
            testimatekind.addBaseColumns("idestimkind", "active", "ct", "cu", "description", "idupb", "lt", "lu", "rtf", "txt", "email", "faxnumber", "office", "phonenumber");
            Tables.Add(testimatekind);
            testimatekind.defineKey("idestimkind");

            //////////////////// EXPENSE_IVA /////////////////////////////////
            var texpense_iva = new expenseTable();
            texpense_iva.TableName = "expense_iva";
            texpense_iva.addBaseColumns("adate", "ct", "cu", "description", "doc", "docdate", "expiration", "idreg", "lt", "lu", "nmov", "txt", "ymov", "idclawback", "idman", "nphase", "idexp", "parentidexp", "idpayment", "idformerexpense", "autokind", "autocode");
            texpense_iva.ExtendedProperties["TableForReading"] = "expense";
            Tables.Add(texpense_iva);
            texpense_iva.defineKey("idexp");

            //////////////////// EXPENSE_TAXABLE /////////////////////////////////
            var texpense_taxable = new expenseTable();
            texpense_taxable.TableName = "expense_taxable";
            texpense_taxable.addBaseColumns("adate", "ct", "cu", "description", "doc", "docdate", "expiration", "idreg", "lt", "lu", "nmov", "txt", "ymov", "idclawback", "idman", "nphase", "idexp", "parentidexp", "idpayment", "idformerexpense", "autokind", "autocode");
            texpense_taxable.ExtendedProperties["TableForReading"] = "expense";
            Tables.Add(texpense_taxable);
            texpense_taxable.defineKey("idexp");

            //////////////////// INCOME_IVA /////////////////////////////////
            var tincome_iva = new incomeTable();
            tincome_iva.TableName = "income_iva";
            tincome_iva.addBaseColumns("adate", "ct", "cu", "description", "doc", "docdate", "expiration", "idreg", "lt", "lu", "nmov", "ymov", "idman", "nphase", "idpayment", "idinc", "parentidinc", "autokind", "autocode");
            tincome_iva.ExtendedProperties["TableForReading"] = "income";
            Tables.Add(tincome_iva);
            tincome_iva.defineKey("idinc");

            //////////////////// INCOME_TAXABLE /////////////////////////////////
            var tincome_taxable = new incomeTable();
            tincome_taxable.TableName = "income_taxable";
            tincome_taxable.addBaseColumns("adate", "ct", "cu", "description", "doc", "docdate", "expiration", "idreg", "lt", "lu", "nmov", "ymov", "idman", "nphase", "idpayment", "idinc", "parentidinc", "autokind", "autocode");
            tincome_taxable.ExtendedProperties["TableForReading"] = "income";
            Tables.Add(tincome_taxable);
            tincome_taxable.defineKey("idinc");

            //////////////////// INTRASTATMEASURE /////////////////////////////////
            var tintrastatmeasure = new MetaTable("intrastatmeasure");
            tintrastatmeasure.defineColumn("idintrastatmeasure", typeof(int), false);
            tintrastatmeasure.defineColumn("code", typeof(string), false);
            tintrastatmeasure.defineColumn("description", typeof(string), false);
            tintrastatmeasure.defineColumn("lt", typeof(DateTime));
            tintrastatmeasure.defineColumn("lu", typeof(string));
            Tables.Add(tintrastatmeasure);
            tintrastatmeasure.defineKey("idintrastatmeasure");

            //////////////////// INTRASTATCODE /////////////////////////////////
            var tintrastatcode = new MetaTable("intrastatcode");
            tintrastatcode.defineColumn("ayear", typeof(short), false);
            tintrastatcode.defineColumn("code", typeof(string), false);
            tintrastatcode.defineColumn("description", typeof(string), false);
            tintrastatcode.defineColumn("idintrastatmeasure", typeof(int));
            tintrastatcode.defineColumn("lt", typeof(DateTime));
            tintrastatcode.defineColumn("lu", typeof(string));
            tintrastatcode.defineColumn("idintrastatcode", typeof(int), false);
            Tables.Add(tintrastatcode);
            tintrastatcode.defineKey("idintrastatcode");

            //////////////////// INTRASTATSERVICE /////////////////////////////////
            var tintrastatservice = new MetaTable("intrastatservice");
            tintrastatservice.defineColumn("description", typeof(string), false);
            tintrastatservice.defineColumn("code", typeof(string), false);
            tintrastatservice.defineColumn("cu", typeof(string), false);
            tintrastatservice.defineColumn("ct", typeof(DateTime), false);
            tintrastatservice.defineColumn("lu", typeof(string), false);
            tintrastatservice.defineColumn("lt", typeof(DateTime), false);
            tintrastatservice.defineColumn("ayear", typeof(short), false);
            tintrastatservice.defineColumn("idintrastatservice", typeof(int), false, true);
            Tables.Add(tintrastatservice);
            tintrastatservice.defineKey("idintrastatservice");

            //////////////////// INTRASTATSUPPLYMETHOD /////////////////////////////////
            var tintrastatsupplymethod = new MetaTable("intrastatsupplymethod");
            tintrastatsupplymethod.defineColumn("idintrastatsupplymethod", typeof(int), false);
            tintrastatsupplymethod.defineColumn("code", typeof(string), false);
            tintrastatsupplymethod.defineColumn("description", typeof(string), false);
            tintrastatsupplymethod.defineColumn("cu", typeof(string), false);
            tintrastatsupplymethod.defineColumn("ct", typeof(DateTime), false);
            tintrastatsupplymethod.defineColumn("lu", typeof(string), false);
            tintrastatsupplymethod.defineColumn("lt", typeof(DateTime), false);
            Tables.Add(tintrastatsupplymethod);
            tintrastatsupplymethod.defineKey("idintrastatsupplymethod");

            //////////////////// LISTVIEW /////////////////////////////////
            var tlistview = new MetaTable("listview");
            tlistview.defineColumn("idlist", typeof(int), false);
            tlistview.defineColumn("description", typeof(string), false);
            tlistview.defineColumn("intcode", typeof(string), false);
            tlistview.defineColumn("intbarcode", typeof(string));
            tlistview.defineColumn("extcode", typeof(string));
            tlistview.defineColumn("extbarcode", typeof(string));
            tlistview.defineColumn("validitystop", typeof(DateTime));
            tlistview.defineColumn("active", typeof(string), false);
            tlistview.defineColumn("idpackage", typeof(int));
            tlistview.defineColumn("package", typeof(string));
            tlistview.defineColumn("idunit", typeof(int));
            tlistview.defineColumn("unit", typeof(string));
            tlistview.defineColumn("unitsforpackage", typeof(int));
            tlistview.defineColumn("has_expiry", typeof(string), false);
            tlistview.defineColumn("idlistclass", typeof(string), false);
            tlistview.defineColumn("codelistclass", typeof(string), false);
            tlistview.defineColumn("listclass", typeof(string), false);
            Tables.Add(tlistview);
            tlistview.defineKey("idlist");

            //////////////////// PACKAGE /////////////////////////////////
            var tpackage = new MetaTable("package");
            tpackage.defineColumn("idpackage", typeof(int), false);
            tpackage.defineColumn("description", typeof(string), false);
            tpackage.defineColumn("cu", typeof(string), false);
            tpackage.defineColumn("ct", typeof(DateTime), false);
            tpackage.defineColumn("lu", typeof(string), false);
            tpackage.defineColumn("lt", typeof(DateTime), false);
            tpackage.defineColumn("active", typeof(string), false);
            Tables.Add(tpackage);
            tpackage.defineKey("idpackage");

            //////////////////// UNIT /////////////////////////////////
            var tunit = new MetaTable("unit");
            tunit.defineColumn("idunit", typeof(int), false);
            tunit.defineColumn("description", typeof(string), false);
            tunit.defineColumn("cu", typeof(string), false);
            tunit.defineColumn("ct", typeof(DateTime), false);
            tunit.defineColumn("lu", typeof(string), false);
            tunit.defineColumn("lt", typeof(DateTime), false);
            tunit.defineColumn("active", typeof(string), false);
            Tables.Add(tunit);
            tunit.defineKey("idunit");

            //////////////////// LISTCLASS /////////////////////////////////
            var tlistclass = new MetaTable("listclass");
            tlistclass.defineColumn("idlistclass", typeof(string), false);
            tlistclass.defineColumn("active", typeof(string), false);
            tlistclass.defineColumn("codelistclass", typeof(string), false);
            tlistclass.defineColumn("paridlistclass", typeof(string));
            tlistclass.defineColumn("printingorder", typeof(string), false);
            tlistclass.defineColumn("title", typeof(string), false);
            tlistclass.defineColumn("rtf", typeof(Byte[]));
            tlistclass.defineColumn("txt", typeof(string));
            tlistclass.defineColumn("ct", typeof(DateTime), false);
            tlistclass.defineColumn("cu", typeof(string), false);
            tlistclass.defineColumn("lt", typeof(DateTime), false);
            tlistclass.defineColumn("lu", typeof(string), false);
            tlistclass.defineColumn("authrequired", typeof(string));
            tlistclass.defineColumn("idaccmotive", typeof(string));
            Tables.Add(tlistclass);
            tlistclass.defineKey("idlistclass");

            //////////////////// UPB_IVA /////////////////////////////////
            var tupb_iva = new upbTable();
            tupb_iva.TableName = "upb_iva";
            tupb_iva.addBaseColumns("idupb", "active", "assured", "codeupb", "ct", "cu", "expiration", "granted", "lt", "lu", "paridupb", "previousappropriation", "previousassessment", "printingorder", "requested", "rtf", "title", "txt", "idman", "idunderwriter", "cupcode");
            tupb_iva.ExtendedProperties["TableForReading"] = "upb";
            Tables.Add(tupb_iva);
            tupb_iva.defineKey("idupb");

            //////////////////// INVOICEKIND /////////////////////////////////
            var tinvoicekind = new invoicekindTable();
            tinvoicekind.addBaseColumns("ct", "cu", "description", "lt", "lu", "codeinvkind", "idinvkind", "flag", "flag_autodocnumbering", "formatstring", "active", "idinvkind_auto");
            Tables.Add(tinvoicekind);
            tinvoicekind.defineKey("idinvkind");

            //////////////////// FETRANSFER /////////////////////////////////
            var tfetransfer = new MetaTable("fetransfer");
            tfetransfer.defineColumn("idfetransfer", typeof(string), false);
            tfetransfer.defineColumn("description", typeof(string), false);
            tfetransfer.defineColumn("cu", typeof(string), false);
            tfetransfer.defineColumn("ct", typeof(DateTime), false);
            tfetransfer.defineColumn("lu", typeof(string), false);
            tfetransfer.defineColumn("lt", typeof(DateTime), false);
            Tables.Add(tfetransfer);

            //////////////////// PCCDEBITMOTIVE /////////////////////////////////
            var tpccdebitmotive = new MetaTable("pccdebitmotive");
            tpccdebitmotive.defineColumn("idpccdebitmotive", typeof(string), false);
            tpccdebitmotive.defineColumn("description", typeof(string));
            tpccdebitmotive.defineColumn("listingorder", typeof(int));
            tpccdebitmotive.defineColumn("lu", typeof(string), false);
            tpccdebitmotive.defineColumn("lt", typeof(DateTime), false);
            tpccdebitmotive.defineColumn("flagstatus", typeof(int));
            Tables.Add(tpccdebitmotive);
            tpccdebitmotive.defineKey("idpccdebitmotive");

            //////////////////// PCCDEBITSTATUS /////////////////////////////////
            var tpccdebitstatus = new MetaTable("pccdebitstatus");
            tpccdebitstatus.defineColumn("idpccdebitstatus", typeof(string), false);
            tpccdebitstatus.defineColumn("description", typeof(string));
            tpccdebitstatus.defineColumn("lt", typeof(DateTime), false);
            tpccdebitstatus.defineColumn("lu", typeof(string), false);
            tpccdebitstatus.defineColumn("listingorder", typeof(int));
            tpccdebitstatus.defineColumn("flag", typeof(int));
            Tables.Add(tpccdebitstatus);
            tpccdebitstatus.defineKey("idpccdebitstatus");

            //////////////////// COSTPARTITION /////////////////////////////////
            var tcostpartition = new MetaTable("costpartition");
            tcostpartition.defineColumn("idcostpartition", typeof(int), false);
            tcostpartition.defineColumn("title", typeof(string));
            tcostpartition.defineColumn("kind", typeof(string));
            tcostpartition.defineColumn("lt", typeof(DateTime));
            tcostpartition.defineColumn("lu", typeof(string));
            tcostpartition.defineColumn("ct", typeof(DateTime));
            tcostpartition.defineColumn("cu", typeof(string));
            tcostpartition.defineColumn("costpartitioncode", typeof(string));
            tcostpartition.defineColumn("active", typeof(string));
            tcostpartition.defineColumn("description", typeof(string));
            Tables.Add(tcostpartition);
            tcostpartition.defineKey("idcostpartition");

            //////////////////// EPEXP /////////////////////////////////
            var tepexp = new epexpTable();
            tepexp.addBaseColumns("idepexp", "adate", "ct", "cu", "description", "doc", "docdate", "idman", "idreg", "idrelated", "lt", "lu", "nepexp", "nphase", "paridepexp", "rtf", "start", "stop", "txt", "yepexp");
            Tables.Add(tepexp);
            tepexp.defineKey("idepexp");

            //////////////////// 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(int), 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");

            //////////////////// EPACC /////////////////////////////////
            var tepacc = new MetaTable("epacc");
            tepacc.defineColumn("idepacc", typeof(int), false);
            tepacc.defineColumn("adate", typeof(DateTime), false);
            tepacc.defineColumn("ct", typeof(DateTime), false);
            tepacc.defineColumn("cu", typeof(string), false);
            tepacc.defineColumn("description", typeof(string), false);
            tepacc.defineColumn("doc", typeof(string));
            tepacc.defineColumn("docdate", typeof(DateTime));
            tepacc.defineColumn("idman", typeof(int));
            tepacc.defineColumn("idreg", typeof(int));
            tepacc.defineColumn("idrelated", typeof(string));
            tepacc.defineColumn("lt", typeof(DateTime), false);
            tepacc.defineColumn("lu", typeof(string), false);
            tepacc.defineColumn("nepacc", typeof(int), false);
            tepacc.defineColumn("nphase", typeof(short), false);
            tepacc.defineColumn("paridepacc", typeof(int));
            tepacc.defineColumn("rtf", typeof(Byte[]));
            tepacc.defineColumn("start", typeof(DateTime));
            tepacc.defineColumn("stop", typeof(DateTime));
            tepacc.defineColumn("txt", typeof(string));
            tepacc.defineColumn("yepacc", typeof(short), false);
            tepacc.defineColumn("flagvariation", typeof(string));
            Tables.Add(tepacc);
            tepacc.defineKey("idepacc");

            //////////////////// FINMOTIVE_INCOME /////////////////////////////////
            var tfinmotive_income = new MetaTable("finmotive_income");
            tfinmotive_income.defineColumn("idfinmotive", typeof(string), false);
            tfinmotive_income.defineColumn("active", typeof(string), false);
            tfinmotive_income.defineColumn("codemotive", typeof(string), false);
            tfinmotive_income.defineColumn("paridfinmotive", typeof(string));
            tfinmotive_income.defineColumn("title", typeof(string), false);
            tfinmotive_income.defineColumn("lt", typeof(DateTime));
            tfinmotive_income.defineColumn("lu", typeof(string));
            tfinmotive_income.defineColumn("ct", typeof(DateTime));
            tfinmotive_income.defineColumn("cu", typeof(string));
            tfinmotive_income.ExtendedProperties["TableForReading"] = "finmotive";
            Tables.Add(tfinmotive_income);
            tfinmotive_income.defineKey("idfinmotive");

            //////////////////// SORTING_SIOPE /////////////////////////////////
            var tsorting_siope = new sortingTable();
            tsorting_siope.TableName = "sorting_siope";
            tsorting_siope.addBaseColumns("ct", "cu", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5", "description", "flagnodate", "lt", "lu", "movkind", "printingorder", "rtf", "sortcode", "txt", "idsorkind", "idsor", "paridsor", "nlevel", "start", "stop", "email");
            tsorting_siope.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting_siope);
            tsorting_siope.defineKey("idsor");

            //////////////////// EPEXP_PRE /////////////////////////////////
            var tepexp_pre = new epexpTable();
            tepexp_pre.TableName = "epexp_pre";
            tepexp_pre.addBaseColumns("idepexp", "adate", "ct", "cu", "description", "doc", "docdate", "idman", "idreg", "idrelated", "lt", "lu", "nepexp", "nphase", "paridepexp", "rtf", "start", "stop", "txt", "yepexp");
            tepexp_pre.ExtendedProperties["TableForReading"] = "epexp";
            Tables.Add(tepexp_pre);
            tepexp_pre.defineKey("idepexp");

            #endregion


            #region DataRelation creation
            this.defineRelation("FK_invoicekind_invoicedetaildeferred", "invoicekind", "invoicedetaildeferred", "idinvkind");
            this.defineRelation("FK_invoicedetail_invoicedetaildeferred", "invoicedetail", "invoicedetaildeferred", "idinvkind", "yinv", "ninv", "rownum");
            this.defineRelation("FK_epacc_invoicedetail", "epacc", "invoicedetail", "idepacc");
            this.defineRelation("FK_epexp_invoicedetail", "epexp", "invoicedetail", "idepexp");
            this.defineRelation("FK_pccdebitstatus_invoicedetail", "pccdebitstatus", "invoicedetail", "idpccdebitstatus");
            this.defineRelation("FK_pccdebitmotive_invoicedetail", "pccdebitmotive", "invoicedetail", "idpccdebitmotive");
            this.defineRelation("FK_fetransfer_invoicedetail", "fetransfer", "invoicedetail", "idfetransfer");
            var cPar   = new [] { upb_iva.Columns["idupb"] };
            var cChild = new [] { invoicedetail.Columns["idupb_iva"] };
            Relations.Add(new DataRelation("FK_upb_iva_invoicedetail", cPar, cChild, false));

            this.defineRelation("FK_package_invoicedetail", "package", "invoicedetail", "idpackage");
            this.defineRelation("FK_unit_invoicedetail", "unit", "invoicedetail", "idunit");
            this.defineRelation("FK_listview_invoicedetail", "listview", "invoicedetail", "idlist");
            this.defineRelation("FK_intrastatsupplymethod_invoicedetail", "intrastatsupplymethod", "invoicedetail", "idintrastatsupplymethod");
            this.defineRelation("FK_intrastatservice_invoicedetail", "intrastatservice", "invoicedetail", "idintrastatservice");
            this.defineRelation("ivakindinvoicedetail", "ivakind", "invoicedetail", "idivakind");
            this.defineRelation("upbinvoicedetail", "upb", "invoicedetail", "idupb");
            this.defineRelation("mandatekindinvoicedetail", "mandatekind", "invoicedetail", "idmankind");
            this.defineRelation("estimatekindinvoicedetail", "estimatekind", "invoicedetail", "idestimkind");
            cPar   = new [] { expense_iva.Columns["idexp"] };
            cChild = new [] { invoicedetail.Columns["idexp_iva"] };
            Relations.Add(new DataRelation("expense_ivainvoicedetail", cPar, cChild, false));

            cPar   = new [] { expense_taxable.Columns["idexp"] };
            cChild = new [] { invoicedetail.Columns["idexp_taxable"] };
            Relations.Add(new DataRelation("expense_taxableinvoicedetail", cPar, cChild, false));

            cPar   = new [] { income_iva.Columns["idinc"] };
            cChild = new [] { invoicedetail.Columns["idinc_iva"] };
            Relations.Add(new DataRelation("incomeinvoicedetail", cPar, cChild, false));

            cPar   = new [] { income_taxable.Columns["idinc"] };
            cChild = new [] { invoicedetail.Columns["idinc_taxable"] };
            Relations.Add(new DataRelation("income_taxableinvoicedetail", cPar, cChild, false));

            this.defineRelation("accmotiveapplied_invoicedetail", "accmotiveapplied", "invoicedetail", "idaccmotive");
            cPar   = new [] { sorting1.Columns["idsor"] };
            cChild = new [] { invoicedetail.Columns["idsor1"] };
            Relations.Add(new DataRelation("sorting1invoicedetail", cPar, cChild, false));

            cPar   = new [] { sorting2.Columns["idsor"] };
            cChild = new [] { invoicedetail.Columns["idsor2"] };
            Relations.Add(new DataRelation("sorting2invoicedetail", cPar, cChild, false));

            cPar   = new [] { sorting3.Columns["idsor"] };
            cChild = new [] { invoicedetail.Columns["idsor3"] };
            Relations.Add(new DataRelation("sorting3invoicedetail", cPar, cChild, false));

            this.defineRelation("intrastatmeasure_invoicedetail", "intrastatmeasure", "invoicedetail", "idintrastatmeasure");
            this.defineRelation("intrastatcode_invoicedetail", "intrastatcode", "invoicedetail", "idintrastatcode");
            cPar   = new [] { invoicekind.Columns["idinvkind"] };
            cChild = new [] { invoicedetail.Columns["idinvkind_main"] };
            Relations.Add(new DataRelation("invoicekind_invoicedetail", cPar, cChild, false));

            this.defineRelation("costpartition_invoicedetail", "costpartition", "invoicedetail", "idcostpartition");
            this.defineRelation("finmotive_income_invoicedetail", "finmotive_income", "invoicedetail", "idfinmotive");
            cPar   = new [] { sorting_siope.Columns["idsor"] };
            cChild = new [] { invoicedetail.Columns["idsor_siope"] };
            Relations.Add(new DataRelation("sorting_siope_invoicedetail", cPar, cChild, false));

            cPar   = new [] { epexp_pre.Columns["idepexp"] };
            cChild = new [] { invoicedetail.Columns["idepexp_pre"] };
            Relations.Add(new DataRelation("epexp_pre_invoicedetail", cPar, cChild, false));

            #endregion
        }
Ejemplo n.º 3
0
        private void initClass()
        {
            DataSetName = "dsmeta";
            Prefix      = "";
            Namespace   = "http://tempuri.org/dsmeta.xsd";

            #region create DataTables
            //////////////////// FLUSSOCREDITI /////////////////////////////////
            var tflussocrediti = new flussocreditiTable();
            tflussocrediti.addBaseColumns("idflusso", "cu", "ct", "lu", "lt", "datacreazioneflusso", "flusso", "istransmitted", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05", "filename", "progday", "idestimkind", "docdate");
            Tables.Add(tflussocrediti);
            tflussocrediti.defineKey("idflusso");

            //////////////////// FLUSSOCREDITIDETAIL_CA /////////////////////////////////
            var tflussocreditidetail_ca = new flussocreditidetailTable();
            tflussocreditidetail_ca.TableName = "flussocreditidetail_ca";
            tflussocreditidetail_ca.addBaseColumns("idflusso", "iddetail", "cu", "ct", "lu", "lt", "importoversamento", "idestimkind", "yestim", "nestim", "rownum", "idinvkind", "yinv", "ninv", "invrownum", "competencystart", "competencystop", "description", "idaccmotivecredit", "idaccmotiverevenue", "idaccmotiveundotax", "idaccmotiveundotaxpost", "idfinmotive", "idreg", "iduniqueformcode", "idupb", "nform", "stop", "expirationdate", "barcodevalue", "barcodeimage", "qrcodevalue", "qrcodeimage", "cf", "iuv", "annulment", "idunivoco", "codiceavviso", "idsor1", "idsor2", "idsor3", "idivakind", "tax", "number", "p_iva", "annotations", "flag");
            tflussocreditidetail_ca.defineColumn("!estimkind", typeof(string));
            tflussocreditidetail_ca.defineColumn("!cliente", typeof(string));
            tflussocreditidetail_ca.ExtendedProperties["TableForPosting"] = "flussocreditidetail";
            tflussocreditidetail_ca.ExtendedProperties["TableForReading"] = "flussocreditidetail";
            Tables.Add(tflussocreditidetail_ca);
            tflussocreditidetail_ca.defineKey("idflusso", "iddetail");

            //////////////////// SORTING05 /////////////////////////////////
            var tsorting05 = new sortingTable();
            tsorting05.TableName = "sorting05";
            tsorting05.addBaseColumns("ct", "cu", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5", "description", "flagnodate", "lt", "lu", "movkind", "printingorder", "rtf", "sortcode", "txt", "idsorkind", "idsor", "paridsor", "nlevel", "start", "stop", "email");
            tsorting05.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting05);
            tsorting05.defineKey("idsor");

            //////////////////// SORTING02 /////////////////////////////////
            var tsorting02 = new sortingTable();
            tsorting02.TableName = "sorting02";
            tsorting02.addBaseColumns("ct", "cu", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5", "description", "flagnodate", "lt", "lu", "movkind", "printingorder", "rtf", "sortcode", "txt", "idsorkind", "idsor", "paridsor", "nlevel", "start", "stop", "email");
            tsorting02.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting02);
            tsorting02.defineKey("idsor");

            //////////////////// SORTING03 /////////////////////////////////
            var tsorting03 = new sortingTable();
            tsorting03.TableName = "sorting03";
            tsorting03.addBaseColumns("ct", "cu", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5", "description", "flagnodate", "lt", "lu", "movkind", "printingorder", "rtf", "sortcode", "txt", "idsorkind", "idsor", "paridsor", "nlevel", "start", "stop", "email");
            tsorting03.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting03);
            tsorting03.defineKey("idsor");

            //////////////////// SORTING04 /////////////////////////////////
            var tsorting04 = new sortingTable();
            tsorting04.TableName = "sorting04";
            tsorting04.addBaseColumns("ct", "cu", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5", "description", "flagnodate", "lt", "lu", "movkind", "printingorder", "rtf", "sortcode", "txt", "idsorkind", "idsor", "paridsor", "nlevel", "start", "stop", "email");
            tsorting04.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting04);
            tsorting04.defineKey("idsor");

            //////////////////// SORTING01 /////////////////////////////////
            var tsorting01 = new sortingTable();
            tsorting01.TableName = "sorting01";
            tsorting01.addBaseColumns("ct", "cu", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5", "description", "flagnodate", "lt", "lu", "movkind", "printingorder", "rtf", "sortcode", "txt", "idsorkind", "idsor", "paridsor", "nlevel", "start", "stop", "email");
            tsorting01.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting01);
            tsorting01.defineKey("idsor");

            //////////////////// CONFIG /////////////////////////////////
            var tconfig = new configTable();
            tconfig.addBaseColumns("ayear", "agencycode", "appname", "appropriationphasecode", "assessmentphasecode", "asset_flagnumbering", "asset_flagrestart", "assetload_flag", "boxpartitiontitle", "finvarofficial_default", "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", "wageimportappname", "balancekind", "idpaymethodabi", "idpaymethodnoabi", "iban_f24", "cudactivitycode", "startivabalance", "flagivapaybyrow", "idacc_unabatable", "idacc_unabatable_refund", "invoice_flagregister", "default_idfinvarstatus", "flagivaregphase", "mainflagpayment", "mainflagrefund", "mainidfinivapayment", "mainidfinivarefund", "mainminpayment", "mainminrefund", "mainpaymentagency", "mainrefundagency", "mainflagivaregphase", "mainstartivabalance", "mainidacc_unabatable", "mainidacc_unabatable_refund", "idacc_mainivapayment", "idacc_mainivapayment_internal", "idacc_mainivarefund", "idacc_mainivarefund_internal", "flagva3", "flagrefund12", "flagpayment12", "refundagency12", "paymentagency12", "idfinivarefund12", "idfinivapayment12", "minrefund12", "minpayment12", "idacc_ivapayment12", "idacc_ivarefund12", "idacc_mainivarefund12", "idacc_mainivapayment12", "idacc_mainivapayment_internal12", "idacc_mainivarefund_internal12", "startivabalance12", "mainrefundagency12", "mainpaymentagency12", "mainflagrefund12", "mainflagpayment12", "mainidfinivarefund12", "mainidfinivapayment12", "mainminrefund12", "mainminpayment12", "mainstartivabalance12", "idreg_csa", "finvar_warnmail", "flagdirectcsaclawback", "idacc_revenue_gross_csa", "idfinincome_gross_csa", "idsor1_stock", "idsor2_stock", "idsor3_stock", "idinpscenter", "idivapayperiodicity_instit", "idfin_store", "flagpcashautopayment", "flagpcashautoproceeds", "email", "lcard", "booking_on_invoice", "itineration_directauth", "email_f24", "csa_flaggroupby_income", "csa_flaggroupby_expense", "csa_flaglinktoexp", "idsiopeincome_csa", "idacc_invoicetoemit", "idacc_invoicetoreceive", "epannualthreeshold", "flagbalance_csa", "flagiva_immediate_or_deferred", "flagenabletransmission", "idpccdebitstatus", "flagsplitpayment", "startivabalancesplit", "paymentagencysplit", "idfinivapaymentsplit", "flagpaymentsplit", "idacc_unabatable_split", "idacc_ivapaymentsplit", "agencynumber", "femode", "idacc_economic_result", "idacc_previous_economic_result", "idacc_bankpaydoc", "idacc_bankprodoc", "csa_flagtransmissionlinking", "idaccmotive_forwarder", "idivakind_forwarder");
            Tables.Add(tconfig);
            tconfig.defineKey("ayear");

            //////////////////// ESTIMATEDETAIL /////////////////////////////////
            var testimatedetail = new estimatedetailTable();
            testimatedetail.addBaseColumns("idestimkind", "yestim", "nestim", "rownum", "annotations", "ct", "cu", "detaildescription", "discount", "idupb", "lt", "lu", "ninvoiced", "number", "start", "stop", "tax", "taxable", "taxrate", "toinvoice", "idaccmotive", "idreg", "idgroup", "competencystart", "competencystop", "idinc_taxable", "idinc_iva", "idivakind", "idsor1", "idsor2", "idsor3", "idaccmotiveannulment", "epkind", "idrevenuepartition", "idepacc", "idupb_iva", "idlist", "cigcode", "idfinmotive", "iduniqueformcode", "flag", "proceedsexpiring");
            Tables.Add(testimatedetail);
            testimatedetail.defineKey("idestimkind", "yestim", "nestim", "rownum");

            //////////////////// INVOICEDETAIL /////////////////////////////////
            var tinvoicedetail = new invoicedetailTable();
            tinvoicedetail.addBaseColumns("ninv", "rownum", "yinv", "annotations", "competencystart", "paymentcompetency", "competencystop", "ct", "cu", "detaildescription", "discount", "idaccmotive", "idmankind", "idupb", "lt", "lu", "manrownum", "nman", "number", "tax", "taxable", "unabatable", "yman", "idestimkind", "estimrownum", "nestim", "yestim", "idgroup", "idexp_taxable", "idexp_iva", "idinc_taxable", "idinc_iva", "ninv_main", "yinv_main", "idivakind", "idinvkind", "idsor1", "idsor2", "idsor3", "idintrastatcode", "idintrastatmeasure", "weight", "va3type", "intrastatoperationkind", "idintrastatservice", "idintrastatsupplymethod", "idlist", "idunit", "idpackage", "unitsforpackage", "npackage", "flag", "exception12", "intra12operationkind", "move12", "idupb_iva", "idinvkind_main", "leasing", "usedmodesospesometro", "resetresidualmandate", "idfetransfer", "fereferencerule", "cupcode", "cigcode", "idpccdebitstatus", "idpccdebitmotive", "idcostpartition", "expensekind", "rounding", "idepexp", "idepacc", "flagbit", "idfinmotive", "iduniqueformcode");
            Tables.Add(tinvoicedetail);
            tinvoicedetail.defineKey("ninv", "rownum", "yinv", "idinvkind");

            //////////////////// FLUSSOCREDITIDETAIL_FATT /////////////////////////////////
            var tflussocreditidetail_fatt = new flussocreditidetailTable();
            tflussocreditidetail_fatt.TableName = "flussocreditidetail_fatt";
            tflussocreditidetail_fatt.addBaseColumns("idflusso", "iddetail", "cu", "ct", "lu", "lt", "importoversamento", "idestimkind", "yestim", "nestim", "rownum", "idinvkind", "yinv", "ninv", "invrownum", "competencystart", "competencystop", "description", "idaccmotivecredit", "idaccmotiverevenue", "idaccmotiveundotax", "idaccmotiveundotaxpost", "idfinmotive", "idreg", "iduniqueformcode", "idupb", "nform", "stop", "expirationdate", "barcodevalue", "barcodeimage", "qrcodevalue", "qrcodeimage", "cf", "iuv", "annulment", "idunivoco", "codiceavviso", "idsor1", "idsor2", "idsor3", "idivakind", "tax", "number", "p_iva", "annotations", "flag");
            tflussocreditidetail_fatt.defineColumn("!invkind", typeof(string));
            tflussocreditidetail_fatt.defineColumn("!cliente", typeof(string));
            tflussocreditidetail_fatt.ExtendedProperties["TableForPosting"] = "flussocreditidetail";
            tflussocreditidetail_fatt.ExtendedProperties["TableForReading"] = "flussocreditidetail";
            Tables.Add(tflussocreditidetail_fatt);
            tflussocreditidetail_fatt.defineKey("idflusso", "iddetail");

            //////////////////// ESTIMATEKIND /////////////////////////////////
            var testimatekind = new estimatekindTable();
            testimatekind.addBaseColumns("idestimkind", "active", "ct", "cu", "description", "idupb", "lt", "lu", "rtf", "txt", "email", "faxnumber", "office", "phonenumber", "linktoinvoice", "multireg", "deltaamount", "deltapercentage", "flag_autodocnumbering", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05", "address", "header", "idivakind_forced", "flag");
            Tables.Add(testimatekind);
            testimatekind.defineKey("idestimkind");

            //////////////////// INVOICEKIND /////////////////////////////////
            var tinvoicekind = new invoicekindTable();
            tinvoicekind.addBaseColumns("ct", "cu", "description", "lt", "lu", "codeinvkind", "idinvkind", "flag", "flag_autodocnumbering", "formatstring", "active", "idinvkind_auto", "printingcode", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05", "address", "header", "notes1", "notes2", "notes3", "ipa_fe", "riferimento_amministrazione", "enable_fe");
            Tables.Add(tinvoicekind);
            tinvoicekind.defineKey("idinvkind");

            //////////////////// ESTIMATEKIND1 /////////////////////////////////
            var testimatekind1 = new estimatekindTable();
            testimatekind1.TableName = "estimatekind1";
            testimatekind1.addBaseColumns("idestimkind", "active", "ct", "cu", "description", "idupb", "lt", "lu", "rtf", "txt", "email", "faxnumber", "office", "phonenumber", "linktoinvoice", "multireg", "deltaamount", "deltapercentage", "flag_autodocnumbering", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05", "address", "header", "idivakind_forced", "flag");
            testimatekind1.ExtendedProperties["TableForReading"] = "estimatekind";
            Tables.Add(testimatekind1);
            testimatekind1.defineKey("idestimkind");

            //////////////////// FLUSSOCREDITIDETAIL_UNLINKED /////////////////////////////////
            var tflussocreditidetail_unlinked = new flussocreditidetailTable();
            tflussocreditidetail_unlinked.TableName = "flussocreditidetail_unlinked";
            tflussocreditidetail_unlinked.addBaseColumns("idflusso", "iddetail", "cu", "ct", "lu", "lt", "importoversamento", "idestimkind", "yestim", "nestim", "rownum", "idinvkind", "yinv", "ninv", "invrownum", "competencystart", "competencystop", "description", "idaccmotivecredit", "idaccmotiverevenue", "idaccmotiveundotax", "idaccmotiveundotaxpost", "idfinmotive", "idreg", "iduniqueformcode", "idupb", "nform", "stop", "expirationdate", "barcodevalue", "barcodeimage", "qrcodevalue", "qrcodeimage", "cf", "iuv", "idunivoco", "codiceavviso", "annulment", "idsor1", "idsor2", "idsor3", "idivakind", "tax", "number", "p_iva", "annotations", "flag");
            tflussocreditidetail_unlinked.defineColumn("!invkind", typeof(string));
            tflussocreditidetail_unlinked.defineColumn("!cliente", typeof(string));
            tflussocreditidetail_unlinked.ExtendedProperties["TableForPosting"] = "flussocreditidetail";
            tflussocreditidetail_unlinked.ExtendedProperties["TableForReading"] = "flussocreditidetail";
            Tables.Add(tflussocreditidetail_unlinked);
            tflussocreditidetail_unlinked.defineKey("idflusso", "iddetail");

            //////////////////// ESTIMATEKIND2 /////////////////////////////////
            var testimatekind2 = new estimatekindTable();
            testimatekind2.TableName = "estimatekind2";
            testimatekind2.addBaseColumns("idestimkind", "active", "ct", "cu", "description", "idupb", "lt", "lu", "rtf", "txt", "email", "faxnumber", "office", "phonenumber", "linktoinvoice", "multireg", "deltaamount", "deltapercentage", "flag_autodocnumbering", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05", "address", "header", "idivakind_forced", "flag");
            testimatekind2.ExtendedProperties["TableForReading"] = "estimatekind";
            Tables.Add(testimatekind2);
            testimatekind2.defineKey("idestimkind");

            //////////////////// INVOICEKIND1 /////////////////////////////////
            var tinvoicekind1 = new invoicekindTable();
            tinvoicekind1.TableName = "invoicekind1";
            tinvoicekind1.addBaseColumns("ct", "cu", "description", "lt", "lu", "codeinvkind", "idinvkind", "flag", "flag_autodocnumbering", "formatstring", "active", "idinvkind_auto", "printingcode", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05", "address", "header", "notes1", "notes2", "notes3", "ipa_fe", "riferimento_amministrazione", "enable_fe");
            tinvoicekind1.ExtendedProperties["TableForReading"] = "invoicekind";
            Tables.Add(tinvoicekind1);
            tinvoicekind1.defineKey("idinvkind");

            #endregion


            #region DataRelation creation
            this.defineRelation("flussocrediti_flussocreditidetail_unlinked", "flussocrediti", "flussocreditidetail_unlinked", "idflusso");
            var cPar   = new [] { invoicedetail.Columns["ninv"], invoicedetail.Columns["rownum"], invoicedetail.Columns["yinv"], invoicedetail.Columns["idinvkind"] };
            var cChild = new [] { flussocreditidetail_fatt.Columns["ninv"], flussocreditidetail_fatt.Columns["invrownum"], flussocreditidetail_fatt.Columns["yinv"], flussocreditidetail_fatt.Columns["idinvkind"] };
            Relations.Add(new DataRelation("FK_invoicedetail_flussocreditidetail_fatt", cPar, cChild, false));

            this.defineRelation("FK_invoicekind_flussocreditidetail_fatt", "invoicekind", "flussocreditidetail_fatt", "idinvkind");
            this.defineRelation("FK_flussocrediti_flussocreditidetail_fatt", "flussocrediti", "flussocreditidetail_fatt", "idflusso");
            this.defineRelation("FK_estimatekind1_flussocreditidetail_ca", "estimatekind1", "flussocreditidetail_ca", "idestimkind");
            this.defineRelation("FK_flussocreditidetail_estimatedetail", "estimatedetail", "flussocreditidetail_ca", "idestimkind", "yestim", "nestim", "rownum");
            this.defineRelation("FK_flussocrediti_flussocreditidetail", "flussocrediti", "flussocreditidetail_ca", "idflusso");
            this.defineRelation("FK_estimatekind_estimatedetail", "estimatekind", "flussocrediti", "idestimkind");
            cPar   = new [] { sorting05.Columns["idsor"] };
            cChild = new [] { flussocrediti.Columns["idsor05"] };
            Relations.Add(new DataRelation("FK_sorting05_flussocrediti", cPar, cChild, false));

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

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

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

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

            #endregion
        }
Ejemplo n.º 4
0
        private void initClass()
        {
            DataSetName        = "dsmeta";
            Prefix             = "";
            Namespace          = "http://tempuri.org/dsmeta.xsd";
            EnforceConstraints = false;

            #region create DataTables
            //////////////////// EXPENSEPHASE /////////////////////////////////
            var texpensephase = new MetaTable("expensephase");
            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);
            texpensephase.defineColumn("nphase", typeof(byte), false);
            Tables.Add(texpensephase);
            texpensephase.defineKey("nphase");

            //////////////////// EXPENSEVIEW /////////////////////////////////
            var texpenseview = new MetaTable("expenseview");
            texpenseview.defineColumn("idexp", typeof(int), false);
            texpenseview.defineColumn("nphase", typeof(byte), false);
            texpenseview.defineColumn("phase", typeof(string), false);
            texpenseview.defineColumn("ymov", typeof(short), false);
            texpenseview.defineColumn("nmov", typeof(int), false);
            texpenseview.defineColumn("parentidexp", typeof(int));
            texpenseview.defineColumn("parentymov", typeof(short));
            texpenseview.defineColumn("parentnmov", typeof(int));
            texpenseview.defineColumn("idformerexpense", typeof(int));
            texpenseview.defineColumn("formerymov", typeof(short));
            texpenseview.defineColumn("formernmov", typeof(int));
            texpenseview.defineColumn("ayear", typeof(short), false);
            texpenseview.defineColumn("idfin", typeof(int));
            texpenseview.defineColumn("codefin", typeof(string));
            texpenseview.defineColumn("finance", typeof(string));
            texpenseview.defineColumn("idupb", typeof(string));
            texpenseview.defineColumn("codeupb", typeof(string));
            texpenseview.defineColumn("upb", typeof(string));
            texpenseview.defineColumn("idsor01", typeof(int));
            texpenseview.defineColumn("idsor02", typeof(int));
            texpenseview.defineColumn("idsor03", typeof(int));
            texpenseview.defineColumn("idsor04", typeof(int));
            texpenseview.defineColumn("idsor05", typeof(int));
            texpenseview.defineColumn("idreg", typeof(int));
            texpenseview.defineColumn("registry", typeof(string));
            texpenseview.defineColumn("cf", typeof(string));
            texpenseview.defineColumn("p_iva", typeof(string));
            texpenseview.defineColumn("idman", typeof(int));
            texpenseview.defineColumn("manager", typeof(string));
            texpenseview.defineColumn("kpay", typeof(int));
            texpenseview.defineColumn("ypay", typeof(short));
            texpenseview.defineColumn("npay", typeof(int));
            texpenseview.defineColumn("paymentadate", typeof(DateTime));
            texpenseview.defineColumn("doc", typeof(string));
            texpenseview.defineColumn("docdate", typeof(DateTime));
            texpenseview.defineColumn("description", typeof(string), false);
            texpenseview.defineColumn("amount", typeof(decimal));
            texpenseview.defineColumn("ayearstartamount", typeof(decimal));
            texpenseview.defineColumn("curramount", typeof(decimal));
            texpenseview.defineColumn("available", typeof(decimal));
            texpenseview.defineColumn("idregistrypaymethod", typeof(int));
            texpenseview.defineColumn("idpaymethod", typeof(int));
            texpenseview.defineColumn("iban", typeof(string));
            texpenseview.defineColumn("cin", typeof(string));
            texpenseview.defineColumn("idbank", typeof(string));
            texpenseview.defineColumn("idcab", typeof(string));
            texpenseview.defineColumn("cc", typeof(string));
            texpenseview.defineColumn("iddeputy", typeof(int));
            texpenseview.defineColumn("deputy", typeof(string));
            texpenseview.defineColumn("refexternaldoc", typeof(string));
            texpenseview.defineColumn("paymentdescr", typeof(string));
            texpenseview.defineColumn("idser", typeof(int));
            texpenseview.defineColumn("service", typeof(string));
            texpenseview.defineColumn("codeser", typeof(string));
            texpenseview.defineColumn("servicestart", typeof(DateTime));
            texpenseview.defineColumn("servicestop", typeof(DateTime));
            texpenseview.defineColumn("ivaamount", typeof(decimal));
            texpenseview.defineColumn("flag", typeof(byte));
            texpenseview.defineColumn("totflag", typeof(byte));
            texpenseview.defineColumn("flagarrear", typeof(string), true, true);
            texpenseview.defineColumn("autokind", typeof(byte));
            texpenseview.defineColumn("idpayment", typeof(int));
            texpenseview.defineColumn("expiration", typeof(DateTime));
            texpenseview.defineColumn("adate", typeof(DateTime), false);
            texpenseview.defineColumn("autocode", typeof(int));
            texpenseview.defineColumn("idclawback", typeof(int));
            texpenseview.defineColumn("clawback", typeof(string));
            texpenseview.defineColumn("clawbackref", typeof(string));
            texpenseview.defineColumn("nbill", typeof(int));
            texpenseview.defineColumn("idpay", typeof(int));
            texpenseview.defineColumn("npaymenttransmission", typeof(int));
            texpenseview.defineColumn("transmissiondate", typeof(DateTime));
            texpenseview.defineColumn("idaccdebit", typeof(string));
            texpenseview.defineColumn("codeaccdebit", typeof(string));
            texpenseview.defineColumn("cigcode", typeof(string));
            texpenseview.defineColumn("cupcode", typeof(string));
            texpenseview.defineColumn("txt", typeof(string));
            texpenseview.defineColumn("cu", typeof(string), false);
            texpenseview.defineColumn("ct", typeof(DateTime), false);
            texpenseview.defineColumn("lu", typeof(string), false);
            texpenseview.defineColumn("lt", typeof(DateTime), false);
            Tables.Add(texpenseview);

            //////////////////// CSA_CONTRACTKIND /////////////////////////////////
            var tcsa_contractkind = new MetaTable("csa_contractkind");
            tcsa_contractkind.defineColumn("idcsa_contractkind", typeof(int), false);
            tcsa_contractkind.defineColumn("contractkindcode", typeof(string), false);
            tcsa_contractkind.defineColumn("ct", typeof(DateTime), false);
            tcsa_contractkind.defineColumn("cu", typeof(string), false);
            tcsa_contractkind.defineColumn("description", typeof(string), false);
            tcsa_contractkind.defineColumn("flagcr", typeof(string), false);
            tcsa_contractkind.defineColumn("flagkeepalive", typeof(string));
            tcsa_contractkind.defineColumn("lt", typeof(DateTime), false);
            tcsa_contractkind.defineColumn("lu", typeof(string), false);
            tcsa_contractkind.defineColumn("active", typeof(string));
            tcsa_contractkind.defineColumn("idunderwriting", typeof(int));
            Tables.Add(tcsa_contractkind);
            tcsa_contractkind.defineKey("idcsa_contractkind");

            //////////////////// CSA_CONTRACTKINDYEAR /////////////////////////////////
            var tcsa_contractkindyear = new MetaTable("csa_contractkindyear");
            tcsa_contractkindyear.defineColumn("idcsa_contractkind", typeof(int), false);
            tcsa_contractkindyear.defineColumn("ayear", typeof(short), false);
            tcsa_contractkindyear.defineColumn("idupb", typeof(string));
            tcsa_contractkindyear.defineColumn("idacc_main", typeof(string));
            tcsa_contractkindyear.defineColumn("idfin_main", typeof(int));
            tcsa_contractkindyear.defineColumn("ct", typeof(DateTime), false);
            tcsa_contractkindyear.defineColumn("cu", typeof(string), false);
            tcsa_contractkindyear.defineColumn("lt", typeof(DateTime), false);
            tcsa_contractkindyear.defineColumn("lu", typeof(string), false);
            tcsa_contractkindyear.defineColumn("idsor_siope_main", typeof(int));
            Tables.Add(tcsa_contractkindyear);
            tcsa_contractkindyear.defineKey("idcsa_contractkind", "ayear");

            //////////////////// CSA_CONTRACT_PARTITION /////////////////////////////////
            var tcsa_contract_partition = new MetaTable("csa_contract_partition");
            tcsa_contract_partition.defineColumn("idcsa_contract", typeof(int), false);
            tcsa_contract_partition.defineColumn("ayear", typeof(short), false);
            tcsa_contract_partition.defineColumn("ndetail", typeof(int), false);
            tcsa_contract_partition.defineColumn("quota", typeof(double));
            tcsa_contract_partition.defineColumn("ct", typeof(DateTime), false);
            tcsa_contract_partition.defineColumn("lt", typeof(DateTime), false);
            tcsa_contract_partition.defineColumn("cu", typeof(string), false);
            tcsa_contract_partition.defineColumn("lu", typeof(string), false);
            tcsa_contract_partition.defineColumn("idepexp", typeof(int));
            tcsa_contract_partition.defineColumn("idupb", typeof(string));
            tcsa_contract_partition.defineColumn("idacc", typeof(string));
            tcsa_contract_partition.defineColumn("idfin", typeof(int));
            tcsa_contract_partition.defineColumn("idexp", typeof(int));
            tcsa_contract_partition.defineColumn("idsor_siope", typeof(int));
            Tables.Add(tcsa_contract_partition);
            tcsa_contract_partition.defineKey("idcsa_contract", "ayear", "ndetail");

            //////////////////// EPEXPVIEW /////////////////////////////////
            var tepexpview = new MetaTable("epexpview");
            tepexpview.defineColumn("idepexp", typeof(int), false);
            tepexpview.defineColumn("yepexp", typeof(short), false);
            tepexpview.defineColumn("nepexp", typeof(int), false);
            tepexpview.defineColumn("nphase", typeof(short), false);
            tepexpview.defineColumn("phase", typeof(string), true, true);
            tepexpview.defineColumn("flagvariation", typeof(string));
            tepexpview.defineColumn("description", typeof(string), false);
            tepexpview.defineColumn("amount", typeof(decimal), false);
            tepexpview.defineColumn("amount2", typeof(decimal));
            tepexpview.defineColumn("amount3", typeof(decimal));
            tepexpview.defineColumn("amount4", typeof(decimal));
            tepexpview.defineColumn("amount5", typeof(decimal));
            tepexpview.defineColumn("amountwithsign", typeof(decimal), true, true);
            tepexpview.defineColumn("amountwithsign2", typeof(decimal), true, true);
            tepexpview.defineColumn("amountwithsign3", typeof(decimal), true, true);
            tepexpview.defineColumn("amountwithsign4", typeof(decimal), true, true);
            tepexpview.defineColumn("amountwithsign5", typeof(decimal), true, true);
            tepexpview.defineColumn("totamount", typeof(decimal), true, true);
            tepexpview.defineColumn("curramount", typeof(decimal));
            tepexpview.defineColumn("curramount2", typeof(decimal));
            tepexpview.defineColumn("curramount3", typeof(decimal));
            tepexpview.defineColumn("curramount4", typeof(decimal));
            tepexpview.defineColumn("curramount5", typeof(decimal));
            tepexpview.defineColumn("totcurramount", typeof(decimal), true, true);
            tepexpview.defineColumn("available", typeof(decimal), true, true);
            tepexpview.defineColumn("available2", typeof(decimal), true, true);
            tepexpview.defineColumn("available3", typeof(decimal), true, true);
            tepexpview.defineColumn("available4", typeof(decimal), true, true);
            tepexpview.defineColumn("available5", typeof(decimal), true, true);
            tepexpview.defineColumn("totavailable", typeof(decimal), true, true);
            tepexpview.defineColumn("totalcost", typeof(decimal), true, true);
            tepexpview.defineColumn("costavailable", typeof(decimal), true, true);
            tepexpview.defineColumn("totaldebit", typeof(decimal), true, true);
            tepexpview.defineColumn("ayear", typeof(short), false);
            tepexpview.defineColumn("idacc", typeof(string), false);
            tepexpview.defineColumn("codeacc", typeof(string), false);
            tepexpview.defineColumn("account", typeof(string), false);
            tepexpview.defineColumn("idupb", typeof(string), false);
            tepexpview.defineColumn("codeupb", typeof(string), false);
            tepexpview.defineColumn("upb", typeof(string), false);
            tepexpview.defineColumn("paridepexp", typeof(int));
            tepexpview.defineColumn("parentyepexp", typeof(short));
            tepexpview.defineColumn("parentnepexp", typeof(int));
            tepexpview.defineColumn("yliv1", typeof(short), true, true);
            tepexpview.defineColumn("nliv1", typeof(int), true, true);
            tepexpview.defineColumn("start", typeof(DateTime));
            tepexpview.defineColumn("stop", typeof(DateTime));
            tepexpview.defineColumn("adate", typeof(DateTime), false);
            tepexpview.defineColumn("idreg", typeof(int));
            tepexpview.defineColumn("registry", typeof(string));
            tepexpview.defineColumn("doc", typeof(string));
            tepexpview.defineColumn("docdate", typeof(DateTime));
            tepexpview.defineColumn("idman", typeof(int));
            tepexpview.defineColumn("manager", typeof(string));
            tepexpview.defineColumn("idrelated", typeof(string));
            tepexpview.defineColumn("flagaccountusage", typeof(int));
            tepexpview.defineColumn("rateiattivi", typeof(string), true, true);
            tepexpview.defineColumn("rateipassivi", typeof(string), true, true);
            tepexpview.defineColumn("riscontiattivi", typeof(string), true, true);
            tepexpview.defineColumn("riscontipassivi", typeof(string), true, true);
            tepexpview.defineColumn("debit", typeof(string), true, true);
            tepexpview.defineColumn("credit", typeof(string), true, true);
            tepexpview.defineColumn("cost", typeof(string), true, true);
            tepexpview.defineColumn("revenue", typeof(string), true, true);
            tepexpview.defineColumn("fixedassets", typeof(string), true, true);
            tepexpview.defineColumn("freeusesurplus", typeof(string), true, true);
            tepexpview.defineColumn("captiveusesurplus", typeof(string), true, true);
            tepexpview.defineColumn("reserve", typeof(string), true, true);
            tepexpview.defineColumn("provision", typeof(string), true, true);
            tepexpview.defineColumn("idaccmotive", typeof(string));
            tepexpview.defineColumn("codemotive", typeof(string));
            tepexpview.defineColumn("lt", typeof(DateTime), false);
            tepexpview.defineColumn("lu", typeof(string), false);
            tepexpview.defineColumn("ct", typeof(DateTime), false);
            tepexpview.defineColumn("cu", typeof(string), false);
            tepexpview.defineColumn("idsor01", typeof(int));
            tepexpview.defineColumn("idsor02", typeof(int));
            tepexpview.defineColumn("idsor03", typeof(int));
            tepexpview.defineColumn("idsor04", typeof(int));
            tepexpview.defineColumn("idsor05", typeof(int));
            Tables.Add(tepexpview);

            //////////////////// 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");

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

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

            //////////////////// FASE_EPEXP /////////////////////////////////
            var tfase_epexp = new MetaTable("fase_epexp");
            tfase_epexp.defineColumn("nphase", typeof(int), false);
            tfase_epexp.defineColumn("descrizione", typeof(string));
            Tables.Add(tfase_epexp);
            tfase_epexp.defineKey("nphase");

            //////////////////// SORTING /////////////////////////////////
            var tsorting = new sortingTable();
            tsorting.addBaseColumns("ct", "cu", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5", "description", "flagnodate", "lt", "lu", "movkind", "printingorder", "rtf", "sortcode", "txt", "idsorkind", "idsor", "paridsor", "nlevel", "start", "stop", "email", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05");
            Tables.Add(tsorting);
            tsorting.defineKey("idsor");

            #endregion


            #region DataRelation creation
            this.defineRelation("FK_csa_contractkindyear_csa_contractkind", "csa_contractkind", "csa_contractkindyear", "idcsa_contractkind");
            this.defineRelation("epexpview_csa_contract_partition", "epexpview", "csa_contract_partition", "idepexp", "ayear");
            this.defineRelation("expenseview_csa_contract_partition", "expenseview", "csa_contract_partition", "idexp", "ayear");
            this.defineRelation("account_csa_contract_partition", "account", "csa_contract_partition", "idacc");
            this.defineRelation("upb_csa_contract_partition", "upb", "csa_contract_partition", "idupb");
            var cPar   = new [] { sorting.Columns["idsor"] };
            var cChild = new [] { csa_contract_partition.Columns["idsor_siope"] };
            Relations.Add(new DataRelation("sorting_csa_contract_partition", cPar, cChild, false));

            this.defineRelation("fin_csa_contract_partition", "fin", "csa_contract_partition", "idfin");
            #endregion
        }
Ejemplo n.º 5
0
        private void initClass()
        {
            DataSetName = "dsmeta";
            Prefix      = "";
            Namespace   = "http://tempuri.org/dsmeta.xsd";

            #region create DataTables
            //////////////////// MANDATEDETAIL /////////////////////////////////
            var tmandatedetail = new mandatedetailTable();
            tmandatedetail.addBaseColumns("yman", "nman", "rownum", "detaildescription", "annotations", "number", "taxable", "taxrate", "discount", "start", "stop", "cu", "ct", "lu", "lt", "idinv", "assetkind", "idexp_iva", "idexp_taxable", "idupb", "toinvoice", "idsor1", "idsor2", "idsor3", "idmankind", "competencystart", "competencystop", "tax", "idaccmotive", "idivakind", "unabatable", "flagmixed", "idreg", "idgroup", "idaccmotiveannulment", "flagactivity", "va3type", "ivanotes", "idlist", "idunit", "idpackage", "npackage", "unitsforpackage", "cupcode", "flagto_unload", "cigcode", "epkind", "rownum_origin", "contractamount", "idavcp", "idavcp_choice", "avcp_startcontract", "avcp_stopcontract", "avcp_description", "idcostpartition", "idpccdebitstatus", "idpccdebitmotive", "expensekind", "idepexp", "idepacc", "idlocation", "idupb_iva", "idsor_siope", "idepexp_pre");
            Tables.Add(tmandatedetail);
            tmandatedetail.defineKey("yman", "nman", "rownum", "idmankind");

            //////////////////// INVENTORYTREEVIEW /////////////////////////////////
            var tinventorytreeview = new MetaTable("inventorytreeview");
            tinventorytreeview.defineColumn("idinv", typeof(int), false);
            tinventorytreeview.defineColumn("codeinv", typeof(string), false);
            tinventorytreeview.defineColumn("nlevel", typeof(byte), false);
            tinventorytreeview.defineColumn("leveldescr", typeof(string), false);
            tinventorytreeview.defineColumn("paridinv", typeof(int));
            tinventorytreeview.defineColumn("description", typeof(string), false);
            tinventorytreeview.defineColumn("cu", typeof(string), false);
            tinventorytreeview.defineColumn("ct", typeof(DateTime), false);
            tinventorytreeview.defineColumn("lu", typeof(string), false);
            tinventorytreeview.defineColumn("lt", typeof(DateTime), false);
            Tables.Add(tinventorytreeview);
            tinventorytreeview.defineKey("idinv");

            //////////////////// EXPENSE_IVA /////////////////////////////////
            var texpense_iva = new expenseTable();
            texpense_iva.TableName = "expense_iva";
            texpense_iva.addBaseColumns("idexp", "nphase", "ymov", "nmov", "parentidexp", "idreg", "idman", "doc", "docdate", "description", "autokind", "idpayment", "expiration", "adate", "txt", "cu", "ct", "lu", "lt", "idformerexpense", "autocode");
            texpense_iva.ExtendedProperties["TableForReading"] = "expense";
            Tables.Add(texpense_iva);
            texpense_iva.defineKey("idexp");

            //////////////////// EXPENSE_IMPONIBILE /////////////////////////////////
            var texpense_imponibile = new expenseTable();
            texpense_imponibile.TableName = "expense_imponibile";
            texpense_imponibile.addBaseColumns("idexp", "nphase", "ymov", "nmov", "parentidexp", "idreg", "idman", "doc", "docdate", "description", "autokind", "idpayment", "expiration", "adate", "txt", "cu", "ct", "lu", "lt", "idformerexpense", "autocode");
            texpense_imponibile.ExtendedProperties["TableForReading"] = "expense";
            Tables.Add(texpense_imponibile);
            texpense_imponibile.defineKey("idexp");

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

            //////////////////// SORTING1 /////////////////////////////////
            var tsorting1 = new sortingTable();
            tsorting1.TableName = "sorting1";
            tsorting1.addBaseColumns("idsorkind", "idsor", "sortcode", "paridsor", "nlevel", "description", "txt", "rtf", "cu", "ct", "lu", "lt", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "flagnodate", "movkind", "printingorder", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5");
            tsorting1.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting1);
            tsorting1.defineKey("idsor");

            //////////////////// SORTING2 /////////////////////////////////
            var tsorting2 = new sortingTable();
            tsorting2.TableName = "sorting2";
            tsorting2.addBaseColumns("idsorkind", "idsor", "sortcode", "paridsor", "nlevel", "description", "txt", "rtf", "cu", "ct", "lu", "lt", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "flagnodate", "movkind", "printingorder", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5");
            tsorting2.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting2);
            tsorting2.defineKey("idsor");

            //////////////////// SORTING3 /////////////////////////////////
            var tsorting3 = new sortingTable();
            tsorting3.TableName = "sorting3";
            tsorting3.addBaseColumns("idsorkind", "idsor", "sortcode", "paridsor", "nlevel", "description", "txt", "rtf", "cu", "ct", "lu", "lt", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "flagnodate", "movkind", "printingorder", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5");
            tsorting3.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting3);
            tsorting3.defineKey("idsor");

            //////////////////// INVOICEDETAIL /////////////////////////////////
            var tinvoicedetail = new invoicedetailTable();
            tinvoicedetail.addBaseColumns("idinvkind", "yinv", "ninv", "rownum", "idivakind", "detaildescription", "annotations", "taxable", "tax", "unabatable", "cu", "ct", "lu", "lt", "discount", "idmankind", "yman", "nman", "manrownum", "number", "idupb", "idsor1", "idsor2", "idsor3", "competencystart", "competencystop");
            tinvoicedetail.defineColumn("!tipodocumento", typeof(string));
            Tables.Add(tinvoicedetail);
            tinvoicedetail.defineKey("idinvkind", "yinv", "ninv", "rownum");

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

            //////////////////// ACCMOTIVEAPPLIED /////////////////////////////////
            var taccmotiveapplied = new accmotiveappliedTable();
            taccmotiveapplied.addBaseColumns("idaccmotive", "paridaccmotive", "codemotive", "motive", "cu", "ct", "lu", "lt", "active", "idepoperation", "epoperation", "in_use", "flagdep", "flagamm", "expensekind");
            Tables.Add(taccmotiveapplied);
            taccmotiveapplied.defineKey("idaccmotive");

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

            //////////////////// REGISTRYMAINVIEW /////////////////////////////////
            var tregistrymainview = new MetaTable("registrymainview");
            tregistrymainview.defineColumn("idreg", typeof(int), false);
            tregistrymainview.defineColumn("title", typeof(string), false);
            tregistrymainview.defineColumn("idregistryclass", typeof(string));
            tregistrymainview.defineColumn("registryclass", typeof(string));
            tregistrymainview.defineColumn("surname", typeof(string));
            tregistrymainview.defineColumn("forename", typeof(string));
            tregistrymainview.defineColumn("cf", typeof(string));
            tregistrymainview.defineColumn("p_iva", typeof(string));
            tregistrymainview.defineColumn("residence", typeof(int), false);
            tregistrymainview.defineColumn("residencekind", typeof(string));
            tregistrymainview.defineColumn("annotation", typeof(string));
            tregistrymainview.defineColumn("birthdate", typeof(DateTime));
            tregistrymainview.defineColumn("idcity", typeof(int));
            tregistrymainview.defineColumn("city", typeof(string));
            tregistrymainview.defineColumn("gender", typeof(string));
            tregistrymainview.defineColumn("foreigncf", typeof(string));
            tregistrymainview.defineColumn("idtitle", typeof(string));
            tregistrymainview.defineColumn("qualification", typeof(string));
            tregistrymainview.defineColumn("idmaritalstatus", typeof(string));
            tregistrymainview.defineColumn("maritalstatus", typeof(string));
            tregistrymainview.defineColumn("sortcode", typeof(string));
            tregistrymainview.defineColumn("registrykind", typeof(string));
            tregistrymainview.defineColumn("human", typeof(string));
            tregistrymainview.defineColumn("active", typeof(string), false);
            tregistrymainview.defineColumn("badgecode", typeof(string));
            tregistrymainview.defineColumn("maritalsurname", typeof(string));
            tregistrymainview.defineColumn("idcategory", typeof(string));
            tregistrymainview.defineColumn("extmatricula", typeof(string));
            tregistrymainview.defineColumn("idcentralizedcategory", typeof(string));
            tregistrymainview.defineColumn("cu", typeof(string), false);
            tregistrymainview.defineColumn("ct", typeof(DateTime), false);
            tregistrymainview.defineColumn("lu", typeof(string), false);
            tregistrymainview.defineColumn("lt", typeof(DateTime), false);
            tregistrymainview.defineColumn("location", typeof(string));
            tregistrymainview.defineColumn("idnation", typeof(int));
            tregistrymainview.defineColumn("nation", typeof(string));
            Tables.Add(tregistrymainview);
            tregistrymainview.defineKey("idreg");

            //////////////////// ACCMOTIVEAPPLIEDANNULMENT /////////////////////////////////
            var taccmotiveappliedannulment = new MetaTable("accmotiveappliedannulment");
            taccmotiveappliedannulment.defineColumn("idaccmotive", typeof(string), false);
            taccmotiveappliedannulment.defineColumn("paridaccmotive", typeof(string));
            taccmotiveappliedannulment.defineColumn("codemotive", typeof(string), false);
            taccmotiveappliedannulment.defineColumn("motive", typeof(string), false);
            taccmotiveappliedannulment.defineColumn("cu", typeof(string), false);
            taccmotiveappliedannulment.defineColumn("ct", typeof(DateTime), false);
            taccmotiveappliedannulment.defineColumn("lu", typeof(string), false);
            taccmotiveappliedannulment.defineColumn("lt", typeof(DateTime), false);
            taccmotiveappliedannulment.defineColumn("active", typeof(string));
            taccmotiveappliedannulment.defineColumn("idepoperation", typeof(string), false);
            taccmotiveappliedannulment.defineColumn("epoperation", typeof(string));
            taccmotiveappliedannulment.defineColumn("in_use", typeof(string));
            taccmotiveappliedannulment.defineColumn("flagdep", typeof(string));
            taccmotiveappliedannulment.defineColumn("flagamm", typeof(string));
            Tables.Add(taccmotiveappliedannulment);
            taccmotiveappliedannulment.defineKey("idaccmotive");

            //////////////////// LISTCLASS /////////////////////////////////
            var tlistclass = new MetaTable("listclass");
            tlistclass.defineColumn("idlistclass", typeof(string), false);
            tlistclass.defineColumn("active", typeof(string), false);
            tlistclass.defineColumn("codelistclass", typeof(string), false);
            tlistclass.defineColumn("paridlistclass", typeof(string));
            tlistclass.defineColumn("printingorder", typeof(string), false);
            tlistclass.defineColumn("title", typeof(string), false);
            tlistclass.defineColumn("rtf", typeof(Byte[]));
            tlistclass.defineColumn("txt", typeof(string));
            tlistclass.defineColumn("ct", typeof(DateTime), false);
            tlistclass.defineColumn("cu", typeof(string), false);
            tlistclass.defineColumn("lt", typeof(DateTime), false);
            tlistclass.defineColumn("lu", typeof(string), false);
            tlistclass.defineColumn("flagvisiblekind", typeof(byte));
            Tables.Add(tlistclass);
            tlistclass.defineKey("idlistclass");

            //////////////////// LISTVIEW /////////////////////////////////
            var tlistview = new MetaTable("listview");
            tlistview.defineColumn("idlist", typeof(int), false);
            tlistview.defineColumn("description", typeof(string), false);
            tlistview.defineColumn("intcode", typeof(string), false);
            tlistview.defineColumn("intbarcode", typeof(string));
            tlistview.defineColumn("extcode", typeof(string));
            tlistview.defineColumn("extbarcode", typeof(string));
            tlistview.defineColumn("validitystop", typeof(DateTime));
            tlistview.defineColumn("active", typeof(string), false);
            tlistview.defineColumn("idpackage", typeof(int));
            tlistview.defineColumn("idunit", typeof(int));
            tlistview.defineColumn("unitsforpackage", typeof(int));
            tlistview.defineColumn("has_expiry", typeof(string), false);
            tlistview.defineColumn("idlistclass", typeof(string), false);
            tlistview.defineColumn("codelistclass", typeof(string), false);
            tlistview.defineColumn("listclass", typeof(string), false);
            tlistview.defineColumn("package", typeof(string));
            tlistview.defineColumn("unit", typeof(string));
            Tables.Add(tlistview);
            tlistview.defineKey("idlist");

            //////////////////// UNIT /////////////////////////////////
            var tunit = new MetaTable("unit");
            tunit.defineColumn("idunit", typeof(int), false);
            tunit.defineColumn("description", typeof(string), false);
            tunit.defineColumn("cu", typeof(string), false);
            tunit.defineColumn("ct", typeof(DateTime), false);
            tunit.defineColumn("lu", typeof(string), false);
            tunit.defineColumn("lt", typeof(DateTime), false);
            tunit.defineColumn("active", typeof(string), false);
            Tables.Add(tunit);
            tunit.defineKey("idunit");

            //////////////////// PACKAGE /////////////////////////////////
            var tpackage = new MetaTable("package");
            tpackage.defineColumn("idpackage", typeof(int), false);
            tpackage.defineColumn("description", typeof(string));
            tpackage.defineColumn("cu", typeof(string), false);
            tpackage.defineColumn("ct", typeof(DateTime), false);
            tpackage.defineColumn("lu", typeof(string), false);
            tpackage.defineColumn("lt", typeof(DateTime), false);
            tpackage.defineColumn("active", typeof(string), false);
            Tables.Add(tpackage);
            tpackage.defineKey("idpackage");

            //////////////////// STOCKVIEW /////////////////////////////////
            var tstockview = new MetaTable("stockview");
            tstockview.defineColumn("idstock", typeof(int), false);
            tstockview.defineColumn("idstore", typeof(int), false);
            tstockview.defineColumn("store", typeof(string), false);
            tstockview.defineColumn("idlist", typeof(int), false);
            tstockview.defineColumn("number", typeof(decimal), false);
            tstockview.defineColumn("residual", typeof(decimal), true, true);
            tstockview.defineColumn("amount", typeof(decimal), false);
            tstockview.defineColumn("expiry", typeof(DateTime));
            tstockview.defineColumn("idmankind", typeof(string));
            tstockview.defineColumn("mandatekind", typeof(string));
            tstockview.defineColumn("yman", typeof(short));
            tstockview.defineColumn("nman", typeof(int));
            tstockview.defineColumn("man_idgroup", typeof(int));
            tstockview.defineColumn("idinvkind", typeof(int));
            tstockview.defineColumn("invoicekind", typeof(string));
            tstockview.defineColumn("yinv", typeof(short));
            tstockview.defineColumn("ninv", typeof(int));
            tstockview.defineColumn("inv_idgroup", typeof(int));
            tstockview.defineColumn("idddt_in", typeof(int));
            tstockview.defineColumn("idstoreload_motive", typeof(int));
            tstockview.defineColumn("storeload_motive", typeof(string));
            tstockview.defineColumn("list", typeof(string), false);
            tstockview.defineColumn("intcode", typeof(string), false);
            tstockview.defineColumn("unit", typeof(string));
            tstockview.defineColumn("yddt_in", typeof(short));
            tstockview.defineColumn("nddt_in", typeof(string));
            tstockview.defineColumn("codelistclass", typeof(string));
            tstockview.defineColumn("listclass", typeof(string));
            tstockview.defineColumn("authrequired", typeof(string));
            tstockview.defineColumn("flagto_unload", typeof(string));
            tstockview.defineColumn("adate", typeof(DateTime));
            tstockview.defineColumn("idstocklocation", typeof(int));
            tstockview.defineColumn("stocklocationcode", typeof(string));
            tstockview.defineColumn("stocklocation", typeof(string));
            Tables.Add(tstockview);
            tstockview.defineKey("idstock");

            //////////////////// MANDATEKIND /////////////////////////////////
            var tmandatekind = new mandatekindTable();
            tmandatekind.addBaseColumns("idmankind", "active", "ct", "cu", "description", "idupb", "lt", "lu", "rtf", "txt", "email", "faxnumber", "office", "phonenumber", "linktoasset", "linktoinvoice", "multireg", "deltaamount", "deltapercentage", "flag_autodocnumbering", "flagactivity", "name_c", "name_l", "name_r", "title_c", "title_l", "title_r", "notes1", "notes2", "notes3", "warnmail", "isrequest", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05", "assetkind", "dangermail", "address", "header", "flag", "touniqueregister", "idivakind_forced");
            Tables.Add(tmandatekind);
            tmandatekind.defineKey("idmankind");

            //////////////////// PCCDEBITMOTIVE /////////////////////////////////
            var tpccdebitmotive = new MetaTable("pccdebitmotive");
            tpccdebitmotive.defineColumn("idpccdebitmotive", typeof(string), false);
            tpccdebitmotive.defineColumn("description", typeof(string));
            tpccdebitmotive.defineColumn("listingorder", typeof(int));
            tpccdebitmotive.defineColumn("lu", typeof(string), false);
            tpccdebitmotive.defineColumn("lt", typeof(DateTime), false);
            tpccdebitmotive.defineColumn("flagstatus", typeof(int));
            Tables.Add(tpccdebitmotive);
            tpccdebitmotive.defineKey("idpccdebitmotive");

            //////////////////// PCCDEBITSTATUS /////////////////////////////////
            var tpccdebitstatus = new MetaTable("pccdebitstatus");
            tpccdebitstatus.defineColumn("idpccdebitstatus", typeof(string), false);
            tpccdebitstatus.defineColumn("description", typeof(string));
            tpccdebitstatus.defineColumn("lt", typeof(DateTime), false);
            tpccdebitstatus.defineColumn("lu", typeof(string), false);
            tpccdebitstatus.defineColumn("listingorder", typeof(int));
            tpccdebitstatus.defineColumn("flag", typeof(int));
            Tables.Add(tpccdebitstatus);
            tpccdebitstatus.defineKey("idpccdebitstatus");

            //////////////////// COSTPARTITION /////////////////////////////////
            var tcostpartition = new MetaTable("costpartition");
            tcostpartition.defineColumn("idcostpartition", typeof(int), false);
            tcostpartition.defineColumn("title", typeof(string));
            tcostpartition.defineColumn("kind", typeof(string));
            tcostpartition.defineColumn("lt", typeof(DateTime));
            tcostpartition.defineColumn("lu", typeof(string));
            tcostpartition.defineColumn("ct", typeof(DateTime));
            tcostpartition.defineColumn("cu", typeof(string));
            tcostpartition.defineColumn("costpartitioncode", typeof(string));
            tcostpartition.defineColumn("active", typeof(string));
            tcostpartition.defineColumn("description", typeof(string));
            Tables.Add(tcostpartition);
            tcostpartition.defineKey("idcostpartition");

            //////////////////// EPEXP /////////////////////////////////
            var tepexp = new epexpTable();
            tepexp.addBaseColumns("idepexp", "adate", "ct", "cu", "description", "doc", "docdate", "idman", "idreg", "idrelated", "lt", "lu", "nepexp", "nphase", "paridepexp", "rtf", "start", "stop", "txt", "yepexp");
            Tables.Add(tepexp);
            tepexp.defineKey("idepexp");

            //////////////////// EPACC /////////////////////////////////
            var tepacc = new MetaTable("epacc");
            tepacc.defineColumn("idepacc", typeof(int), false);
            tepacc.defineColumn("adate", typeof(DateTime), false);
            tepacc.defineColumn("ct", typeof(DateTime), false);
            tepacc.defineColumn("cu", typeof(string), false);
            tepacc.defineColumn("description", typeof(string), false);
            tepacc.defineColumn("doc", typeof(string));
            tepacc.defineColumn("docdate", typeof(DateTime));
            tepacc.defineColumn("idman", typeof(int));
            tepacc.defineColumn("idreg", typeof(int));
            tepacc.defineColumn("idrelated", typeof(string));
            tepacc.defineColumn("lt", typeof(DateTime), false);
            tepacc.defineColumn("lu", typeof(string), false);
            tepacc.defineColumn("nepacc", typeof(int), false);
            tepacc.defineColumn("nphase", typeof(short), false);
            tepacc.defineColumn("paridepacc", typeof(int));
            tepacc.defineColumn("rtf", typeof(Byte[]));
            tepacc.defineColumn("start", typeof(DateTime));
            tepacc.defineColumn("stop", typeof(DateTime));
            tepacc.defineColumn("txt", typeof(string));
            tepacc.defineColumn("yepacc", typeof(short), false);
            tepacc.defineColumn("flagvariation", typeof(string));
            Tables.Add(tepacc);
            tepacc.defineKey("idepacc");

            //////////////////// LOCATIONVIEW /////////////////////////////////
            var tlocationview = new MetaTable("locationview");
            tlocationview.defineColumn("idlocation", typeof(int), false);
            tlocationview.defineColumn("locationcode", typeof(string), false);
            tlocationview.defineColumn("active", typeof(string), false);
            tlocationview.defineColumn("nlevel", typeof(byte), false);
            tlocationview.defineColumn("leveldescr", typeof(string), false);
            tlocationview.defineColumn("paridlocation", typeof(int));
            tlocationview.defineColumn("description", typeof(string), false);
            tlocationview.defineColumn("idman", typeof(int));
            tlocationview.defineColumn("manager", typeof(string));
            tlocationview.defineColumn("cu", typeof(string), false);
            tlocationview.defineColumn("ct", typeof(DateTime), false);
            tlocationview.defineColumn("lu", typeof(string), false);
            tlocationview.defineColumn("lt", typeof(DateTime), false);
            tlocationview.defineColumn("idsor01", typeof(int));
            tlocationview.defineColumn("idsor02", typeof(int));
            tlocationview.defineColumn("idsor03", typeof(int));
            tlocationview.defineColumn("idsor04", typeof(int));
            tlocationview.defineColumn("idsor05", typeof(int));
            Tables.Add(tlocationview);
            tlocationview.defineKey("idlocation");

            //////////////////// UPB_IVA /////////////////////////////////
            var tupb_iva = new upbTable();
            tupb_iva.TableName = "upb_iva";
            tupb_iva.addBaseColumns("idupb", "active", "assured", "codeupb", "ct", "cu", "expiration", "granted", "lt", "lu", "paridupb", "previousappropriation", "previousassessment", "printingorder", "requested", "rtf", "title", "txt", "idman", "idunderwriter", "cupcode", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05", "flagactivity", "flagkind", "newcodeupb", "idtreasurer", "start", "stop", "cigcode", "idepupbkind", "flag");
            tupb_iva.ExtendedProperties["TableForReading"] = "upb";
            Tables.Add(tupb_iva);
            tupb_iva.defineKey("idupb");

            //////////////////// SORTING_SIOPE /////////////////////////////////
            var tsorting_siope = new sortingTable();
            tsorting_siope.TableName = "sorting_siope";
            tsorting_siope.addBaseColumns("ct", "cu", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5", "description", "flagnodate", "lt", "lu", "movkind", "printingorder", "rtf", "sortcode", "txt", "idsorkind", "idsor", "paridsor", "nlevel", "start", "stop", "email");
            tsorting_siope.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting_siope);
            tsorting_siope.defineKey("idsor");

            //////////////////// PRE_EPEXP /////////////////////////////////
            var tpre_epexp = new epexpTable();
            tpre_epexp.TableName = "pre_epexp";
            tpre_epexp.addBaseColumns("idepexp", "adate", "ct", "cu", "description", "doc", "docdate", "idman", "idreg", "idrelated", "lt", "lu", "nepexp", "nphase", "paridepexp", "rtf", "start", "stop", "txt", "yepexp");
            tpre_epexp.ExtendedProperties["TableForReading"] = "epexp";
            Tables.Add(tpre_epexp);
            tpre_epexp.defineKey("idepexp");

            #endregion


            #region DataRelation creation
            var cPar   = new [] { sorting_siope.Columns["idsor"] };
            var cChild = new [] { mandatedetail.Columns["idsor_siope"] };
            Relations.Add(new DataRelation("FK_sorting_siope_mandatedetail", cPar, cChild, false));

            cPar   = new [] { upb_iva.Columns["idupb"] };
            cChild = new [] { mandatedetail.Columns["idupb_iva"] };
            Relations.Add(new DataRelation("FK_upb_iva_mandatedetail", cPar, cChild, false));

            cPar   = new [] { mandatedetail.Columns["yman"], mandatedetail.Columns["nman"], mandatedetail.Columns["idgroup"], mandatedetail.Columns["idmankind"] };
            cChild = new [] { stockview.Columns["yman"], stockview.Columns["nman"], stockview.Columns["man_idgroup"], stockview.Columns["idmankind"] };
            Relations.Add(new DataRelation("mandatedetail_stockview", cPar, cChild, false));

            this.defineRelation("invoicekindinvoicedetail", "invoicekind", "invoicedetail", "idinvkind");
            cPar   = new [] { mandatedetail.Columns["yman"], mandatedetail.Columns["nman"], mandatedetail.Columns["rownum"], mandatedetail.Columns["idmankind"] };
            cChild = new [] { invoicedetail.Columns["yman"], invoicedetail.Columns["nman"], invoicedetail.Columns["manrownum"], invoicedetail.Columns["idmankind"] };
            Relations.Add(new DataRelation("mandatedetailinvoicedetail", cPar, cChild, false));

            this.defineRelation("FK_epexp_mandatedetail", "epexp", "mandatedetail", "idepexp");
            this.defineRelation("FK_pccdebitmotive_mandatedetail", "pccdebitmotive", "mandatedetail", "idpccdebitmotive");
            this.defineRelation("FK_pccdebitstatus_mandatedetail", "pccdebitstatus", "mandatedetail", "idpccdebitstatus");
            this.defineRelation("FK_unit_mandatedetail", "unit", "mandatedetail", "idunit");
            this.defineRelation("FK_package_mandatedetail", "package", "mandatedetail", "idpackage");
            this.defineRelation("FK_listview_mandatedetail", "listview", "mandatedetail", "idlist");
            this.defineRelation("registrymainviewmandatedetail", "registrymainview", "mandatedetail", "idreg");
            this.defineRelation("ivakindmandatedetail", "ivakind", "mandatedetail", "idivakind");
            this.defineRelation("accmotiveappliedmandatedetail", "accmotiveapplied", "mandatedetail", "idaccmotive");
            cPar   = new [] { expense_imponibile.Columns["idexp"] };
            cChild = new [] { mandatedetail.Columns["idexp_taxable"] };
            Relations.Add(new DataRelation("expense_imponibilemandatedetail", cPar, cChild, false));

            cPar   = new [] { expense_iva.Columns["idexp"] };
            cChild = new [] { mandatedetail.Columns["idexp_iva"] };
            Relations.Add(new DataRelation("expense_ivamandatedetail", cPar, cChild, false));

            this.defineRelation("inventorytreeviewmandatedetail", "inventorytreeview", "mandatedetail", "idinv");
            cPar   = new [] { sorting1.Columns["idsor"] };
            cChild = new [] { mandatedetail.Columns["idsor1"] };
            Relations.Add(new DataRelation("sortingmandatedetail", cPar, cChild, false));

            cPar   = new [] { sorting2.Columns["idsor"] };
            cChild = new [] { mandatedetail.Columns["idsor2"] };
            Relations.Add(new DataRelation("sortingmandatedetail1", cPar, cChild, false));

            cPar   = new [] { sorting3.Columns["idsor"] };
            cChild = new [] { mandatedetail.Columns["idsor3"] };
            Relations.Add(new DataRelation("sorting3mandatedetail", cPar, cChild, false));

            cPar   = new [] { accmotiveappliedannulment.Columns["idaccmotive"] };
            cChild = new [] { mandatedetail.Columns["idaccmotiveannulment"] };
            Relations.Add(new DataRelation("accmotiveappliedannulment_mandatedetail", cPar, cChild, false));

            this.defineRelation("mandatekind_mandatedetail", "mandatekind", "mandatedetail", "idmankind");
            this.defineRelation("costpartition_mandatedetail", "costpartition", "mandatedetail", "idcostpartition");
            cPar   = new [] { mandatekind.Columns["idivakind_forced"] };
            cChild = new [] { mandatedetail.Columns["idivakind"] };
            Relations.Add(new DataRelation("mandatekind_mandatedetail1", cPar, cChild, false));

            this.defineRelation("epacc_mandatedetail", "epacc", "mandatedetail", "idepacc");
            this.defineRelation("upbmandatedetail", "upb", "mandatedetail", "idupb");
            this.defineRelation("locationview_mandatedetail", "locationview", "mandatedetail", "idlocation");
            cPar   = new [] { pre_epexp.Columns["idepexp"] };
            cChild = new [] { mandatedetail.Columns["idepexp_pre"] };
            Relations.Add(new DataRelation("pre_epexp_mandatedetail", cPar, cChild, false));

            #endregion
        }
Ejemplo n.º 6
0
        private void initClass()
        {
            DataSetName = "dsmeta";
            Prefix      = "";
            Namespace   = "http://tempuri.org/dsmeta.xsd";

            #region create DataTables
            //////////////////// ESTIMATEKIND /////////////////////////////////
            var testimatekind = new estimatekindTable();
            testimatekind.addBaseColumns("idestimkind", "active", "ct", "cu", "description", "idupb", "lt", "lu", "rtf", "txt", "email", "faxnumber", "office", "phonenumber", "linktoinvoice", "multireg", "deltaamount", "deltapercentage", "flag_autodocnumbering", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05", "address", "header", "idivakind_forced", "flag");
            Tables.Add(testimatekind);
            testimatekind.defineKey("idestimkind");

            //////////////////// FLUSSOCREDITIDETAIL /////////////////////////////////
            var tflussocreditidetail = new flussocreditidetailTable();
            tflussocreditidetail.addBaseColumns("idflusso", "iddetail", "cu", "ct", "lu", "lt", "importoversamento", "idestimkind", "yestim", "nestim", "rownum", "idinvkind", "yinv", "ninv", "invrownum", "competencystart", "competencystop", "description", "idaccmotivecredit", "idaccmotiverevenue", "idaccmotiveundotax", "idaccmotiveundotaxpost", "idfinmotive", "idreg", "iduniqueformcode", "idupb", "nform", "stop", "expirationdate", "cf", "iuv", "annulment", "idunivoco", "codiceavviso", "idsor1", "idsor2", "idsor3", "tax", "barcodevalue", "barcodeimage", "qrcodevalue", "qrcodeimage", "idivakind", "number", "p_iva", "annotations", "idlist", "idupb_iva", "flag");
            Tables.Add(tflussocreditidetail);
            tflussocreditidetail.defineKey("idflusso", "iddetail");

            //////////////////// INVOICEKIND /////////////////////////////////
            var tinvoicekind = new invoicekindTable();
            tinvoicekind.addBaseColumns("ct", "cu", "description", "lt", "lu", "codeinvkind", "idinvkind", "flag", "flag_autodocnumbering", "formatstring", "active", "idinvkind_auto", "printingcode", "idsor01", "idsor02", "idsor03", "idsor04", "idsor05", "address", "header", "notes1", "notes2", "notes3", "ipa_fe", "riferimento_amministrazione", "enable_fe");
            Tables.Add(tinvoicekind);
            tinvoicekind.defineKey("idinvkind");

            //////////////////// FINMOTIVE_INCOME /////////////////////////////////
            var tfinmotive_income = new MetaTable("finmotive_income");
            tfinmotive_income.defineColumn("idfinmotive", typeof(string), false);
            tfinmotive_income.defineColumn("active", typeof(string), false);
            tfinmotive_income.defineColumn("codemotive", typeof(string), false);
            tfinmotive_income.defineColumn("paridfinmotive", typeof(string));
            tfinmotive_income.defineColumn("title", typeof(string), false);
            tfinmotive_income.defineColumn("lt", typeof(DateTime));
            tfinmotive_income.defineColumn("lu", typeof(string));
            tfinmotive_income.defineColumn("ct", typeof(DateTime));
            tfinmotive_income.defineColumn("cu", typeof(string));
            tfinmotive_income.ExtendedProperties["TableForReading"] = "finmotive";
            Tables.Add(tfinmotive_income);
            tfinmotive_income.defineKey("idfinmotive");

            //////////////////// ACCMOTIVEAPPLIED_CREDIT /////////////////////////////////
            var taccmotiveapplied_credit = new accmotiveappliedTable();
            taccmotiveapplied_credit.TableName = "accmotiveapplied_credit";
            taccmotiveapplied_credit.addBaseColumns("idaccmotive", "paridaccmotive", "codemotive", "motive", "cu", "ct", "lu", "lt", "active", "idepoperation", "epoperation", "in_use", "flagamm", "flagdep", "expensekind");
            taccmotiveapplied_credit.ExtendedProperties["TableForReading"] = "accmotiveapplied";
            Tables.Add(taccmotiveapplied_credit);
            taccmotiveapplied_credit.defineKey("idepoperation", "idaccmotive");

            //////////////////// ACCMOTIVEAPPLIED_REVENUE /////////////////////////////////
            var taccmotiveapplied_revenue = new accmotiveappliedTable();
            taccmotiveapplied_revenue.TableName = "accmotiveapplied_revenue";
            taccmotiveapplied_revenue.addBaseColumns("idaccmotive", "paridaccmotive", "codemotive", "motive", "cu", "ct", "lu", "lt", "active", "idepoperation", "epoperation", "in_use", "flagamm", "flagdep", "expensekind");
            taccmotiveapplied_revenue.ExtendedProperties["TableForReading"] = "accmotiveapplied";
            Tables.Add(taccmotiveapplied_revenue);
            taccmotiveapplied_revenue.defineKey("idaccmotive", "idepoperation");

            //////////////////// ACCMOTIVEAPPLIED_UNDOTAX /////////////////////////////////
            var taccmotiveapplied_undotax = new accmotiveappliedTable();
            taccmotiveapplied_undotax.TableName = "accmotiveapplied_undotax";
            taccmotiveapplied_undotax.addBaseColumns("idaccmotive", "paridaccmotive", "codemotive", "motive", "cu", "ct", "lu", "lt", "active", "idepoperation", "epoperation", "in_use", "flagamm", "flagdep", "expensekind");
            taccmotiveapplied_undotax.ExtendedProperties["TableForReading"] = "accmotiveapplied";
            Tables.Add(taccmotiveapplied_undotax);
            taccmotiveapplied_undotax.defineKey("idaccmotive", "idepoperation");

            //////////////////// ACCMOTIVEAPPLIED_UNDOTAXPOST /////////////////////////////////
            var taccmotiveapplied_undotaxpost = new accmotiveappliedTable();
            taccmotiveapplied_undotaxpost.TableName = "accmotiveapplied_undotaxpost";
            taccmotiveapplied_undotaxpost.addBaseColumns("idaccmotive", "paridaccmotive", "codemotive", "motive", "cu", "ct", "lu", "lt", "active", "idepoperation", "epoperation", "in_use", "flagamm", "flagdep", "expensekind");
            taccmotiveapplied_undotaxpost.ExtendedProperties["TableForReading"] = "accmotiveapplied";
            Tables.Add(taccmotiveapplied_undotaxpost);
            taccmotiveapplied_undotaxpost.defineKey("idaccmotive", "idepoperation");

            //////////////////// REGISTRYMAINVIEW /////////////////////////////////
            var tregistrymainview = new MetaTable("registrymainview");
            tregistrymainview.defineColumn("idreg", typeof(int), false);
            tregistrymainview.defineColumn("title", typeof(string), false);
            tregistrymainview.defineColumn("idregistryclass", typeof(string));
            tregistrymainview.defineColumn("registryclass", typeof(string));
            tregistrymainview.defineColumn("surname", typeof(string));
            tregistrymainview.defineColumn("forename", typeof(string));
            tregistrymainview.defineColumn("cf", typeof(string));
            tregistrymainview.defineColumn("p_iva", typeof(string));
            tregistrymainview.defineColumn("residence", typeof(int), false);
            tregistrymainview.defineColumn("coderesidence", typeof(string));
            tregistrymainview.defineColumn("residencekind", typeof(string));
            tregistrymainview.defineColumn("annotation", typeof(string));
            tregistrymainview.defineColumn("birthdate", typeof(DateTime));
            tregistrymainview.defineColumn("idcity", typeof(int));
            tregistrymainview.defineColumn("city", typeof(string));
            tregistrymainview.defineColumn("gender", typeof(string));
            tregistrymainview.defineColumn("foreigncf", typeof(string));
            tregistrymainview.defineColumn("idtitle", typeof(string));
            tregistrymainview.defineColumn("qualification", typeof(string));
            tregistrymainview.defineColumn("idmaritalstatus", typeof(string));
            tregistrymainview.defineColumn("maritalstatus", typeof(string));
            tregistrymainview.defineColumn("idregistrykind", typeof(int));
            tregistrymainview.defineColumn("sortcode", typeof(string));
            tregistrymainview.defineColumn("registrykind", typeof(string));
            tregistrymainview.defineColumn("human", typeof(string));
            tregistrymainview.defineColumn("active", typeof(string), false);
            tregistrymainview.defineColumn("badgecode", typeof(string));
            tregistrymainview.defineColumn("maritalsurname", typeof(string));
            tregistrymainview.defineColumn("idcategory", typeof(string));
            tregistrymainview.defineColumn("category", typeof(string));
            tregistrymainview.defineColumn("extmatricula", typeof(string));
            tregistrymainview.defineColumn("idcentralizedcategory", typeof(string));
            tregistrymainview.defineColumn("cu", typeof(string), false);
            tregistrymainview.defineColumn("ct", typeof(DateTime), false);
            tregistrymainview.defineColumn("lu", typeof(string), false);
            tregistrymainview.defineColumn("lt", typeof(DateTime), false);
            tregistrymainview.defineColumn("location", typeof(string));
            tregistrymainview.defineColumn("idnation", typeof(int));
            tregistrymainview.defineColumn("nation", typeof(string));
            tregistrymainview.defineColumn("authorization_free", typeof(string));
            tregistrymainview.defineColumn("multi_cf", typeof(string));
            tregistrymainview.defineColumn("toredirect", typeof(int));
            tregistrymainview.defineColumn("idaccmotivedebit", typeof(string));
            tregistrymainview.defineColumn("codemotivedebit", typeof(string));
            tregistrymainview.defineColumn("idaccmotivecredit", typeof(string));
            tregistrymainview.defineColumn("codemotivecredit", typeof(string));
            tregistrymainview.defineColumn("ccp", typeof(string));
            tregistrymainview.defineColumn("flagbankitaliaproceeds", typeof(string));
            tregistrymainview.defineColumn("ipa_fe", typeof(string));
            tregistrymainview.defineColumn("flag_pa", typeof(string));
            tregistrymainview.defineColumn("sdi_norifamm", typeof(string));
            tregistrymainview.defineColumn("sdi_defrifamm", typeof(string));
            Tables.Add(tregistrymainview);
            tregistrymainview.defineKey("idreg");

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

            //////////////////// SORTING3 /////////////////////////////////
            var tsorting3 = new sortingTable();
            tsorting3.TableName = "sorting3";
            tsorting3.addBaseColumns("ct", "cu", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5", "description", "flagnodate", "lt", "lu", "movkind", "printingorder", "rtf", "sortcode", "txt", "idsorkind", "idsor", "paridsor", "nlevel", "start", "stop", "email");
            tsorting3.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting3);
            tsorting3.defineKey("idsor");

            //////////////////// SORTING1 /////////////////////////////////
            var tsorting1 = new sortingTable();
            tsorting1.TableName = "sorting1";
            tsorting1.addBaseColumns("ct", "cu", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5", "description", "flagnodate", "lt", "lu", "movkind", "printingorder", "rtf", "sortcode", "txt", "idsorkind", "idsor", "paridsor", "nlevel", "start", "stop", "email");
            tsorting1.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting1);
            tsorting1.defineKey("idsor");

            //////////////////// SORTING2 /////////////////////////////////
            var tsorting2 = new sortingTable();
            tsorting2.TableName = "sorting2";
            tsorting2.addBaseColumns("ct", "cu", "defaultN1", "defaultN2", "defaultN3", "defaultN4", "defaultN5", "defaultS1", "defaultS2", "defaultS3", "defaultS4", "defaultS5", "defaultv1", "defaultv2", "defaultv3", "defaultv4", "defaultv5", "description", "flagnodate", "lt", "lu", "movkind", "printingorder", "rtf", "sortcode", "txt", "idsorkind", "idsor", "paridsor", "nlevel", "start", "stop", "email");
            tsorting2.ExtendedProperties["TableForReading"] = "sorting";
            Tables.Add(tsorting2);
            tsorting2.defineKey("idsor");

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

            //////////////////// LIST /////////////////////////////////
            var tlist = new listTable();
            tlist.addBaseColumns("idlist", "description", "intcode", "intbarcode", "extcode", "extbarcode", "validitystop", "active", "idpackage", "idunit", "unitsforpackage", "has_expiry", "cu", "ct", "lu", "lt", "idlistclass", "pic", "picext", "nmin", "ntoreorder", "tounload", "timesupply", "nmaxorder", "price", "insinfo", "descrforuser");
            Tables.Add(tlist);
            tlist.defineKey("idlist");

            //////////////////// UPB_IVA /////////////////////////////////
            var tupb_iva = new MetaTable("upb_iva");
            tupb_iva.defineColumn("idupb", typeof(string), false);
            tupb_iva.defineColumn("active", typeof(string));
            tupb_iva.defineColumn("assured", typeof(string));
            tupb_iva.defineColumn("codeupb", typeof(string), false);
            tupb_iva.defineColumn("ct", typeof(DateTime), false);
            tupb_iva.defineColumn("cu", typeof(string), false);
            tupb_iva.defineColumn("expiration", typeof(DateTime));
            tupb_iva.defineColumn("granted", typeof(decimal));
            tupb_iva.defineColumn("lt", typeof(DateTime), false);
            tupb_iva.defineColumn("lu", typeof(string), false);
            tupb_iva.defineColumn("paridupb", typeof(string));
            tupb_iva.defineColumn("previousappropriation", typeof(decimal));
            tupb_iva.defineColumn("previousassessment", typeof(decimal));
            tupb_iva.defineColumn("printingorder", typeof(string), false);
            tupb_iva.defineColumn("requested", typeof(decimal));
            tupb_iva.defineColumn("rtf", typeof(Byte[]));
            tupb_iva.defineColumn("title", typeof(string), false);
            tupb_iva.defineColumn("txt", typeof(string));
            tupb_iva.defineColumn("idman", typeof(int));
            tupb_iva.defineColumn("idunderwriter", typeof(int));
            tupb_iva.defineColumn("cupcode", typeof(string));
            tupb_iva.defineColumn("idsor01", typeof(int));
            tupb_iva.defineColumn("idsor02", typeof(int));
            tupb_iva.defineColumn("idsor03", typeof(int));
            tupb_iva.defineColumn("idsor04", typeof(int));
            tupb_iva.defineColumn("idsor05", typeof(int));
            tupb_iva.defineColumn("flagactivity", typeof(short));
            tupb_iva.defineColumn("flagkind", typeof(byte));
            tupb_iva.defineColumn("newcodeupb", typeof(string));
            tupb_iva.defineColumn("idtreasurer", typeof(int));
            tupb_iva.defineColumn("start", typeof(DateTime));
            tupb_iva.defineColumn("stop", typeof(DateTime));
            tupb_iva.defineColumn("cigcode", typeof(string));
            tupb_iva.defineColumn("idepupbkind", typeof(int));
            tupb_iva.defineColumn("flag", typeof(int));
            Tables.Add(tupb_iva);
            tupb_iva.defineKey("idupb");

            #endregion


            #region DataRelation creation
            this.defineRelation("FK_upb_flussocreditidetail", "upb", "flussocreditidetail", "idupb");
            this.defineRelation("FK_registrymainview_flussocreditidetail", "registrymainview", "flussocreditidetail", "idreg");
            var cPar   = new [] { accmotiveapplied_undotaxpost.Columns["idaccmotive"] };
            var cChild = new [] { flussocreditidetail.Columns["idaccmotiveundotaxpost"] };
            Relations.Add(new DataRelation("FK_accmotiveapplied_undotaxpost_flussocreditidetail", cPar, cChild, false));

            cPar   = new [] { accmotiveapplied_undotax.Columns["idaccmotive"] };
            cChild = new [] { flussocreditidetail.Columns["idaccmotiveundotax"] };
            Relations.Add(new DataRelation("FK_accmotiveapplied_undotax_flussocreditidetail", cPar, cChild, false));

            cPar   = new [] { accmotiveapplied_revenue.Columns["idaccmotive"] };
            cChild = new [] { flussocreditidetail.Columns["idaccmotiverevenue"] };
            Relations.Add(new DataRelation("FK_accmotiveapplied_revenue_flussocreditidetail", cPar, cChild, false));

            cPar   = new [] { accmotiveapplied_credit.Columns["idaccmotive"] };
            cChild = new [] { flussocreditidetail.Columns["idaccmotivecredit"] };
            Relations.Add(new DataRelation("FK_accmotiveapplied_credit_flussocreditidetail", cPar, cChild, false));

            this.defineRelation("FK_finmotive_income_flussocreditidetail", "finmotive_income", "flussocreditidetail", "idfinmotive");
            this.defineRelation("FK_invoicekind_flussocreditidetail", "invoicekind", "flussocreditidetail", "idinvkind");
            this.defineRelation("FK_estimatekind_flussocreditidetail", "estimatekind", "flussocreditidetail", "idestimkind");
            cPar   = new [] { sorting3.Columns["idsor"] };
            cChild = new [] { flussocreditidetail.Columns["idsor3"] };
            Relations.Add(new DataRelation("sorting3_flussocreditidetail", cPar, cChild, false));

            cPar   = new [] { sorting2.Columns["idsor"] };
            cChild = new [] { flussocreditidetail.Columns["idsor2"] };
            Relations.Add(new DataRelation("sorting2_flussocreditidetail", cPar, cChild, false));

            cPar   = new [] { sorting1.Columns["idsor"] };
            cChild = new [] { flussocreditidetail.Columns["idsor1"] };
            Relations.Add(new DataRelation("sorting1_flussocreditidetail", cPar, cChild, false));

            this.defineRelation("ivakind_flussocreditidetail", "ivakind", "flussocreditidetail", "idivakind");
            this.defineRelation("list_flussocreditidetail", "list", "flussocreditidetail", "idlist");
            cPar   = new [] { upb_iva.Columns["idupb"] };
            cChild = new [] { flussocreditidetail.Columns["idupb_iva"] };
            Relations.Add(new DataRelation("upb_iva_flussocreditidetail", cPar, cChild, false));

            #endregion
        }