/// <summary> /// Übermittelt eine SI Tabelle zur Bearbeitung. /// </summary> /// <param name="table">Die neu empfangene SI Tabelle mit Teildaten zu einem Modul.</param> public void AddPartialModule(Tables.OpenTV table) { // See if module should be processed lock (m_Enabled) if (m_Enabled.Count > 0) if (!m_Enabled.ContainsKey(table.ModuleIdentifier)) return; // The new module Module module; // Check for module manager inside collection lock (m_Modules) if (!m_Modules.TryGetValue(table.ModuleIdentifier, out module)) { // Create new module = new Module(); // Connect module.OnModuleComplete += ForwardComplete; // Remember m_Modules[table.ModuleIdentifier] = module; } // Forward module.AddPartialModule(table); }
/// <summary> /// Usuwa rekordy z bazy danych. /// </summary> /// <param name="IDs">Lista identyfikatorów rekordów do usunięcia.</param> /// <param name="TableNumber">Numer identyfikujący tabelę, z której mają zostać usunięte rekordy.</param> /// <param name="idIsForeignKey">true - do kasowanych rekordów istnieją odniesienia w innych tabelach.</param> public static void DeleteFromDB(List<string> IDs, Tables Table, bool idIsForeignKey) { switch (Table) { case Tables.Collectors: DeleteFromCollectors(IDs, idIsForeignKey); break; case Tables.Customers: DeleteFromCustomers(IDs, idIsForeignKey); break; case Tables.Areas: DeleteFromAreas(IDs, idIsForeignKey); break; case Tables.Counters: DeleteFromCounters(IDs, idIsForeignKey); break; case Tables.Addresses: DeleteFromAddresses(IDs, idIsForeignKey); break; default: break; } }
internal StoreProcedures LoadStoreProceduresByTables(Tables pTables,bool pLoadParameters) { string strSpName = String.Empty; StoreProcedures wStoreProcedures = null; StoreProcedure wStoreProcedure = null; foreach (Table wTabla in pTables) { DataSet wDtsStores = GetStoreProceduresFromTable(wTabla.Name); if (wDtsStores.Tables.Count > 0 && wDtsStores.Tables[0].Rows.Count > 0) { foreach (DataRow wDtr in wDtsStores.Tables[0].Rows) { if (wDtr[1].ToString().ToUpper() == "STORED PROCEDURE") { strSpName = wDtr[0].ToString().Substring(4, wDtr[0].ToString().Length - 4); wStoreProcedure = new StoreProcedure(); wStoreProcedure.Name = strSpName; if (pLoadParameters == true) FillParametesAndText(wStoreProcedure); wStoreProcedures.Add(wStoreProcedure); } } } } return wStoreProcedures; }
// SchemaReader.ReadSchema public override Tables ReadSchema(DbConnection connection, DbProviderFactory factory) { var result=new Tables(); this._connection=connection; this._factory=factory; var cmd=this._factory.CreateCommand(); cmd.Connection=connection; cmd.CommandText=TABLE_SQL; //cmd.GetType().GetProperty("BindByName").SetValue(cmd, true, null); //pull the tables in a reader using(cmd) { using (var rdr=cmd.ExecuteReader()) { while(rdr.Read()) { Table tbl=new Table(); tbl.Name=rdr["name"].ToString(); tbl.Schema = ""; tbl.IsView=String.Compare(rdr["type"].ToString(), "view", true)==0; tbl.CleanName=CleanUp(tbl.Name); tbl.ClassName=Inflector.MakeSingular(tbl.CleanName); tbl.SQL = rdr["sql"].ToString(); result.Add(tbl); } } } foreach (var tbl in result) { tbl.Columns=this.LoadColumns(tbl); tbl.Indexes = this.LoadIndices(tbl.Name); tbl.ForeignKeys = this.LoadForeignKeys(tbl.Name); } return result; }
public void DeleteTour(Tables.Tour tour) { DataServiceCommon dsCommon = new DataServiceCommon(); dsCommon.DeleteTourInCascade(tour); db.tours.DeleteOnSubmit(tour); db.SubmitChanges(); }
// SchemaReader.ReadSchema public override Tables ReadSchema(DbConnection connection, DbProviderFactory factory) { var result = new Tables(); var cmd = factory.CreateCommand(); cmd.Connection = connection; cmd.CommandText = TABLE_SQL; //pull the tables in a reader using (cmd) { using (var rdr = cmd.ExecuteReader()) { while (rdr.Read()) { Table tbl = new Table(); tbl.Name = rdr["TABLE_NAME"].ToString(); tbl.Schema = rdr["TABLE_SCHEMA"].ToString(); tbl.IsView = String.Compare(rdr["TABLE_TYPE"].ToString(), "View", true) == 0; tbl.CleanName = CleanUp(tbl.Name); tbl.ClassName = Inflector.MakeSingular(tbl.CleanName); result.Add(tbl); } } } //this will return everything for the DB var schema = connection.GetSchema("COLUMNS"); //loop again - but this time pull by table name foreach (var item in result) { item.Columns = new List<Column>(); //pull the columns from the schema var columns = schema.Select("TABLE_NAME='" + item.Name + "'"); foreach (var row in columns) { var type = GetPropertyType(row); Column col = new Column(); col.Name = row["COLUMN_NAME"].ToString(); col.PropertyName = CleanUp(col.Name); col.PropertyType = type; col.CustomType = type == null ? row["DATA_TYPE"].ToString().ToLowerInvariant() : null; col.Size = GetDatatypeSize(row["DATA_TYPE"].ToString()); col.Precision = GetDatatypePrecision(row["DATA_TYPE"].ToString()); col.IsNullable = row["IS_NULLABLE"].ToString() == "YES"; col.IsPrimaryKey = row["COLUMN_KEY"].ToString() == "PRI"; col.IsAutoIncrement = row["extra"].ToString().ToLower().IndexOf("auto_increment") >= 0; item.Columns.Add(col); } } return result; }
/// <summary> /// Wird aufgerufen, wenn ein Modul komplettiert wurde. /// </summary> /// <param name="lastTable">Die letzte SI Tabelle des Moduls.</param> /// <param name="module">Das fertiggestellte Modul.</param> private void ForwardComplete(Tables.OpenTV lastTable, Module module) { // Check for interested client Module.CompleteHandler callback = OnModuleComplete; // Report to client if (null != callback) callback(lastTable, module); }
public InsertForm(Tables MainFormSelectedTab) { InitializeComponent(); SetupControls(); selectedTab = MainFormSelectedTab; tcInsert.SelectTab((int)MainFormSelectedTab); InitializeEP(selectedTab); }
public static SeriesModel FromTable(Tables.Articles_Extended article) { return new SeriesModel() { Slug = article.Series_Slug, Title = article.Series_Title_Text, Description = article.Series_Description_Text }; }
public static SeriesModel FromTable(Tables.Series series) { return new SeriesModel() { Slug = series.Series_Slug, Title = series.Title_Text, Description = series.Description_Text }; }
public override Gdk.Pixbuf CreateIcon(Tables.Denso.Table table) { var t = (Tables.Denso.Table3D)table; if (t.IsDataConst) return ConstDataIcon; Plot3D.Draw (plotSurface, t); return DrawAndConvert (); }
private static IEnumerable<GitHubRepository> GetProjects(Tables.Applications_Extended application) { if (application.IssueTracking_Provider_Id == null) return Enumerable.Empty<GitHubRepository>(); using (var provider = (GitHubIssueTrackingProvider)Util.Providers.CreateProviderFromId<IssueTrackerConnectionBase>((int)application.IssueTracking_Provider_Id)) { return provider.GetRepositories(); } }
/// <summary> /// Might need Refresh () afterwards! /// </summary> /// <param name="table2D"> /// A <see cref="Table2D"/> /// </param> public void Draw(Tables.Denso.Table2D table2D) { float[] valuesY = table2D.GetValuesYasFloats (); // clear everything. reset fonts. remove plot components etc. // including Florence interactions this.plotSurface2D.Clear (); // Florence interactions, N/A in original NPlot library // guideline disadvantage: not optimized - does not use bitmap buffer, refreshes every time a line has to move plotSurface2D.AddInteraction (new VerticalGuideline (Color.Gray)); plotSurface2D.AddInteraction (new HorizontalGuideline (Color.Gray)); //plotSurface2D.AddInteraction (new PlotSelection (Color.Green)); plotSurface2D.AddInteraction (new PlotDrag (true, true)); plotSurface2D.AddInteraction (new AxisDrag ()); // PlotZoom: mouse wheel zoom plotSurface2D.AddInteraction (new PlotZoom ()); plotSurface2D.AddInteraction (new KeyActions ()); plotSurface2D.SurfacePadding = 0; plotSurface2D.SmoothingMode = SmoothingMode; // y-values, x-values (!) LinePlot lp = new LinePlot (valuesY, table2D.ValuesX); lp.Pen = pen; PointPlot pp = new PointPlot (marker); pp.AbscissaData = table2D.ValuesX; pp.OrdinateData = valuesY; Grid myGrid = new Grid (); myGrid.VerticalGridType = Grid.GridType.Coarse; myGrid.HorizontalGridType = Grid.GridType.Coarse; plotSurface2D.Add (myGrid); plotSurface2D.Add (pp); plotSurface2D.Add (lp); plotSurface2D.TitleFont = titleFont; plotSurface2D.Title = table2D.Title; plotSurface2D.XAxis1.LabelFont = labelFont; plotSurface2D.XAxis1.Label = AxisText (table2D.NameX, table2D.UnitX); // could use ex: plotSurface2D.YAxis1.NumberFormat = "0.000"; plotSurface2D.XAxis1.TickTextFont = tickTextFont; plotSurface2D.YAxis1.LabelFont = labelFont; plotSurface2D.YAxis1.Label = AxisText (table2D.Title, table2D.UnitY); plotSurface2D.YAxis1.TickTextFont = tickTextFont; // Florence surface has Refresh () method vs. NPlot: Refresh () not part of surface interface plotSurface2D.Refresh (); }
public void InsertOrUpdate(Tables tables) { if (tables.Id == default(int)) { context.Tables.Add(tables); } else { context.Entry(tables).State = EntityState.Modified; } }
/// <summary> /// Initializes a new instance of <see cref="Workspace"/> for a given <see cref="Token"/> with a given <see cref="ICommunication"/> /// </summary> /// <param name="token"><see cref="Token">Access token to use</see></param> /// <param name="communication"><see cref="ICommunication"/> to use</param> public Workspace(Token token, ICommunication communication) { _communication = communication; Groups = new Groups(token, communication); Datasets = new Datasets(token, communication); Tables = new Tables(token, communication); Rows = new Rows(token, communication); Dashboards = new Dashboards(token, communication); Reports = new Reports(token, communication); Tiles = new Tiles(token, communication); }
private static CommentModel FromTable(Tables.Comments comment) { return new CommentModel() { BodyHtml = comment.Discourse_Post_Id == null ? BbCodeFormatComment(comment.Body_Html) : comment.Body_Html, Username = comment.User_Name, DiscoursePostId = comment.Discourse_Post_Id, PublishedDate = comment.Posted_Date }; }
public void Should_read_user_from_MyUsers_table() { TestData.AddUsers(useCustomTables: true); var tables = new Tables().SetUsersTable("MyUsers"); var target = new UserStore<IdentityUser>(tables); var task = target.FindByIdAsync(TestData.John_UserId); task.Wait(); Assert.That(task.Result, Is.Not.Null); Assert.That(task.Result.UserName, Is.EqualTo("John")); }
public void Should_read_role_from_MyRoles_table() { TestData.AddRoles(useCustomTables: true); var tables = new Tables().SetRolesTable("MyRoles"); var target = new RoleStore<IdentityRole>(tables); var task = target.FindByNameAsync("Admin"); task.Wait(); Assert.That(task.Result, Is.Not.Null); Assert.That(task.Result.Id, Is.EqualTo(TestData.Admin_RoleId)); }
public static AuthorModel FromTable(Tables.Authors author) { return new AuthorModel() { Name = author.Display_Name, ShortDescription = author.ShortBio_Text, DescriptionHtml = author.Bio_Html, Slug = author.Author_Slug, IsAdmin = author.Admin_Indicator, ImageUrl = author.Image_Url, IsActive = author.Active_Indicator }; }
public static AuthorModel FromTable(Tables.Articles_Extended article) { return new AuthorModel() { Name = article.Author_Display_Name, ShortDescription = article.Author_ShortBio_Text, DescriptionHtml = article.Author_Bio_Html, Slug = article.Author_Slug, IsAdmin = article.Author_Admin_Indicator, ImageUrl = article.Author_Image_Url, IsActive = article.Author_Active_Indicator }; }
public Database(string typeName, string server, string name, string connectionString) { this.typeName = typeName; this.server = server; this.name = name; this.connectionString = connectionString; connection = new OdbcConnection(this.connectionString); _tables = new Tables(this); _views = new Views(this); _sequences = new Sequences(this); _storedprocedures = new StoredProcedures(this); _functions = new Functions(this); _modules = new Modules(this); _mqts = new MQTS(this); }
// SchemaReader.ReadSchema public override Tables ReadSchema(DbConnection connection, DbProviderFactory factory) { var result=new Tables(); this._connection=connection; this._factory=factory; var cmd=this._factory.CreateCommand(); cmd.Connection=connection; cmd.CommandText=TABLE_SQL; cmd.GetType().GetProperty("BindByName").SetValue(cmd, true, null); //pull the tables in a reader using(cmd) { using (var rdr=cmd.ExecuteReader()) { while(rdr.Read()) { Table tbl=new Table(); tbl.Name=rdr["TABLE_NAME"].ToString(); tbl.Schema = rdr["TABLE_SCHEMA"].ToString(); tbl.IsView=String.Compare(rdr["TABLE_TYPE"].ToString(), "View", true)==0; tbl.CleanName=CleanUp(tbl.Name); tbl.ClassName=Inflector.MakeSingular(tbl.CleanName); result.Add(tbl); } } } foreach (var tbl in result) { tbl.Columns=this.LoadColumns(tbl); tbl.Indexes = this.LoadIndices(tbl.Name); tbl.ForeignKeys = this.LoadFKeys(tbl.Name); // Mark the primary key string PrimaryKey=this.GetPK(tbl.Name); var pkColumn=tbl.Columns.SingleOrDefault(x=>x.Name.ToLower().Trim()==PrimaryKey.ToLower().Trim()); if(pkColumn!=null) pkColumn.IsPrimaryKey=true; } return result; }
/// <summary> /// Metoda usuwająca rekordy w bazie danych odpowiadające zaznaczonym w przekazanym ListView itemom. /// </summary> /// <param name="listView">ListView którego zaznaczone itemy zostaną usunięte z bazy danych.</param> /// <param name="Table">Tabela z której zostaną usunięte rekordy.</param> /// <returns>Wartość mówiąca o tym czy użytkownik zdecydował się na usunięcie rekordów.</returns> public static bool DeleteItems(ListView listView, Tables Table) { List<string> ids = Auxiliary.CreateIdList(listView); bool idExists = false; string tableName = string.Empty; DialogResult choiceFromMessageBox = DialogResult.Yes; switch (Table) { case Tables.Collectors: tableName = "Collector"; break; case Tables.Customers: tableName = "Customer"; break; case Tables.Areas: tableName = "Area"; break; case Tables.Addresses: tableName = "Address"; break; case Tables.Counters: tableName = "Counter"; break; } for (int i = 0; i < ids.Count; i++) { idExists = DBManipulator.IdExistsInOtherTable(tableName, ids.ElementAt(i)); if (idExists) { tableName = tableName.ToLower(); choiceFromMessageBox = MessageBox.Show(LangPL.IntegrityWarnings[tableName + "Removal"], "Ostrzeżenie", MessageBoxButtons.YesNo); break; } } if (choiceFromMessageBox == DialogResult.Yes) { DBManipulator.DeleteFromDB(ids, Table, idExists); return true; } return false; }
public winDeleting(DrugstoreEntities context, Tables table) { InitializeComponent(); this.context = context; this.currentTable = table; cmb.IsDropDownOpen = true; cmb.Focus(); switch (currentTable) { case Tables.Аптеки: { cmb.ItemsSource = context.Аптеки.Select(p=>p.Наименование); name.Text = "Наименование аптеки"; break; } case Tables.Витамины: case Tables.Добавки: case Tables.Препараты: case Tables.Чай: { cmb.ItemsSource = context.Товары.Select(p => p.Наименование); name.Text = "Наименование товара"; break; } case Tables.Регионы: { cmb.ItemsSource = context.Регионы.Select(p => p.Наименование); name.Text = "Наименование региона"; break; } case Tables.Поставщики: { cmb.ItemsSource = context.Поставщики.Select(p => p.Наименование); name.Text = "Наименование поставщика"; break; } case Tables.Поставки: { cmb.ItemsSource = context.Поставки.Select(p => p.id_поставки); name.Text = "id поставки"; break; } } }
//-------------------------------------------------------------------------- // // 功能:添加对象数据 // // 作者: // // 日期:200708 // // 历史: //-------------------------------------------------------------------------- public bool AddODRecord(Tables tables, string tableName, ObjectId id) { try { Autodesk.Gis.Map.ObjectData.Table table = tables[tableName]; // Create and initialize an record Record tblRcd = Record.Create(); table.InitRecord(tblRcd); string msg = ""; // Output string MapValue val = tblRcd[0]; // String type string temp = null; temp = string.Format("String_{0}", m_index); val.Assign(temp); msg += temp + "; "; val = tblRcd[1]; // integer val.Assign(m_index); msg += m_index.ToString() + "; "; val = tblRcd[2]; // real val.Assign(3.14159 * m_index); msg += (3.14159 * m_index).ToString() + "; "; val = tblRcd[3]; // point Point3d pt = new Point3d(10 * m_index, 20 * m_index, 30 * m_index); val.Assign(pt); msg += pt.ToString(); m_index++; table.AddRecord(tblRcd, id); AcadEditor.WriteMessage("\n 记录为: : [" + msg + "] "); return true; } catch (MapException) { return false; } }
public Result GetResult() { Schemas schems = GetSchemas(); Tables tables = new Tables(); var oTables = schems.Select(p => new { p.表格名稱 }).GroupBy(p => p); foreach (var oTable in oTables) { tables.Add(new Table() { 表格名稱 = oTable.Key.表格名稱, Schemas = schems.Where(p => p.表格名稱== oTable.Key.表格名稱).ToList<Schema>() }); } return new Result() { Schems = schems, Tables = tables }; }
public IList<DatabaseColumn> Execute(DbConnection connection) { var tables = new Tables(_tableName).Execute(connection); foreach (var table in tables) { var tableName = table.Name; using (var cmd = connection.CreateCommand()) { cmd.CommandText = string.Format(PragmaSql, tableName); int ordinal = 0; using (var dr = cmd.ExecuteReader()) { while (dr.Read()) { var colName = dr.GetString("name"); var col = new DatabaseColumn { TableName = tableName, Name = colName, Ordinal = ordinal, //type will be like "nvarchar(32)". //Lengths /precisions could be parsed out (nb remember this is Sqlite) DbDataType = dr.GetString("type"), Nullable = dr.GetBoolean("notnull"), DefaultValue = dr.GetString("dflt_value"), IsPrimaryKey = dr.GetBoolean("pk"), }; if (col.IsPrimaryKey && col.DbDataType == "INTEGER") { col.IsAutoNumber = true; } Result.Add(col); ordinal++; } } } } return Result; }
public override Gdk.Pixbuf CreateIcon(Tables.Denso.Table table) { var t = (Tables.Denso.Table2D)table; if (t.IsDataConst) return ConstDataIcon; plotSurface.Clear (); plotSurface.SmoothingMode = SmoothingMode; // y-values, x-values (!) LinePlot lp = new LinePlot (t.GetValuesYasFloats (), t.ValuesX); lp.Pen = pen; plotSurface.Add (lp); plotSurface.XAxis1.Hidden = true; plotSurface.YAxis1.Hidden = true; return DrawAndConvert (); }
public void Should_read_userrole_from_MyUserRoles_table() { TestData.AddUsers(useCustomTables: true); TestData.AddRoles(useCustomTables: true); TestData.AddRolesToUsers(useCustomTables: true); var tables = new Tables(); tables.SetUsersTable("MyUsers") .SetRolesTable("MyRoles") .SetUserRolesTable("MyUserRoles"); var user = TestData.GetTestUserJohn(); var target = new UserStore<IdentityUser>(tables); var task = target.GetRolesAsync(user); task.Wait(); var userRoles = task.Result; Assert.That(userRoles[0], Is.EqualTo("Admin")); }
protected virtual byte[] GetConfigurationFileContents(Tables.ConfigurationFileVersions_Extended configurationFile, string releaseNumber) { if (configurationFile == null) { throw new ArgumentNullException("configurationFile"); } byte[] configurationFileContents = Util.ConfigurationFiles.GetConfigurationFileContents(configurationFile, releaseNumber, base.Context.ServerId, new Action<string>(this.LogDebug)); string str2 = Regex.Replace(Encoding.UTF8.GetString(configurationFileContents), "%[^%]+%", (Match m) => { string str; string str1 = m.Value.Trim(new char[] { '%' }); if (base.Context.Variables.TryGetValue(str1, out str)) { return str; } return m.Value; }); configurationFileContents = Encoding.UTF8.GetBytes(str2); return configurationFileContents; }
/// <summary> /// Gets the information of the table or <see langword="null"/> if no element is found. /// </summary> /// <param name="type">The table type.</param> /// <returns>The table info.</returns> public virtual ITableInfo GetInfoOrDefault(Type type) { Tables.TryGetValue(type.FullName, out ITableInfo tableInfo); return(tableInfo); }
/// <summary> /// Gets instance of <see cref="UnrealTable{T}"/> that has been added with name <paramref name="tableName"/> and has entries of type <typeparamref name="T"/>. /// </summary> /// <typeparam name="T">Type of keys the found instance stores.</typeparam> /// <param name="tableName">Name of instance in the tables dictionary.</param> /// <returns>Instance of the type deriving from <see cref="UnrealTable{T}"/> with specified name, or null.</returns> public UnrealTable <T>?GetTable <T>(string tableName) where T : notnull => Tables.TryGetValue(tableName, out var table) ? table as UnrealTable <T> : default;
/// <summary> /// Создать каналы в базе конфигурации, используя ранее рассчитанные номера и прототипы каналов /// </summary> public static bool CreateChannels(List <KPInfo> kpInfoList, bool insertKPName, string logFileName, out bool logCreated, out string msg) { logCreated = false; msg = ""; StreamWriter writer = null; try { // создание журанала создания каналов writer = new StreamWriter(logFileName, false, Encoding.UTF8); logCreated = true; string title = DateTime.Now.ToString("G", Localization.Culture) + " " + AppPhrases.CreateCnlsTitle; writer.WriteLine(title); writer.WriteLine(new string('-', title.Length)); writer.WriteLine(); // формирование списков идентификаторов используемых значений из справочников базы конфигурации SortedList <string, int> paramList = new SortedList <string, int>(); SortedList <string, int> unitList = new SortedList <string, int>(); SortedList <string, int> cmdValList = new SortedList <string, int>(); foreach (KPInfo kpInfo in kpInfoList) { if (kpInfo.DefaultCnls != null) { foreach (KPView.InCnlPrototype inCnl in kpInfo.DefaultCnls.InCnls) { string s = inCnl.ParamName; if (!string.IsNullOrEmpty(s) && !paramList.ContainsKey(s)) { paramList.Add(s, -1); } s = inCnl.UnitName; if (!string.IsNullOrEmpty(s) && !unitList.ContainsKey(s)) { unitList.Add(s, -1); } } foreach (KPView.CtrlCnlPrototype ctrlCnl in kpInfo.DefaultCnls.CtrlCnls) { string s = ctrlCnl.CmdValName; if (!string.IsNullOrEmpty(s) && !cmdValList.ContainsKey(s)) { cmdValList.Add(s, -1); } } } } // определение идентификаторов по справочникам базы конфигурации writer.WriteLine(AppPhrases.CheckDicts); bool paramError = !FindDictIDs(paramList, Tables.GetParamTable(), "ParamID", writer, AppPhrases.ParamNotFound); bool unitError = !FindDictIDs(unitList, Tables.GetUnitTable(), "UnitID", writer, AppPhrases.UnitNotFound); bool cmdValError = !FindDictIDs(cmdValList, Tables.GetCmdValTable(), "CmdValID", writer, AppPhrases.CmdValsNotFound); if (paramError || unitError || cmdValError) { msg = AppPhrases.CreateCnlsImpossible; writer.WriteLine(msg); return(false); } else { writer.WriteLine(AppPhrases.CreateCnlsStart); // заполнение схем таблиц входных каналов и каналов управления DataTable tblInCnl = new DataTable("InCnl"); DataTable tblCtrlCnl = new DataTable("CtrlCnl"); Tables.FillTableSchema(tblInCnl); Tables.FillTableSchema(tblCtrlCnl); // получение таблицы форматов чисел DataTable tblFormat = Tables.GetFormatTable(); tblFormat.DefaultView.Sort = "ShowNumber, DecDigits"; // создание каналов для КП foreach (KPInfo kpInfo in kpInfoList) { if (kpInfo.Selected) { int inCnlNum = kpInfo.FirstInCnlNum; int ctrlCnlNum = kpInfo.FirstCtrlCnlNum; object objNum = kpInfo.ObjNum; int kpNum = kpInfo.KPNum; string kpNameToInsert = insertKPName ? kpInfo.KPName + " - " : ""; // создание каналов управления foreach (KPView.CtrlCnlPrototype ctrlCnl in kpInfo.DefaultCnls.CtrlCnls) { ctrlCnl.CtrlCnlNum = ctrlCnlNum; DataRow newCtrlCnlRow = CreateCtrlCnlRow(tblCtrlCnl, cmdValList, ctrlCnl, objNum, kpNum, kpNameToInsert, writer); tblCtrlCnl.Rows.Add(newCtrlCnlRow); ctrlCnlNum++; } // создание входных каналов foreach (KPView.InCnlPrototype inCnl in kpInfo.DefaultCnls.InCnls) { inCnl.CnlNum = inCnlNum; DataRow newInCnlRow = CreateInCnlRow(tblInCnl, tblFormat, paramList, unitList, inCnl, objNum, kpNum, kpNameToInsert, writer); tblInCnl.Rows.Add(newInCnlRow); inCnlNum++; } } } // сохранение каналов в БД int updRowCnt1, updRowCnt2; bool updateOK = UpdateCnls(tblCtrlCnl, AppPhrases.AddedCtrlCnlsCount, writer, out updRowCnt1); updateOK = UpdateCnls(tblInCnl, AppPhrases.AddedInCnlsCount, writer, out updRowCnt2) && updateOK; msg = updateOK ? AppPhrases.CreateCnlsComplSucc : AppPhrases.CreateCnlsComplWithErr; writer.WriteLine(); writer.WriteLine(msg); if (updRowCnt1 + updRowCnt2 > 0) { msg += AppPhrases.RefreshRequired; } return(updateOK); } } catch (Exception ex) { msg = AppPhrases.CreateCnlsError + ":\r\n" + ex.Message; try { writer.WriteLine(msg); } catch { } return(false); } finally { try { writer.Close(); } catch { } } }
private void InitClass() { DataSetName = "vistaForm"; Prefix = ""; Namespace = "http://tempuri.org/vistaForm.xsd"; EnforceConstraints = false; DataTable T; DataColumn C; DataColumn [] key; T = new DataTable("costpartitiondetail"); C = new DataColumn("idcostpartition", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("iddetail", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("rate", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("amount", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("lt", typeof(System.DateTime), "")); T.Columns.Add(new DataColumn("lu", typeof(System.String), "")); T.Columns.Add(new DataColumn("ct", typeof(System.DateTime), "")); T.Columns.Add(new DataColumn("cu", typeof(System.String), "")); T.Columns.Add(new DataColumn("idsor1", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idsor2", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idsor3", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("!codesor1", typeof(System.String), "")); T.Columns.Add(new DataColumn("!codesor2", typeof(System.String), "")); T.Columns.Add(new DataColumn("!codesor3", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[2] { T.Columns["idcostpartition"], T.Columns["iddetail"] }; T.PrimaryKey = key; T = new DataTable("sorting1"); C = new DataColumn("idsorkind", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idsor", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("sortcode", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridsor", typeof(System.Int32), "")); C = new DataColumn("nlevel", typeof(System.Byte), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("defaultN1", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultN2", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultN3", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultN4", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultN5", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultS1", typeof(System.String), "")); T.Columns.Add(new DataColumn("defaultS2", typeof(System.String), "")); T.Columns.Add(new DataColumn("defaultS3", typeof(System.String), "")); T.Columns.Add(new DataColumn("defaultS4", typeof(System.String), "")); T.Columns.Add(new DataColumn("defaultS5", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagnodate", typeof(System.String), "")); T.Columns.Add(new DataColumn("movkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("printingorder", typeof(System.String), "")); T.Columns.Add(new DataColumn("defaultv1", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultv2", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultv3", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultv4", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultv5", typeof(System.Decimal), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idsor"] }; T.PrimaryKey = key; T = new DataTable("sorting2"); C = new DataColumn("idsorkind", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idsor", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("sortcode", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridsor", typeof(System.Int32), "")); C = new DataColumn("nlevel", typeof(System.Byte), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("defaultN1", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultN2", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultN3", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultN4", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultN5", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultS1", typeof(System.String), "")); T.Columns.Add(new DataColumn("defaultS2", typeof(System.String), "")); T.Columns.Add(new DataColumn("defaultS3", typeof(System.String), "")); T.Columns.Add(new DataColumn("defaultS4", typeof(System.String), "")); T.Columns.Add(new DataColumn("defaultS5", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagnodate", typeof(System.String), "")); T.Columns.Add(new DataColumn("movkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("printingorder", typeof(System.String), "")); T.Columns.Add(new DataColumn("defaultv1", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultv2", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultv3", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultv4", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultv5", typeof(System.Decimal), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idsor"] }; T.PrimaryKey = key; T = new DataTable("sorting3"); C = new DataColumn("idsorkind", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idsor", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("sortcode", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridsor", typeof(System.Int32), "")); C = new DataColumn("nlevel", typeof(System.Byte), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("defaultN1", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultN2", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultN3", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultN4", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultN5", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultS1", typeof(System.String), "")); T.Columns.Add(new DataColumn("defaultS2", typeof(System.String), "")); T.Columns.Add(new DataColumn("defaultS3", typeof(System.String), "")); T.Columns.Add(new DataColumn("defaultS4", typeof(System.String), "")); T.Columns.Add(new DataColumn("defaultS5", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagnodate", typeof(System.String), "")); T.Columns.Add(new DataColumn("movkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("printingorder", typeof(System.String), "")); T.Columns.Add(new DataColumn("defaultv1", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultv2", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultv3", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultv4", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("defaultv5", typeof(System.Decimal), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idsor"] }; T.PrimaryKey = key; //Relations DataTable TPar; DataTable TChild; DataColumn [] CPar; DataColumn [] CChild; TPar = Tables["sorting3"]; TChild = Tables["costpartitiondetail"]; CPar = new DataColumn[1] { TPar.Columns["idsor"] }; CChild = new DataColumn[1] { TChild.Columns["idsor3"] }; Relations.Add(new DataRelation("sorting3_costpartitiondetail", CPar, CChild)); TPar = Tables["sorting2"]; TChild = Tables["costpartitiondetail"]; CPar = new DataColumn[1] { TPar.Columns["idsor"] }; CChild = new DataColumn[1] { TChild.Columns["idsor2"] }; Relations.Add(new DataRelation("sorting2_costpartitiondetail", CPar, CChild)); TPar = Tables["sorting1"]; TChild = Tables["costpartitiondetail"]; CPar = new DataColumn[1] { TPar.Columns["idsor"] }; CChild = new DataColumn[1] { TChild.Columns["idsor1"] }; Relations.Add(new DataRelation("sorting1_costpartitiondetail", CPar, CChild)); }
private void InitClass() { this.DataSetName = "vistaForm"; this.Prefix = ""; this.Namespace = "http://tempuri.org/vistaForm.xsd"; this.EnforceConstraints = false; DataTable T; DataColumn C; DataColumn [] key; T = new DataTable("manager"); C = new DataColumn("idman", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("title", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("iddivision", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("email", typeof(System.String), "")); T.Columns.Add(new DataColumn("phonenumber", typeof(System.String), "")); T.Columns.Add(new DataColumn("userweb", typeof(System.String), "")); T.Columns.Add(new DataColumn("passwordweb", typeof(System.String), "")); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idman"] }; T.PrimaryKey = key; T = new DataTable("asset"); C = new DataColumn("idasset", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nassetacquire", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("ninventory", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("lifestart", typeof(System.DateTime), "")); T.Columns.Add(new DataColumn("idlocation", typeof(System.String), "")); T.Columns.Add(new DataColumn("idman", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idassetunloadkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("yassetunload", typeof(System.Int16), "")); T.Columns.Add(new DataColumn("nassetunload", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("!location", typeof(System.String), "")); T.Columns.Add(new DataColumn("!ninventory", typeof(System.String), "")); T.Columns.Add(new DataColumn("!manager", typeof(System.String), "")); T.Columns.Add(new DataColumn("!numeroriga", typeof(System.String), "")); T.Columns.Add(new DataColumn("!assetdescription", typeof(System.String), "")); C = new DataColumn("idpiece", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("transmitted", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[2] { T.Columns["idasset"], T.Columns["idpiece"] }; T.PrimaryKey = key; T = new DataTable("locationview"); C = new DataColumn("idlocation", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("locationcode", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nlevel", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("leveldescr", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridlocation", typeof(System.String), "")); C = new DataColumn("description", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idman", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("manager", typeof(System.String), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); T = new DataTable("inventorytree"); C = new DataColumn("idinv", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codeinv", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridinv", typeof(System.String), "")); C = new DataColumn("nlevel", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idinv"] }; T.PrimaryKey = key; T = new DataTable("assetacquire"); C = new DataColumn("nassetacquire", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("yman", typeof(System.Int16), "")); T.Columns.Add(new DataColumn("nman", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("rownum", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idreg", typeof(System.Int32), "")); C = new DataColumn("idmot", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idinv", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idinventory", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idassetloadkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("yassetload", typeof(System.Int16), "")); T.Columns.Add(new DataColumn("nassetload", typeof(System.Int32), "")); C = new DataColumn("number", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("taxable", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("taxrate", typeof(System.Double), "")); T.Columns.Add(new DataColumn("discount", typeof(System.Double), "")); C = new DataColumn("startnumber", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("adate", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("flagload", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("loadkind", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("abatable", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("tax", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("transmitted", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["nassetacquire"] }; T.PrimaryKey = key; T = new DataTable("assetview"); C = new DataColumn("idasset", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idpiece", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("lifestart", typeof(System.DateTime), "")); T.Columns.Add(new DataColumn("nassetacquire", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("ninventory", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idlocation", typeof(System.String), "")); T.Columns.Add(new DataColumn("locationcode", typeof(System.String), "")); T.Columns.Add(new DataColumn("location", typeof(System.String), "")); T.Columns.Add(new DataColumn("idman", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("manager", typeof(System.String), "")); C = new DataColumn("idinv", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codeinv", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("inventorytree", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idinventory", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("inventory", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idassetloadkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("yassetload", typeof(System.Int16), "")); T.Columns.Add(new DataColumn("nassetload", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("taxable", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("taxrate", typeof(System.Double), "")); T.Columns.Add(new DataColumn("discount", typeof(System.Double), "")); T.Columns.Add(new DataColumn("total", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("currentvalue", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("idassetunloadkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("yassetunload", typeof(System.Int16), "")); T.Columns.Add(new DataColumn("nassetunload", typeof(System.Int32), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("cost", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("abatable", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("transmitted", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[2] { T.Columns["idasset"], T.Columns["idpiece"] }; T.PrimaryKey = key; //Relations DataTable TPar; DataTable TChild; DataColumn [] CPar; DataColumn [] CChild; TPar = Tables["inventorytree"]; TChild = Tables["assetacquire"]; CPar = new DataColumn[1] { TPar.Columns["idinv"] }; CChild = new DataColumn[1] { TChild.Columns["idinv"] }; Relations.Add(new DataRelation("inventorytreeassetacquire", CPar, CChild)); TPar = Tables["assetview"]; TChild = Tables["asset"]; CPar = new DataColumn[1] { TPar.Columns["idasset"] }; CChild = new DataColumn[1] { TChild.Columns["idasset"] }; Relations.Add(new DataRelation("assetviewasset", CPar, CChild)); TPar = Tables["assetacquire"]; TChild = Tables["asset"]; CPar = new DataColumn[1] { TPar.Columns["nassetacquire"] }; CChild = new DataColumn[1] { TChild.Columns["nassetacquire"] }; Relations.Add(new DataRelation("assetacquireasset", CPar, CChild)); TPar = Tables["manager"]; TChild = Tables["asset"]; CPar = new DataColumn[1] { TPar.Columns["idman"] }; CChild = new DataColumn[1] { TChild.Columns["idman"] }; Relations.Add(new DataRelation("managerasset", CPar, CChild)); TPar = Tables["locationview"]; TChild = Tables["asset"]; CPar = new DataColumn[1] { TPar.Columns["idlocation"] }; CChild = new DataColumn[1] { TChild.Columns["idlocation"] }; Relations.Add(new DataRelation("locationviewasset", CPar, CChild)); }
private void InitClass() { DataSetName = "vistaResponsabiliCespiti"; Prefix = ""; Namespace = "http://tempuri.org/vistaResponsabiliCespiti.xsd"; EnforceConstraints = false; #region create DataTables DataTable T; DataColumn C; //////////////////// ASSET ///////////////////////////////// T = new DataTable("asset"); C = new DataColumn("idasset", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idpiece", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idasset_prev", typeof(Int32))); T.Columns.Add(new DataColumn("idpiece_prev", typeof(Int32))); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("lifestart", typeof(DateTime))); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("nassetacquire", typeof(Int32))); T.Columns.Add(new DataColumn("ninventory", typeof(Int32))); T.Columns.Add(new DataColumn("rtf", typeof(Byte[]))); T.Columns.Add(new DataColumn("txt", typeof(String))); T.Columns.Add(new DataColumn("transmitted", typeof(String))); T.Columns.Add(new DataColumn("idassetunload", typeof(Int32))); C = new DataColumn("flag", typeof(Byte)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("multifield", typeof(String))); T.Columns.Add(new DataColumn("idcurrlocation", typeof(Int32))); T.Columns.Add(new DataColumn("idcurrman", typeof(Int32))); T.Columns.Add(new DataColumn("idcurrsubman", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idasset"], T.Columns["idpiece"] }; //////////////////// ASSETLOCATION ///////////////////////////////// T = new DataTable("assetlocation"); C = new DataColumn("idasset", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idassetlocation", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("start", typeof(DateTime))); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idlocation", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idasset"], T.Columns["idassetlocation"] }; //////////////////// ASSETMANAGER ///////////////////////////////// T = new DataTable("assetmanager"); C = new DataColumn("idasset", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idassetmanager", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("start", typeof(DateTime))); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idman", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idasset"], T.Columns["idassetmanager"] }; //////////////////// MANAGER ///////////////////////////////// T = new DataTable("manager"); T.Columns.Add(new DataColumn("active", typeof(String))); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("email", typeof(String))); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("passwordweb", typeof(String))); T.Columns.Add(new DataColumn("phonenumber", typeof(String))); T.Columns.Add(new DataColumn("rtf", typeof(Byte[]))); C = new DataColumn("title", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("txt", typeof(String))); T.Columns.Add(new DataColumn("financeactive", typeof(String))); T.Columns.Add(new DataColumn("userweb", typeof(String))); C = new DataColumn("idman", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("iddivision", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idman"] }; //////////////////// LOCATION ///////////////////////////////// T = new DataTable("location"); T.Columns.Add(new DataColumn("active", typeof(String))); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("locationcode", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("rtf", typeof(Byte[]))); T.Columns.Add(new DataColumn("txt", typeof(String))); T.Columns.Add(new DataColumn("idman", typeof(Int32))); C = new DataColumn("nlevel", typeof(Byte)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idlocation", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridlocation", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idlocation"] }; //////////////////// DIVISION ///////////////////////////////// T = new DataTable("division"); T.Columns.Add(new DataColumn("address", typeof(String))); T.Columns.Add(new DataColumn("cap", typeof(String))); T.Columns.Add(new DataColumn("city", typeof(String))); T.Columns.Add(new DataColumn("country", typeof(String))); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("faxnumber", typeof(String))); T.Columns.Add(new DataColumn("faxprefix", typeof(String))); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("phonenumber", typeof(String))); T.Columns.Add(new DataColumn("phoneprefix", typeof(String))); T.Columns.Add(new DataColumn("rtf", typeof(Byte[]))); T.Columns.Add(new DataColumn("txt", typeof(String))); C = new DataColumn("codedivision", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("iddivision", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["iddivision"] }; //////////////////// ASSETTOLINK ///////////////////////////////// T = new DataTable("assettolink"); C = new DataColumn("idasset", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idpiece", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idinventory_tolink", typeof(Int32))); T.Columns.Add(new DataColumn("ninventory_tolink", typeof(Int32))); T.Columns.Add(new DataColumn("idpiece_tolink", typeof(Int32))); C = new DataColumn("kind", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idasset"], T.Columns["idpiece"], T.Columns["kind"] }; //////////////////// ASSETSUBMANAGER ///////////////////////////////// T = new DataTable("assetsubmanager"); C = new DataColumn("idasset", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idassetsubmanager", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("ct", typeof(DateTime))); T.Columns.Add(new DataColumn("cu", typeof(String))); T.Columns.Add(new DataColumn("lt", typeof(DateTime))); T.Columns.Add(new DataColumn("lu", typeof(String))); T.Columns.Add(new DataColumn("start", typeof(DateTime))); T.Columns.Add(new DataColumn("idmanager", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idasset"], T.Columns["idassetsubmanager"] }; //////////////////// ASSETACQUIRE ///////////////////////////////// T = new DataTable("assetacquire"); C = new DataColumn("nassetacquire", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("abatable", typeof(Decimal))); C = new DataColumn("adate", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("discount", typeof(Double))); T.Columns.Add(new DataColumn("idmankind", typeof(String))); T.Columns.Add(new DataColumn("idreg", typeof(Int32))); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("nman", typeof(Int32))); C = new DataColumn("number", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("rownum", typeof(Int32))); T.Columns.Add(new DataColumn("rtf", typeof(Byte[]))); T.Columns.Add(new DataColumn("startnumber", typeof(Int32))); T.Columns.Add(new DataColumn("tax", typeof(Decimal))); T.Columns.Add(new DataColumn("taxable", typeof(Decimal))); T.Columns.Add(new DataColumn("taxrate", typeof(Double))); T.Columns.Add(new DataColumn("txt", typeof(String))); T.Columns.Add(new DataColumn("yman", typeof(Int16))); T.Columns.Add(new DataColumn("transmitted", typeof(String))); T.Columns.Add(new DataColumn("idupb", typeof(String))); C = new DataColumn("idinventory", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idmot", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idinv", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idassetload", typeof(Int32))); C = new DataColumn("flag", typeof(Byte)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idsor1", typeof(Int32))); T.Columns.Add(new DataColumn("idsor2", typeof(Int32))); T.Columns.Add(new DataColumn("idsor3", typeof(Int32))); T.Columns.Add(new DataColumn("historicalvalue", typeof(Decimal))); T.Columns.Add(new DataColumn("idlist", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["nassetacquire"] }; //////////////////// INVENTORY ///////////////////////////////// T = new DataTable("inventory"); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("startnumber", typeof(Int32))); C = new DataColumn("idinventoryagency", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idinventorykind", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codeinventory", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idinventory", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("flag", typeof(Byte)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("active", typeof(String))); T.Columns.Add(new DataColumn("idsor01", typeof(Int32))); T.Columns.Add(new DataColumn("idsor02", typeof(Int32))); T.Columns.Add(new DataColumn("idsor03", typeof(Int32))); T.Columns.Add(new DataColumn("idsor04", typeof(Int32))); T.Columns.Add(new DataColumn("idsor05", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idinventory"] }; #endregion #region DataRelation creation DataColumn [] CPar; DataColumn [] CChild; CPar = new DataColumn[1] { manager.Columns["idman"] }; CChild = new DataColumn[1] { assetsubmanager.Columns["idmanager"] }; Relations.Add(new DataRelation("manager_assetsubmanager", CPar, CChild, false)); CPar = new DataColumn[1] { asset.Columns["idasset"] }; CChild = new DataColumn[1] { assetsubmanager.Columns["idasset"] }; Relations.Add(new DataRelation("asset_assetsubmanager", CPar, CChild, false)); CPar = new DataColumn[2] { asset.Columns["idasset"], asset.Columns["idpiece"] }; CChild = new DataColumn[2] { assettolink.Columns["idasset"], assettolink.Columns["idpiece"] }; Relations.Add(new DataRelation("asset_assettolink", CPar, CChild, false)); CPar = new DataColumn[1] { division.Columns["iddivision"] }; CChild = new DataColumn[1] { manager.Columns["iddivision"] }; Relations.Add(new DataRelation("division_manager", CPar, CChild, false)); CPar = new DataColumn[1] { manager.Columns["idman"] }; CChild = new DataColumn[1] { assetmanager.Columns["idman"] }; Relations.Add(new DataRelation("manager_assetmanager", CPar, CChild, false)); CPar = new DataColumn[1] { asset.Columns["idasset"] }; CChild = new DataColumn[1] { assetmanager.Columns["idasset"] }; Relations.Add(new DataRelation("asset_assetmanager", CPar, CChild, false)); CPar = new DataColumn[1] { asset.Columns["idasset"] }; CChild = new DataColumn[1] { assetlocation.Columns["idasset"] }; Relations.Add(new DataRelation("asset_assetlocation", CPar, CChild, false)); CPar = new DataColumn[1] { location.Columns["idlocation"] }; CChild = new DataColumn[1] { assetlocation.Columns["idlocation"] }; Relations.Add(new DataRelation("location_assetlocation", CPar, CChild, false)); CPar = new DataColumn[2] { asset.Columns["idasset"], asset.Columns["idpiece"] }; CChild = new DataColumn[2] { asset.Columns["idasset_prev"], asset.Columns["idpiece_prev"] }; Relations.Add(new DataRelation("asset_asset", CPar, CChild, false)); CPar = new DataColumn[1] { manager.Columns["idman"] }; CChild = new DataColumn[1] { asset.Columns["idcurrman"] }; Relations.Add(new DataRelation("manager_asset", CPar, CChild, false)); CPar = new DataColumn[1] { location.Columns["idlocation"] }; CChild = new DataColumn[1] { asset.Columns["idcurrlocation"] }; Relations.Add(new DataRelation("location_asset", CPar, CChild, false)); CPar = new DataColumn[1] { manager.Columns["idman"] }; CChild = new DataColumn[1] { asset.Columns["idcurrsubman"] }; Relations.Add(new DataRelation("manager_asset1", CPar, CChild, false)); CPar = new DataColumn[1] { inventory.Columns["idinventory"] }; CChild = new DataColumn[1] { assetacquire.Columns["idinventory"] }; Relations.Add(new DataRelation("inventory_assetacquire", CPar, CChild, false)); CPar = new DataColumn[1] { assetacquire.Columns["nassetacquire"] }; CChild = new DataColumn[1] { asset.Columns["nassetacquire"] }; Relations.Add(new DataRelation("assetacquire_asset", CPar, CChild, false)); #endregion }
static void Main(string[] args) { if (args.Length == 0) { System.Console.WriteLine("Please enter a type of generated report."); System.Console.WriteLine("Usage: sstc -m | -h [-w]"); System.Console.ReadKey(); return; } string opt = ""; string cmd = args[0]; if (args.Length > 1) { opt = args[1]; } if (cmd != "-m" && cmd != "-h") { System.Console.WriteLine("Invalid report type key, supported types keys are markdown [-m] and html [-h]."); System.Console.ReadKey(); return; } string LookupDirectory = Directory.GetCurrentDirectory() + "\\tables\\"; if (opt != "-w") { LookupDirectory += "ntos\\"; } else { LookupDirectory += "win32k\\"; } string[] Tables; try { Tables = Directory.GetFiles(LookupDirectory, "*.txt"); } catch (Exception e) { System.Console.WriteLine(e.Message); return; } IComparer Comparer = new ItemsComparer(); Array.Sort(Tables, Comparer); int fcount = Tables.Count(); int count = 0; List <sstTable> DataItems = new List <sstTable>(); int n = 0, id; // // Makrdown header. // string MarkdownHeader = "| # | ServiceName |"; string MarkdownSubHeader = "| --- | --- | "; // // Parse files into internal array. // foreach (var sName in Tables) { string[] fData; MarkdownHeader += (Path.GetFileNameWithoutExtension(sName) + " | "); try { fData = File.ReadAllLines(sName); for (int i = 0; i < fData.Count(); i++) { int u = 0; int syscall_id; string syscall_name; u = fData[i].IndexOf('\t') + 1; syscall_id = Convert.ToInt32(fData[i].Substring(u)); syscall_name = fData[i].Substring(0, u - 1); id = IndexOfItem(syscall_name, DataItems); if (id != -1) { var sstEntry = DataItems[id]; sstEntry.Indexes[n] = syscall_id; } else { var sstEntry = new sstTable(); sstEntry.ServiceName = syscall_name; sstEntry.Indexes = new int[fcount]; for (int k = 0; k < fcount; k++) { sstEntry.Indexes[k] = -1; } sstEntry.Indexes[n] = syscall_id; DataItems.Add(sstEntry); } } } catch (Exception e) { System.Console.WriteLine(e.Message); } n++; MarkdownSubHeader += (" --- | "); } StreamWriter file; try { if (cmd == "-m") { if (opt != "-w") { file = new StreamWriter("syscalls.md", false, Encoding.UTF8); } else { file = new StreamWriter("w32ksyscalls.md", false, Encoding.UTF8); } file.WriteLine(MarkdownHeader); file.WriteLine(MarkdownSubHeader); foreach (var Entry in DataItems) { count += 1; var s = "| " + count.ToString("0000") + " | "; s += Entry.ServiceName + " | "; for (int i = 0; i < fcount; i++) { if (Entry.Indexes[i] != -1) { s += Entry.Indexes[i].ToString() + " | "; } else { s += " | "; } } file.WriteLine(s); } file.Close(); } if (cmd == "-h") { string ReportHead = "<!DOCTYPE html><html><head>" + "<style>" + "table, th, td {" + "border: 1px solid black;" + "border-collapse: collapse;" + "} th, td {" + "padding: 5px;" + "} table tr:nth-child(even) { background-color: #eee;}" + "table tr:nth-child(odd) { background-color:#fff;}" + "table th { background-color: white; color: black; }" + "</style></head><body>"; string ColStart = "<td>"; string ColEnd = "</td>"; string RowEnd = "</tr>"; string ReportEnd = "</table></body></html>"; string TableHead = "<table><caption>Syscall Table Indexes</caption>" + "<tr><th style=\"width:20px\">#</th>" + "<th style=\"width:130px\">ServiceName</th>"; for (int i = 0; i < fcount; i++) { TableHead += "<th style=\"width:40px\">" + Path.GetFileNameWithoutExtension(Tables[i]) + "</th>"; } TableHead += RowEnd; string item = ""; if (opt != "-w") { file = new StreamWriter("syscalls.html", false, Encoding.UTF8); } else { file = new StreamWriter("w32ksyscalls.html", false, Encoding.UTF8); } file.WriteLine(ReportHead); file.WriteLine(TableHead); for (int i = 0; i < DataItems.Count; i++) { var Entry = DataItems[i]; item += "<tr><td>" + (i + 1).ToString() + ColEnd; item += ColStart + Entry.ServiceName + ColEnd; for (int j = 0; j < fcount; j++) { item += ColStart; if (Entry.Indexes[j] != -1) { item += Entry.Indexes[j].ToString(); } else { item += " "; } item += ColEnd; } item += RowEnd; } file.WriteLine(item); file.WriteLine(ReportEnd); file.Close(); } // cmd == -h } //try catch (Exception e) { System.Console.WriteLine(e.Message); System.Console.ReadKey(); } }
internal SqlFromClause(IEnumerable <SqlTableSource> tables) : base(null) { Tables.AddRange(tables); }
public virtual OptionAsync <IRelationalDatabaseTable> GetTable(Identifier tableName, CancellationToken cancellationToken = default) { return(Tables.Find(t => t.Name == tableName).ToAsync()); }
private void GrowTable(Tables tables) { int locksAcquired = 0; try { // The thread that first obtains m_locks[0] will be the one doing the resize operation AcquireLocks(0, 1, ref locksAcquired); // Make sure nobody resized the table while we were waiting for lock 0: if (tables != m_tables) { // We assume that since the table reference is different, it was already resized (or the budget // was adjusted). If we ever decide to do table shrinking, or replace the table for other reasons, // we will have to revisit this logic. return; } // Compute the (approx.) total size. Use an Int64 accumulation variable to avoid an overflow. long approxCount = 0; for (int i = 0; i < tables.m_countPerLock.Length; i++) { approxCount += tables.m_countPerLock[i]; } // // If the bucket array is too empty, double the budget instead of resizing the table // if (approxCount < tables.m_buckets.Length / 4) { m_budget = 2 * m_budget; if (m_budget < 0) { m_budget = int.MaxValue; } return; } // Compute the new table size. We find the smallest integer larger than twice the previous table size, and not divisible by // 2,3,5 or 7. We can consider a different table-sizing policy in the future. int newLength = 0; bool maximizeTableSize = false; try { checked { // Double the size of the buckets table and add one, so that we have an odd integer. newLength = tables.m_buckets.Length * 2 + 1; // Now, we only need to check odd integers, and find the first that is not divisible // by 3, 5 or 7. while (newLength % 3 == 0 || newLength % 5 == 0 || newLength % 7 == 0) { newLength += 2; } if (newLength > MaxArrayLength) { maximizeTableSize = true; } } } catch (OverflowException) { maximizeTableSize = true; } if (maximizeTableSize) { newLength = MaxArrayLength; // We want to make sure that GrowTable will not be called again, since table is at the maximum size. // To achieve that, we set the budget to int.MaxValue. // // (There is one special case that would allow GrowTable() to be called in the future: // calling Clear() on the ConcurrentDictionary will shrink the table and lower the budget.) m_budget = int.MaxValue; } // Now acquire all other locks for the table AcquireLocks(1, tables.m_locks.Length, ref locksAcquired); object[] newLocks = tables.m_locks; // Add more locks if (m_growLockArray && tables.m_locks.Length < MAX_LOCK_NUMBER) { newLocks = new object[tables.m_locks.Length * 2]; Array.Copy(tables.m_locks, newLocks, tables.m_locks.Length); for (int i = tables.m_locks.Length; i < newLocks.Length; i++) { newLocks[i] = new object(); } } Node[] newBuckets = new Node[newLength]; int[] newCountPerLock = new int[newLocks.Length]; // Copy all data into a new table, creating new nodes for all elements for (int i = 0; i < tables.m_buckets.Length; i++) { Node current = tables.m_buckets[i]; while (current != null) { Node next = current.m_next; int newBucketNo, newLockNo; GetBucketAndLockNo(current.m_hashcode, out newBucketNo, out newLockNo, newBuckets.Length, newLocks.Length); newBuckets[newBucketNo] = new Node(current.m_key, current.m_value, current.m_hashcode, newBuckets[newBucketNo]); checked { newCountPerLock[newLockNo]++; } current = next; } } // Adjust the budget m_budget = Math.Max(1, newBuckets.Length / newLocks.Length); // Replace tables with the new versions m_tables = new Tables(newBuckets, newLocks, newCountPerLock); } finally { // Release all locks that we took earlier ReleaseLocks(0, locksAcquired); } }
private bool TryAddInternal(TKey key, TValue value, bool updateIfExists, bool acquireLock, out TValue resultingValue) { int hashcode = m_comparer.GetHashCode(key); while (true) { int bucketNo, lockNo; Tables tables = m_tables; GetBucketAndLockNo(hashcode, out bucketNo, out lockNo, tables.m_buckets.Length, tables.m_locks.Length); bool resizeDesired = false; bool lockTaken = false; try { if (acquireLock) { Monitor.Enter(tables.m_locks[lockNo], ref lockTaken); } // If the table just got resized, we may not be holding the right lock, and must retry. // This should be a rare occurence. if (tables != m_tables) { continue; } // Try to find this key in the bucket Node prev = null; for (Node node = tables.m_buckets[bucketNo]; node != null; node = node.m_next) { if (m_comparer.Equals(node.m_key, key)) { // The key was found in the dictionary. If updates are allowed, update the value for that key. // We need to create a new node for the update, in order to support TValue types that cannot // be written atomically, since lock-free reads may be happening concurrently. if (updateIfExists) { if (s_isValueWriteAtomic) { node.m_value = value; } else { Node newNode = new Node(node.m_key, value, hashcode, node.m_next); if (prev == null) { tables.m_buckets[bucketNo] = newNode; } else { prev.m_next = newNode; } } resultingValue = value; } else { resultingValue = node.m_value; } return(false); } prev = node; } // The key was not found in the bucket. Insert the key-value pair. Volatile.Write <Node>(ref tables.m_buckets[bucketNo], new Node(key, value, hashcode, tables.m_buckets[bucketNo])); checked { tables.m_countPerLock[lockNo]++; } // // If the number of elements guarded by this lock has exceeded the budget, resize the bucket table. // It is also possible that GrowTable will increase the budget but won't resize the bucket table. // That happens if the bucket table is found to be poorly utilized due to a bad hash function. // if (tables.m_countPerLock[lockNo] > m_budget) { resizeDesired = true; } } finally { if (lockTaken) { Monitor.Exit(tables.m_locks[lockNo]); } } // // The fact that we got here means that we just performed an insertion. If necessary, we will grow the table. // // Concurrency notes: // - Notice that we are not holding any locks at when calling GrowTable. This is necessary to prevent deadlocks. // - As a result, it is possible that GrowTable will be called unnecessarily. But, GrowTable will obtain lock 0 // and then verify that the table we passed to it as the argument is still the current table. // if (resizeDesired) { GrowTable(tables); } resultingValue = value; return(true); } }
private void InitClass() { DataSetName = "vistaForm"; Prefix = ""; Namespace = "http://tempuri.org/vistaForm.xsd"; EnforceConstraints = false; DataTable T; DataColumn C; DataColumn [] key; T = new DataTable("entry"); C = new DataColumn("nentry", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("yentry", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("adate", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("doc", typeof(System.String), "")); T.Columns.Add(new DataColumn("docdate", typeof(System.DateTime), "")); T.Columns.Add(new DataColumn("idrelated", typeof(System.String), "")); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("official", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[2] { T.Columns["nentry"], T.Columns["yentry"] }; T.PrimaryKey = key; T = new DataTable("entrydetail"); C = new DataColumn("ndetail", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nentry", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("yentry", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("amount", typeof(System.Decimal), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idreg", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idsor1", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idsor2", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idsor3", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idupb", typeof(System.String), "")); T.Columns.Add(new DataColumn("lt", typeof(System.DateTime), "")); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idaccmotive", typeof(System.String), "")); T.Columns.Add(new DataColumn("official", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[3] { T.Columns["ndetail"], T.Columns["nentry"], T.Columns["yentry"] }; T.PrimaryKey = key; //Relations DataTable TPar; DataTable TChild; DataColumn [] CPar; DataColumn [] CChild; TPar = Tables["entry"]; TChild = Tables["entrydetail"]; CPar = new DataColumn[2] { TPar.Columns["nentry"], TPar.Columns["yentry"] }; CChild = new DataColumn[2] { TChild.Columns["nentry"], TChild.Columns["yentry"] }; Relations.Add(new DataRelation("entryentrydetail", CPar, CChild)); }
public Table Table(Type type) { return(Tables.GetOrThrow(type, "Table {0} not included in the schema. Consider sb.Include<{0}>()")); }
/// <inheritdoc/> public void RemoveChild(Base child) { Tables.Remove(child as TableDataSource); }
public void FullTest() { const int usersCount = 3; var data = new List <UserData>(usersCount); for (int i = 0; i < usersCount; i++) { data.Add(new UserData { UserId = i % 2 == 0 ? 0 : i, FirstName = "First" + i, LastName = "Last" + i, EMail = $"user{i}@company.com", RegDate = new DateTime(2020, 01, 02) }); } DateTime utcNow = new DateTime(2020, 10, 03, 10, 17, 12, 131); var recordIndex = CustomColumnFactory.Int32("Index"); var inserted = CustomColumnFactory.Int32("InsertedUserId"); var deleted = CustomColumnFactory.Int32("DeletedUserId"); var action = CustomColumnFactory.String("Action"); var mergeOutput = SqQueryBuilder .MergeDataInto(Tables.User(), data) .MapDataKeys(s => s.Set(s.Target.UserId, s.Source.UserId)) .MapData(s => s .Set(s.Target.FirstName, s.Source.FirstName) .Set(s.Target.LastName, s.Source.LastName) .Set(s.Target.Email, s.Source.EMail) .Set(s.Target.RegDate, s.Source.RegDate)) .MapExtraData(s => s.Set(recordIndex, s.Index)) .AndOn((t, s) => t.UserId.WithSource(s) != 0) .WhenMatchedThenUpdate() .AlsoSet(s => s.Set(s.Target.Version, s.Target.Version + 1) .Set(s.Target.Modified, utcNow)) .WhenNotMatchedByTargetThenInsert() .ExcludeKeys() .Exclude(t => new[] { t.Email.ColumnName, t.LastName.ColumnName }) .AlsoInsert(s => s .Set(s.Target.LastName, "Fake") .Set(s.Target.Created, utcNow) .Set(s.Target.Modified, utcNow) .Set(s.Target.Version, 1)) .WhenNotMatchedBySourceThenDelete() .Output((t, s, m) => m .Inserted(t.UserId.As(inserted)) .Inserted(t.UserId.As(deleted)) .Column(recordIndex.WithSource(s)) .Action(action)) .Done(); var actual = mergeOutput?.ToSql(); var expected = "MERGE [dbo].[user] [A0] USING (" + "VALUES (0,'First0','Last0','*****@*****.**','2020-01-02',0)," + "(1,'First1','Last1','*****@*****.**','2020-01-02',1)," + "(0,'First2','Last2','*****@*****.**','2020-01-02',2)" + ")[A1]([UserId],[FirstName],[LastName],[Email],[RegDate],[Index]) " + "ON [A0].[UserId]=[A1].[UserId] AND [A1].[UserId]!=0 " + "WHEN MATCHED THEN UPDATE SET " + "[A0].[FirstName]=[A1].[FirstName]," + "[A0].[LastName]=[A1].[LastName]," + "[A0].[Email]=[A1].[Email]," + "[A0].[RegDate]=[A1].[RegDate]," + "[A0].[Version]=[A0].[Version]+1," + "[A0].[Modified]='2020-10-03T10:17:12.131' " + "WHEN NOT MATCHED THEN INSERT" + "([FirstName],[RegDate],[LastName],[Created],[Modified],[Version]) " + "VALUES([A1].[FirstName],[A1].[RegDate],'Fake','2020-10-03T10:17:12.131','2020-10-03T10:17:12.131',1) " + "WHEN NOT MATCHED BY SOURCE THEN DELETE " + "OUTPUT INSERTED.[UserId] [InsertedUserId],INSERTED.[UserId] [DeletedUserId],[A1].[Index],$ACTION [Action];"; Assert.AreEqual(expected, actual); }
public void RefreshMergeDirection() { var aToBExists = false; var bToAExists = false; var noneExists = false; var partialExists = false; var allAreWithDelete = true; var allAreWithoutDelete = true; foreach (var table in Tables.Where(t => t.IsOK)) { if (table.MergeWithDelete) { allAreWithoutDelete = false; } else { allAreWithDelete = false; } switch (table.MergeDirection) { case a7DbComparerDirection.AtoB: aToBExists = true; break; case a7DbComparerDirection.BtoA: bToAExists = true; break; case a7DbComparerDirection.None: noneExists = true; break; case a7DbComparerDirection.Partial: partialExists = true; break; default: throw new ArgumentOutOfRangeException(); } } if (!noneExists && !partialExists && !bToAExists && aToBExists) { MergeDirection = a7DbComparerDirection.AtoB; } else if (!noneExists && !partialExists && bToAExists && !aToBExists) { MergeDirection = a7DbComparerDirection.BtoA; } else if (noneExists && !partialExists && !bToAExists && !aToBExists) { MergeDirection = a7DbComparerDirection.None; } else { MergeDirection = a7DbComparerDirection.Partial; } if (allAreWithDelete) { _mergeWithDelete = true; } else if (allAreWithoutDelete) { _mergeWithDelete = false; } else { _mergeWithDelete = null; } OnPropertyChanged(nameof(MergeDirection)); OnPropertyChanged(nameof(MergeWithDelete)); }
private void InitClass() { DataSetName = "vistaForm"; Prefix = ""; Namespace = "http://tempuri.org/vistaForm.xsd"; EnforceConstraints = false; DataTable T; DataColumn C; DataColumn [] key; T = new DataTable("fin"); C = new DataColumn("idfin", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codefin", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("title", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idfin"] }; T.PrimaryKey = key; T = new DataTable("finvar"); C = new DataColumn("yvar", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nvar", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("enactment", typeof(System.String), "")); T.Columns.Add(new DataColumn("variationkind", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("nenactment", typeof(System.String), "")); T.Columns.Add(new DataColumn("enactmentdate", typeof(System.DateTime), "")); C = new DataColumn("adate", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagprevision", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagcredit", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagproceeds", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagsecondaryprev", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[2] { T.Columns["yvar"], T.Columns["nvar"] }; T.PrimaryKey = key; T = new DataTable("finvardetail"); C = new DataColumn("yvar", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nvar", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idfin", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("description", typeof(System.String), "")); T.Columns.Add(new DataColumn("amount", typeof(System.Decimal), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idupb", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idunderwriting", typeof(System.Int32), "")); C = new DataColumn("rownum", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); //Primary Key key = new DataColumn[3] { T.Columns["yvar"], T.Columns["nvar"], T.Columns["rownum"] }; T.PrimaryKey = key; T = new DataTable("upb"); C = new DataColumn("idupb", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codeupb", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("title", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idupb"] }; T.PrimaryKey = key; T = new DataTable("expensesorted"); C = new DataColumn("idexp", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idsor", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idsubclass", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("amount", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("ayear", typeof(System.Int16), "")); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("description", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagnodate", typeof(System.String), "")); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridsor", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("paridsubclass", typeof(System.Int16), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); T.Columns.Add(new DataColumn("start", typeof(System.DateTime), "")); T.Columns.Add(new DataColumn("stop", typeof(System.DateTime), "")); T.Columns.Add(new DataColumn("tobecontinued", typeof(System.String), "")); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("valuen1", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("valuen2", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("valuen3", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("valuen4", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("valuen5", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("values1", typeof(System.String), "")); T.Columns.Add(new DataColumn("values2", typeof(System.String), "")); T.Columns.Add(new DataColumn("values3", typeof(System.String), "")); T.Columns.Add(new DataColumn("values4", typeof(System.String), "")); T.Columns.Add(new DataColumn("values5", typeof(System.String), "")); T.Columns.Add(new DataColumn("valuev1", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("valuev2", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("valuev3", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("valuev4", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("valuev5", typeof(System.Decimal), "")); Tables.Add(T); //Primary Key key = new DataColumn[3] { T.Columns["idexp"], T.Columns["idsor"], T.Columns["idsubclass"] }; T.PrimaryKey = key; T = new DataTable("sortingkind"); C = new DataColumn("idsorkind", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("active", typeof(System.String), "")); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagdate", typeof(System.String), "")); T.Columns.Add(new DataColumn("forcedN1", typeof(System.String), "")); T.Columns.Add(new DataColumn("forcedN2", typeof(System.String), "")); T.Columns.Add(new DataColumn("forcedN3", typeof(System.String), "")); T.Columns.Add(new DataColumn("forcedN4", typeof(System.String), "")); T.Columns.Add(new DataColumn("forcedN5", typeof(System.String), "")); T.Columns.Add(new DataColumn("forcedS1", typeof(System.String), "")); T.Columns.Add(new DataColumn("forcedS2", typeof(System.String), "")); T.Columns.Add(new DataColumn("forcedS3", typeof(System.String), "")); T.Columns.Add(new DataColumn("forcedS4", typeof(System.String), "")); T.Columns.Add(new DataColumn("forcedS5", typeof(System.String), "")); T.Columns.Add(new DataColumn("forcedv1", typeof(System.String), "")); T.Columns.Add(new DataColumn("forcedv2", typeof(System.String), "")); T.Columns.Add(new DataColumn("forcedv3", typeof(System.String), "")); T.Columns.Add(new DataColumn("forcedv4", typeof(System.String), "")); T.Columns.Add(new DataColumn("forcedv5", typeof(System.String), "")); T.Columns.Add(new DataColumn("labelfordate", typeof(System.String), "")); T.Columns.Add(new DataColumn("labeln1", typeof(System.String), "")); T.Columns.Add(new DataColumn("labeln2", typeof(System.String), "")); T.Columns.Add(new DataColumn("labeln3", typeof(System.String), "")); T.Columns.Add(new DataColumn("labeln4", typeof(System.String), "")); T.Columns.Add(new DataColumn("labeln5", typeof(System.String), "")); T.Columns.Add(new DataColumn("labels1", typeof(System.String), "")); T.Columns.Add(new DataColumn("labels2", typeof(System.String), "")); T.Columns.Add(new DataColumn("labels3", typeof(System.String), "")); T.Columns.Add(new DataColumn("labels4", typeof(System.String), "")); T.Columns.Add(new DataColumn("labels5", typeof(System.String), "")); T.Columns.Add(new DataColumn("labelv1", typeof(System.String), "")); T.Columns.Add(new DataColumn("labelv2", typeof(System.String), "")); T.Columns.Add(new DataColumn("labelv3", typeof(System.String), "")); T.Columns.Add(new DataColumn("labelv4", typeof(System.String), "")); T.Columns.Add(new DataColumn("labelv5", typeof(System.String), "")); T.Columns.Add(new DataColumn("lockedN1", typeof(System.String), "")); T.Columns.Add(new DataColumn("lockedN2", typeof(System.String), "")); T.Columns.Add(new DataColumn("lockedN3", typeof(System.String), "")); T.Columns.Add(new DataColumn("lockedN4", typeof(System.String), "")); T.Columns.Add(new DataColumn("lockedN5", typeof(System.String), "")); T.Columns.Add(new DataColumn("lockedS1", typeof(System.String), "")); T.Columns.Add(new DataColumn("lockedS2", typeof(System.String), "")); T.Columns.Add(new DataColumn("lockedS3", typeof(System.String), "")); T.Columns.Add(new DataColumn("lockedS4", typeof(System.String), "")); T.Columns.Add(new DataColumn("lockedS5", typeof(System.String), "")); T.Columns.Add(new DataColumn("lockedv1", typeof(System.String), "")); T.Columns.Add(new DataColumn("lockedv2", typeof(System.String), "")); T.Columns.Add(new DataColumn("lockedv3", typeof(System.String), "")); T.Columns.Add(new DataColumn("lockedv4", typeof(System.String), "")); T.Columns.Add(new DataColumn("lockedv5", typeof(System.String), "")); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("nodatelabel", typeof(System.String), "")); T.Columns.Add(new DataColumn("nphaseexpense", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("nphaseincome", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("totalexpression", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idsorkind"] }; T.PrimaryKey = key; T = new DataTable("expensephase"); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nphase", typeof(System.Byte), ""); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["nphase"] }; T.PrimaryKey = key; T = new DataTable("expensevar"); C = new DataColumn("nvar", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("adate", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("amount", typeof(System.Decimal), "")); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("doc", typeof(System.String), "")); T.Columns.Add(new DataColumn("docdate", typeof(System.DateTime), "")); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); T.Columns.Add(new DataColumn("transferkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); C = new DataColumn("yvar", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idinvkind", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("movkind", typeof(System.Int16), "")); T.Columns.Add(new DataColumn("ninv", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("yinv", typeof(System.Int16), "")); C = new DataColumn("idexp", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idpayment", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("autokind", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("autocode", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idunderwriting", typeof(System.Int32), "")); Tables.Add(T); //Primary Key key = new DataColumn[2] { T.Columns["nvar"], T.Columns["idexp"] }; T.PrimaryKey = key; T = new DataTable("expenseyear"); C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("amount", typeof(System.Decimal), "")); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idupb", typeof(System.String), "")); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idfin", typeof(System.Int32), "")); C = new DataColumn("idexp", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); //Primary Key key = new DataColumn[2] { T.Columns["ayear"], T.Columns["idexp"] }; T.PrimaryKey = key; T = new DataTable("expensetotal"); C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("available", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("curramount", typeof(System.Decimal), "")); C = new DataColumn("idexp", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flag", typeof(System.Byte), "")); Tables.Add(T); //Primary Key key = new DataColumn[2] { T.Columns["ayear"], T.Columns["idexp"] }; T.PrimaryKey = key; T = new DataTable("expense"); C = new DataColumn("adate", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("doc", typeof(System.String), "")); T.Columns.Add(new DataColumn("docdate", typeof(System.DateTime), "")); T.Columns.Add(new DataColumn("expiration", typeof(System.DateTime), "")); T.Columns.Add(new DataColumn("idreg", typeof(System.Int32), "")); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nmov", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); C = new DataColumn("ymov", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idclawback", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idman", typeof(System.Int32), "")); C = new DataColumn("nphase", typeof(System.Byte), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idexp", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("parentidexp", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idpayment", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idformerexpense", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("autokind", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("autocode", typeof(System.Int32), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idexp"] }; T.PrimaryKey = key; T = new DataTable("config"); C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("agencycode", typeof(System.String), "")); T.Columns.Add(new DataColumn("appname", typeof(System.String), "")); T.Columns.Add(new DataColumn("appropriationphasecode", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("assessmentphasecode", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("asset_flagnumbering", typeof(System.String), "")); T.Columns.Add(new DataColumn("asset_flagrestart", typeof(System.String), "")); T.Columns.Add(new DataColumn("assetload_flag", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("boxpartitiontitle", typeof(System.String), "")); T.Columns.Add(new DataColumn("cashvaliditykind", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("casualcontract_flagrestart", typeof(System.String), "")); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("currpartitiontitle", typeof(System.String), "")); T.Columns.Add(new DataColumn("deferredexpensephase", typeof(System.String), "")); T.Columns.Add(new DataColumn("deferredincomephase", typeof(System.String), "")); T.Columns.Add(new DataColumn("electronicimport", typeof(System.String), "")); T.Columns.Add(new DataColumn("electronictrasmission", typeof(System.String), "")); T.Columns.Add(new DataColumn("expense_expiringdays", typeof(System.Int16), "")); T.Columns.Add(new DataColumn("expensephase", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("flagautopayment", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagautoproceeds", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagcredit", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagepexp", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagfruitful", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagpayment", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagproceeds", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagrefund", typeof(System.String), "")); T.Columns.Add(new DataColumn("foreignhours", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idacc_accruedcost", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_accruedrevenue", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_customer", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_deferredcost", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_deferredcredit", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_deferreddebit", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_deferredrevenue", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_ivapayment", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_ivarefund", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_patrimony", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_pl", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_supplier", typeof(System.String), "")); T.Columns.Add(new DataColumn("idaccmotive_admincar", typeof(System.String), "")); T.Columns.Add(new DataColumn("idaccmotive_foot", typeof(System.String), "")); T.Columns.Add(new DataColumn("idaccmotive_owncar", typeof(System.String), "")); T.Columns.Add(new DataColumn("idclawback", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idfinexpense", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idfinexpensesurplus", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idfinincomesurplus", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idfinivapayment", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idfinivarefund", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idivapayperiodicity", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idregauto", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idsortingkind1", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idsortingkind2", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idsortingkind3", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("importappname", typeof(System.String), "")); T.Columns.Add(new DataColumn("income_expiringdays", typeof(System.Int16), "")); T.Columns.Add(new DataColumn("incomephase", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("linktoinvoice", typeof(System.String), "")); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("minpayment", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("minrefund", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("motivelen", typeof(System.Int16), "")); T.Columns.Add(new DataColumn("motiveprefix", typeof(System.String), "")); T.Columns.Add(new DataColumn("motiveseparator", typeof(System.String), "")); T.Columns.Add(new DataColumn("payment_finlevel", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("payment_flag", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("payment_flagautoprintdate", typeof(System.String), "")); T.Columns.Add(new DataColumn("paymentagency", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("prevpartitiontitle", typeof(System.String), "")); T.Columns.Add(new DataColumn("proceeds_finlevel", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("proceeds_flag", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("proceeds_flagautoprintdate", typeof(System.String), "")); T.Columns.Add(new DataColumn("profservice_flagrestart", typeof(System.String), "")); T.Columns.Add(new DataColumn("refundagency", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("wageaddition_flagrestart", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["ayear"] }; T.PrimaryKey = key; T = new DataTable("expenseview"); C = new DataColumn("idexp", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nphase", typeof(System.Byte), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("phase", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ymov", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nmov", typeof(System.Int32), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("parentidexp", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("parentymov", typeof(System.Int16), "")); T.Columns.Add(new DataColumn("parentnmov", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idformerexpense", typeof(System.Int32), "")); C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idfin", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("codefin", typeof(System.String), "")); T.Columns.Add(new DataColumn("finance", typeof(System.String), "")); T.Columns.Add(new DataColumn("idupb", typeof(System.String), "")); T.Columns.Add(new DataColumn("codeupb", typeof(System.String), "")); T.Columns.Add(new DataColumn("upb", typeof(System.String), "")); T.Columns.Add(new DataColumn("idreg", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("registry", typeof(System.String), "")); T.Columns.Add(new DataColumn("idman", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("manager", typeof(System.String), "")); C = new DataColumn("ypay", typeof(System.Int16), ""); C.ReadOnly = true; T.Columns.Add(C); T.Columns.Add(new DataColumn("npay", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("paymentadate", typeof(System.DateTime), "")); T.Columns.Add(new DataColumn("doc", typeof(System.String), "")); T.Columns.Add(new DataColumn("docdate", typeof(System.DateTime), "")); C = new DataColumn("description", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("amount", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("ayearstartamount", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("curramount", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("available", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("idregistrypaymethod", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idpaymethod", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("cin", typeof(System.String), "")); T.Columns.Add(new DataColumn("idbank", typeof(System.String), "")); T.Columns.Add(new DataColumn("idcab", typeof(System.String), "")); T.Columns.Add(new DataColumn("cc", typeof(System.String), "")); T.Columns.Add(new DataColumn("iddeputy", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("deputy", typeof(System.String), "")); T.Columns.Add(new DataColumn("refexternaldoc", typeof(System.String), "")); T.Columns.Add(new DataColumn("paymentdescr", typeof(System.String), "")); T.Columns.Add(new DataColumn("idser", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("service", typeof(System.String), "")); T.Columns.Add(new DataColumn("servicestart", typeof(System.DateTime), "")); T.Columns.Add(new DataColumn("servicestop", typeof(System.DateTime), "")); T.Columns.Add(new DataColumn("ivaamount", typeof(System.Decimal), "")); T.Columns.Add(new DataColumn("flag", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("totflag", typeof(System.Byte), "")); C = new DataColumn("flagarrear", typeof(System.String), ""); C.ReadOnly = true; T.Columns.Add(C); T.Columns.Add(new DataColumn("autokind", typeof(System.Byte), "")); T.Columns.Add(new DataColumn("idpayment", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("expiration", typeof(System.DateTime), "")); C = new DataColumn("adate", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("autocode", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idclawback", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("clawback", typeof(System.String), "")); T.Columns.Add(new DataColumn("nbill", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("idpay", typeof(System.Int32), "")); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("!realavailable", typeof(System.Decimal), "")); Tables.Add(T); //Relations DataTable TPar; DataTable TChild; DataColumn [] CPar; DataColumn [] CChild; TPar = Tables["expensephase"]; TChild = Tables["expense"]; CPar = new DataColumn[1] { TPar.Columns["nphase"] }; CChild = new DataColumn[1] { TChild.Columns["nphase"] }; Relations.Add(new DataRelation("expensephase_expense", CPar, CChild)); TPar = Tables["expense"]; TChild = Tables["expensetotal"]; CPar = new DataColumn[1] { TPar.Columns["idexp"] }; CChild = new DataColumn[1] { TChild.Columns["idexp"] }; Relations.Add(new DataRelation("expense_expensetotal", CPar, CChild)); TPar = Tables["fin"]; TChild = Tables["expenseyear"]; CPar = new DataColumn[1] { TPar.Columns["idfin"] }; CChild = new DataColumn[1] { TChild.Columns["idfin"] }; Relations.Add(new DataRelation("fin_expenseyear", CPar, CChild)); TPar = Tables["upb"]; TChild = Tables["expenseyear"]; CPar = new DataColumn[1] { TPar.Columns["idupb"] }; CChild = new DataColumn[1] { TChild.Columns["idupb"] }; Relations.Add(new DataRelation("upb_expenseyear", CPar, CChild)); TPar = Tables["expense"]; TChild = Tables["expensevar"]; CPar = new DataColumn[1] { TPar.Columns["idexp"] }; CChild = new DataColumn[1] { TChild.Columns["idexp"] }; Relations.Add(new DataRelation("expense_expensevar", CPar, CChild)); TPar = Tables["expense"]; TChild = Tables["expensesorted"]; CPar = new DataColumn[1] { TPar.Columns["idexp"] }; CChild = new DataColumn[1] { TChild.Columns["idexp"] }; Relations.Add(new DataRelation("expense_expensesorted", CPar, CChild)); TPar = Tables["fin"]; TChild = Tables["finvardetail"]; CPar = new DataColumn[1] { TPar.Columns["idfin"] }; CChild = new DataColumn[1] { TChild.Columns["idfin"] }; Relations.Add(new DataRelation("fin_finvardetail", CPar, CChild)); TPar = Tables["finvar"]; TChild = Tables["finvardetail"]; CPar = new DataColumn[2] { TPar.Columns["yvar"], TPar.Columns["nvar"] }; CChild = new DataColumn[2] { TChild.Columns["yvar"], TChild.Columns["nvar"] }; Relations.Add(new DataRelation("finvar_finvardetail", CPar, CChild)); TPar = Tables["upb"]; TChild = Tables["finvardetail"]; CPar = new DataColumn[1] { TPar.Columns["idupb"] }; CChild = new DataColumn[1] { TChild.Columns["idupb"] }; Relations.Add(new DataRelation("upb_finvardetail", CPar, CChild)); }
/// <summary> /// Fills the <see cref="Tables"/> collection with all tables available in the database. /// </summary> /// <param name="initSchema">Set to <b>true</b> to initialize each table's schema.</param> public void CreateAllTables(bool initSchema) { List <string> tableNames = new List <string>(); tableNames.AddRange(GetTableNames()); // filter tables for (int i = 0; i < tableNames.Count; i++) { FilterConnectionTablesEventArgs e = new FilterConnectionTablesEventArgs(this, tableNames[i]); Config.DesignerSettings.OnFilterConnectionTables(this, e); if (e.Skip) { tableNames.RemoveAt(i); i--; } } // remove tables with tablename that does not exist in the connection. for (int i = 0; i < Tables.Count; i++) { TableDataSource table = Tables[i]; bool found = !String.IsNullOrEmpty(table.SelectCommand); // skip tables with non-empty selectcommand if (!found) { foreach (string tableName in tableNames) { if (String.Compare(table.TableName, tableName, true) == 0) { found = true; break; } } } // table name not found between actual tablenames. It may happen if we have edited the connection. if (!found) { table.Dispose(); i--; } } // now create tables that are not created yet. foreach (string tableName in tableNames) { bool found = false; foreach (TableDataSource table in Tables) { if (String.Compare(table.TableName, tableName, true) == 0) { found = true; break; } } if (!found) { TableDataSource table = new TableDataSource(); string fixedTableName = tableName.Replace(".", "_").Replace("[", "").Replace("]", "").Replace("\"", ""); if (Report != null) { table.Name = Report.Dictionary.CreateUniqueName(fixedTableName); table.Alias = Report.Dictionary.CreateUniqueAlias(table.Alias); } else { table.Name = fixedTableName; } table.TableName = tableName; table.Connection = this; table.Enabled = false; Tables.Add(table); } } // init table schema if (initSchema) { foreach (TableDataSource table in Tables) { table.InitSchema(); } } }
/// <summary> /// Gets the registered types. /// </summary> /// <returns>The registered types.</returns> public virtual Type[] GetRegisteredTypes() { return(Tables.Select(x => x.Value.Type).ToArray()); }
private void InitClass() { this.DataSetName = "vistaForm"; this.Prefix = ""; this.Namespace = "http://tempuri.org/vistaForm.xsd"; this.EnforceConstraints = false; DataTable T; DataColumn C; DataColumn [] key; T = new DataTable("entrysetup"); T.Namespace = this.Namespace; C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idacc_customer", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_supplier", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_ivapayment", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_ivarefund", typeof(System.String), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagepexp", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_accruedcost", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_accruedrevenue", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_deferredcost", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_deferredrevenue", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_pl", typeof(System.String), "")); T.Columns.Add(new DataColumn("idacc_patrimony", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["ayear"] }; T.PrimaryKey = key; T = new DataTable("account_ivapayment"); T.Namespace = this.Namespace; C = new DataColumn("idacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codeacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridacc", typeof(System.String), "")); C = new DataColumn("printingorder", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("title", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagtransitory", typeof(System.String), "")); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nlevel", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idaccountkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagregistry", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagupb", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idacc"] }; T.PrimaryKey = key; T = new DataTable("account_supplier"); T.Namespace = this.Namespace; C = new DataColumn("idacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codeacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridacc", typeof(System.String), "")); C = new DataColumn("printingorder", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("title", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagtransitory", typeof(System.String), "")); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nlevel", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idaccountkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagregistry", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagupb", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idacc"] }; T.PrimaryKey = key; T = new DataTable("account_ivarefund"); T.Namespace = this.Namespace; C = new DataColumn("idacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codeacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridacc", typeof(System.String), "")); C = new DataColumn("printingorder", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("title", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagtransitory", typeof(System.String), "")); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nlevel", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idaccountkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagregistry", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagupb", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idacc"] }; T.PrimaryKey = key; T = new DataTable("account_customer"); T.Namespace = this.Namespace; C = new DataColumn("idacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codeacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridacc", typeof(System.String), "")); C = new DataColumn("printingorder", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("title", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagtransitory", typeof(System.String), "")); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nlevel", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idaccountkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagregistry", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagupb", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idacc"] }; T.PrimaryKey = key; T = new DataTable("account_accruedcost"); T.Namespace = this.Namespace; C = new DataColumn("idacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codeacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridacc", typeof(System.String), "")); C = new DataColumn("printingorder", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("title", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagtransitory", typeof(System.String), "")); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nlevel", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idaccountkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagregistry", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagupb", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idacc"] }; T.PrimaryKey = key; T = new DataTable("account_accruedrevenue"); T.Namespace = this.Namespace; C = new DataColumn("idacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codeacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridacc", typeof(System.String), "")); C = new DataColumn("printingorder", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("title", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagtransitory", typeof(System.String), "")); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nlevel", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idaccountkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagregistry", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagupb", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idacc"] }; T.PrimaryKey = key; T = new DataTable("account_deferredcost"); T.Namespace = this.Namespace; C = new DataColumn("idacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codeacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridacc", typeof(System.String), "")); C = new DataColumn("printingorder", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("title", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagtransitory", typeof(System.String), "")); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nlevel", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idaccountkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagregistry", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagupb", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idacc"] }; T.PrimaryKey = key; T = new DataTable("account_deferredrevenue"); T.Namespace = this.Namespace; C = new DataColumn("idacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codeacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridacc", typeof(System.String), "")); C = new DataColumn("printingorder", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("title", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagtransitory", typeof(System.String), "")); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nlevel", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idaccountkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagregistry", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagupb", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idacc"] }; T.PrimaryKey = key; T = new DataTable("account_pat"); T.Namespace = this.Namespace; C = new DataColumn("idacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codeacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagregistry", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagtransitory", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagupb", typeof(System.String), "")); T.Columns.Add(new DataColumn("idaccountkind", typeof(System.String), "")); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nlevel", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridacc", typeof(System.String), "")); C = new DataColumn("printingorder", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("title", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("idpatrimony", typeof(System.String), "")); T.Columns.Add(new DataColumn("idplaccount", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagprofit", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagloss", typeof(System.String), "")); T.Columns.Add(new DataColumn("placcount_sign", typeof(System.String), "")); T.Columns.Add(new DataColumn("patrimony_sign", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagcompetency", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idacc"] }; T.PrimaryKey = key; T = new DataTable("account_pl"); T.Namespace = this.Namespace; C = new DataColumn("idacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codeacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagregistry", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagtransitory", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagupb", typeof(System.String), "")); T.Columns.Add(new DataColumn("idaccountkind", typeof(System.String), "")); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nlevel", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridacc", typeof(System.String), "")); C = new DataColumn("printingorder", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("title", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("idpatrimony", typeof(System.String), "")); T.Columns.Add(new DataColumn("idplaccount", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagprofit", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagloss", typeof(System.String), "")); T.Columns.Add(new DataColumn("placcount_sign", typeof(System.String), "")); T.Columns.Add(new DataColumn("patrimony_sign", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagcompetency", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idacc"] }; T.PrimaryKey = key; //Relations DataTable TPar; DataTable TChild; DataColumn [] CPar; DataColumn [] CChild; TPar = Tables["account_deferredrevenue"]; TChild = Tables["entrysetup"]; CPar = new DataColumn[1] { TPar.Columns["idacc"] }; CChild = new DataColumn[1] { TChild.Columns["idacc_deferredrevenue"] }; Relations.Add(new DataRelation("account_deferredrevenueentrysetup", CPar, CChild)); TPar = Tables["account_ivarefund"]; TChild = Tables["entrysetup"]; CPar = new DataColumn[1] { TPar.Columns["idacc"] }; CChild = new DataColumn[1] { TChild.Columns["idacc_ivarefund"] }; Relations.Add(new DataRelation("account_ivarefundentrysetup", CPar, CChild)); TPar = Tables["account_ivapayment"]; TChild = Tables["entrysetup"]; CPar = new DataColumn[1] { TPar.Columns["idacc"] }; CChild = new DataColumn[1] { TChild.Columns["idacc_ivapayment"] }; Relations.Add(new DataRelation("account_ivapaymententrysetup", CPar, CChild)); TPar = Tables["account_supplier"]; TChild = Tables["entrysetup"]; CPar = new DataColumn[1] { TPar.Columns["idacc"] }; CChild = new DataColumn[1] { TChild.Columns["idacc_supplier"] }; Relations.Add(new DataRelation("account_supplierentrysetup", CPar, CChild)); TPar = Tables["account_customer"]; TChild = Tables["entrysetup"]; CPar = new DataColumn[1] { TPar.Columns["idacc"] }; CChild = new DataColumn[1] { TChild.Columns["idacc_customer"] }; Relations.Add(new DataRelation("account_customerentrysetup", CPar, CChild)); TPar = Tables["account_accruedcost"]; TChild = Tables["entrysetup"]; CPar = new DataColumn[1] { TPar.Columns["idacc"] }; CChild = new DataColumn[1] { TChild.Columns["idacc_accruedcost"] }; Relations.Add(new DataRelation("account_accruedcostentrysetup", CPar, CChild)); TPar = Tables["account_accruedrevenue"]; TChild = Tables["entrysetup"]; CPar = new DataColumn[1] { TPar.Columns["idacc"] }; CChild = new DataColumn[1] { TChild.Columns["idacc_accruedrevenue"] }; Relations.Add(new DataRelation("account_accruedrevenueentrysetup", CPar, CChild)); TPar = Tables["account_deferredcost"]; TChild = Tables["entrysetup"]; CPar = new DataColumn[1] { TPar.Columns["idacc"] }; CChild = new DataColumn[1] { TChild.Columns["idacc_deferredcost"] }; Relations.Add(new DataRelation("account_deferredcostentrysetup", CPar, CChild)); TPar = Tables["account_pat"]; TChild = Tables["entrysetup"]; CPar = new DataColumn[1] { TPar.Columns["idacc"] }; CChild = new DataColumn[1] { TChild.Columns["idacc_patrimony"] }; Relations.Add(new DataRelation("account_pat_entrysetup", CPar, CChild)); TPar = Tables["account_pl"]; TChild = Tables["entrysetup"]; CPar = new DataColumn[1] { TPar.Columns["idacc"] }; CChild = new DataColumn[1] { TChild.Columns["idacc_pl"] }; Relations.Add(new DataRelation("account_pl_entrysetup", CPar, CChild)); }
public bool IncludeViews() { return(Tables.Any()); }
private void InitClass() { DataSetName = "dsContratto"; Prefix = ""; Namespace = "http://tempuri.org/dsContratto.xsd"; EnforceConstraints = false; #region create DataTables DataTable T; DataColumn C; //////////////////// PARASUBCONTRACT ///////////////////////////////// T = new DataTable("parasubcontract"); C = new DataColumn("idcon", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ycon", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ncon", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idreg", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("duty", typeof(String))); T.Columns.Add(new DataColumn("idpayrollkind", typeof(String))); C = new DataColumn("idser", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("employed", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("payrollccinfo", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("start", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("stop", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("monthlen", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("grossamount", typeof(Decimal)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idpat", typeof(Int32))); T.Columns.Add(new DataColumn("matricula", typeof(Int32))); T.Columns.Add(new DataColumn("idmatriculabook", typeof(String))); T.Columns.Add(new DataColumn("cu", typeof(String))); T.Columns.Add(new DataColumn("ct", typeof(DateTime))); T.Columns.Add(new DataColumn("lu", typeof(String))); T.Columns.Add(new DataColumn("lt", typeof(DateTime))); T.Columns.Add(new DataColumn("!denominazione", typeof(String))); T.Columns.Add(new DataColumn("!causa", typeof(String))); T.Columns.Add(new DataColumn("requested_doc", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idcon"] }; //////////////////// PARASUBCONTRACTYEAR ///////////////////////////////// T = new DataTable("parasubcontractyear"); C = new DataColumn("ayear", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idcon", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("regionaltax", typeof(Decimal))); T.Columns.Add(new DataColumn("countrytax", typeof(Decimal))); T.Columns.Add(new DataColumn("citytax", typeof(Decimal))); T.Columns.Add(new DataColumn("ratequantity", typeof(Int32))); T.Columns.Add(new DataColumn("startmonth", typeof(Int32))); T.Columns.Add(new DataColumn("suspendedregionaltax", typeof(Decimal))); T.Columns.Add(new DataColumn("suspendedcitytax", typeof(Decimal))); T.Columns.Add(new DataColumn("suspendedcountrytax", typeof(Decimal))); T.Columns.Add(new DataColumn("idotherinsurance", typeof(String))); T.Columns.Add(new DataColumn("activitycode", typeof(String))); T.Columns.Add(new DataColumn("idemenscontractkind", typeof(String))); T.Columns.Add(new DataColumn("cu", typeof(String))); T.Columns.Add(new DataColumn("ct", typeof(DateTime))); T.Columns.Add(new DataColumn("lu", typeof(String))); T.Columns.Add(new DataColumn("lt", typeof(DateTime))); T.Columns.Add(new DataColumn("notaxappliance", typeof(String))); T.Columns.Add(new DataColumn("applybrackets", typeof(String))); T.Columns.Add(new DataColumn("highertax", typeof(Decimal))); T.Columns.Add(new DataColumn("taxablecud", typeof(Decimal))); T.Columns.Add(new DataColumn("cuddays", typeof(Int16))); T.Columns.Add(new DataColumn("taxablecontract", typeof(Decimal))); T.Columns.Add(new DataColumn("ndays", typeof(Int32))); T.Columns.Add(new DataColumn("taxablepension", typeof(Decimal))); T.Columns.Add(new DataColumn("fiscaldeduction", typeof(Decimal))); T.Columns.Add(new DataColumn("notaxdeduction", typeof(Decimal))); T.Columns.Add(new DataColumn("taxablegross", typeof(Decimal))); T.Columns.Add(new DataColumn("taxablenet", typeof(Decimal))); T.Columns.Add(new DataColumn("startcompetency", typeof(DateTime))); T.Columns.Add(new DataColumn("stopcompetency", typeof(DateTime))); T.Columns.Add(new DataColumn("idresidence", typeof(Int32))); T.Columns.Add(new DataColumn("flagbonusappliance", typeof(String))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["ayear"], T.Columns["idcon"] }; //////////////////// PARASUBCONTRACTFAMILY ///////////////////////////////// T = new DataTable("parasubcontractfamily"); C = new DataColumn("idcon", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idfamily", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idaffinity", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("surname", typeof(String))); T.Columns.Add(new DataColumn("forename", typeof(String))); T.Columns.Add(new DataColumn("idcitybirth", typeof(Int32))); T.Columns.Add(new DataColumn("idnation", typeof(Int32))); T.Columns.Add(new DataColumn("birthdate", typeof(DateTime))); T.Columns.Add(new DataColumn("gender", typeof(String))); T.Columns.Add(new DataColumn("flagforeign", typeof(String))); T.Columns.Add(new DataColumn("cf", typeof(String))); T.Columns.Add(new DataColumn("startapplication", typeof(DateTime))); T.Columns.Add(new DataColumn("stopapplication", typeof(DateTime))); T.Columns.Add(new DataColumn("appliancepercentage", typeof(Decimal))); T.Columns.Add(new DataColumn("starthandicap", typeof(DateTime))); C = new DataColumn("foreignresident", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("flagdependent", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idcon"], T.Columns["idfamily"], T.Columns["ayear"] }; //////////////////// CONTRATTONONTRASFERIBILE ///////////////////////////////// T = new DataTable("contrattonontrasferibile"); C = new DataColumn("idcon", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("!causa", typeof(String))); C = new DataColumn("ycon", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ncon", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idreg", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("duty", typeof(String))); T.Columns.Add(new DataColumn("idpayrollkind", typeof(String))); C = new DataColumn("idser", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("employed", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("payrollccinfo", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("start", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("stop", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("monthlen", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("grossamount", typeof(Decimal)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idpat", typeof(Int32))); T.Columns.Add(new DataColumn("matricula", typeof(Int32))); T.Columns.Add(new DataColumn("idmatriculabook", typeof(String))); T.Columns.Add(new DataColumn("cu", typeof(String))); T.Columns.Add(new DataColumn("ct", typeof(DateTime))); T.Columns.Add(new DataColumn("lu", typeof(String))); T.Columns.Add(new DataColumn("lt", typeof(DateTime))); T.Columns.Add(new DataColumn("!denominazione", typeof(String))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idcon"] }; //////////////////// OTHERINSURANCE ///////////////////////////////// T = new DataTable("otherinsurance"); C = new DataColumn("ayear", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idotherinsurance", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("lu", typeof(String))); T.Columns.Add(new DataColumn("lt", typeof(DateTime))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["ayear"], T.Columns["idotherinsurance"] }; //////////////////// INPSACTIVITY ///////////////////////////////// T = new DataTable("inpsactivity"); C = new DataColumn("ayear", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("activitycode", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("description", typeof(String))); T.Columns.Add(new DataColumn("lu", typeof(String))); T.Columns.Add(new DataColumn("lt", typeof(DateTime))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["ayear"], T.Columns["activitycode"] }; //////////////////// EMENSCONTRACTKIND ///////////////////////////////// T = new DataTable("emenscontractkind"); C = new DataColumn("idemenscontractkind", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("description", typeof(String))); T.Columns.Add(new DataColumn("annotations", typeof(String))); T.Columns.Add(new DataColumn("flagactivityrequested", typeof(String))); T.Columns.Add(new DataColumn("module", typeof(String))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["ayear"], T.Columns["idemenscontractkind"] }; //////////////////// PAYROLL ///////////////////////////////// T = new DataTable("payroll"); C = new DataColumn("idpayroll", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("fiscalyear", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("enabletaxrelief", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("currentrounding", typeof(Decimal)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("feegross", typeof(Decimal)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("netfee", typeof(Decimal))); T.Columns.Add(new DataColumn("ct", typeof(DateTime))); T.Columns.Add(new DataColumn("cu", typeof(String))); T.Columns.Add(new DataColumn("disbursementdate", typeof(DateTime))); C = new DataColumn("stop", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("start", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("flagcomputed", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagbalance", typeof(String))); C = new DataColumn("workingdays", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idresidence", typeof(Int32))); C = new DataColumn("idcon", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("lt", typeof(DateTime))); T.Columns.Add(new DataColumn("lu", typeof(String))); C = new DataColumn("npayroll", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagsummarybalance", typeof(String))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idpayroll"] }; #endregion #region DataRelation creation DataColumn [] CPar; DataColumn [] CChild; CPar = new DataColumn[1] { parasubcontract.Columns["idcon"] }; CChild = new DataColumn[1] { payroll.Columns["idcon"] }; Relations.Add(new DataRelation("parasubcontractpayroll", CPar, CChild, false)); CPar = new DataColumn[1] { parasubcontract.Columns["idcon"] }; CChild = new DataColumn[1] { parasubcontractfamily.Columns["idcon"] }; Relations.Add(new DataRelation("parasubcontractparasubcontractfamily", CPar, CChild, false)); CPar = new DataColumn[1] { parasubcontract.Columns["idcon"] }; CChild = new DataColumn[1] { parasubcontractyear.Columns["idcon"] }; Relations.Add(new DataRelation("parasubcontractparasubcontractyear", CPar, CChild, false)); CPar = new DataColumn[2] { otherinsurance.Columns["ayear"], otherinsurance.Columns["idotherinsurance"] }; CChild = new DataColumn[2] { parasubcontractyear.Columns["ayear"], parasubcontractyear.Columns["idotherinsurance"] }; Relations.Add(new DataRelation("otherinsuranceparasubcontractyear", CPar, CChild, false)); CPar = new DataColumn[2] { inpsactivity.Columns["ayear"], inpsactivity.Columns["activitycode"] }; CChild = new DataColumn[2] { parasubcontractyear.Columns["ayear"], parasubcontractyear.Columns["activitycode"] }; Relations.Add(new DataRelation("inpsactivityparasubcontractyear", CPar, CChild, false)); CPar = new DataColumn[2] { emenscontractkind.Columns["ayear"], emenscontractkind.Columns["idemenscontractkind"] }; CChild = new DataColumn[2] { parasubcontractyear.Columns["ayear"], parasubcontractyear.Columns["idemenscontractkind"] }; Relations.Add(new DataRelation("emenscontractkindparasubcontractyear", CPar, CChild, false)); #endregion }
private void InitClass() { DataSetName = "vistaContributiTipiContrattiCSA"; Prefix = ""; Namespace = "http://tempuri.org/vistaContributiTipiContrattiCSA.xsd"; EnforceConstraints = false; #region create DataTables DataTable T; DataColumn C; //////////////////// CSA_CONTRACT ///////////////////////////////// T = new DataTable("csa_contract"); C = new DataColumn("idcsa_contract", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ycontract", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ncontract", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idcsa_contractkind", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("description", typeof(String))); C = new DataColumn("title", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("flagkeepalive", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idupb", typeof(String))); T.Columns.Add(new DataColumn("idacc_main", typeof(String))); T.Columns.Add(new DataColumn("idexp_main", typeof(Int32))); T.Columns.Add(new DataColumn("idfin_main", typeof(Int32))); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagrecreate", typeof(String))); T.Columns.Add(new DataColumn("active", typeof(String))); T.Columns.Add(new DataColumn("idsor_siope_main", typeof(Int32))); T.Columns.Add(new DataColumn("idunderwriting", typeof(Int32))); T.Columns.Add(new DataColumn("idepexp_main", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idcsa_contract"], T.Columns["ayear"] }; //////////////////// CSA_CONTRACTKINDYEAR ///////////////////////////////// T = new DataTable("csa_contractkindyear"); C = new DataColumn("idcsa_contractkind", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idupb", typeof(String))); T.Columns.Add(new DataColumn("idacc_main", typeof(String))); T.Columns.Add(new DataColumn("idfin_main", typeof(Int32))); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idsor_siope_main", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idcsa_contractkind"], T.Columns["ayear"] }; //////////////////// CSA_CONTRACTKIND ///////////////////////////////// T = new DataTable("csa_contractkind"); C = new DataColumn("idcsa_contractkind", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("contractkindcode", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("flagcr", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagkeepalive", typeof(String))); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("active", typeof(String))); T.Columns.Add(new DataColumn("idunderwriting", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idcsa_contractkind"] }; //////////////////// CSA_CONTRACTTAX ///////////////////////////////// T = new DataTable("csa_contracttax"); C = new DataColumn("idcsa_contract", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idcsa_contracttax", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("vocecsa", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idfin", typeof(Int32))); T.Columns.Add(new DataColumn("idexp", typeof(Int32))); T.Columns.Add(new DataColumn("idacc", typeof(String))); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idupb", typeof(String))); T.Columns.Add(new DataColumn("idsor_siope", typeof(Int32))); T.Columns.Add(new DataColumn("idepexp", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idcsa_contract"], T.Columns["idcsa_contracttax"], T.Columns["ayear"] }; //////////////////// CSA_CONTRACTKINDRULES ///////////////////////////////// T = new DataTable("csa_contractkindrules"); C = new DataColumn("idcsa_contractkind", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idcsa_rule", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("capitoloCSA", typeof(String))); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("cu", typeof(String))); T.Columns.Add(new DataColumn("lt", typeof(DateTime))); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("ruoloCSA", typeof(String))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idcsa_contractkind"], T.Columns["idcsa_rule"], T.Columns["ayear"] }; //////////////////// CSA_CONTRACTKINDDATA ///////////////////////////////// T = new DataTable("csa_contractkinddata"); C = new DataColumn("idcsa_contractkind", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idcsa_contractkinddata", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("vocecsa", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idfin", typeof(Int32))); T.Columns.Add(new DataColumn("idacc", typeof(String))); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idupb", typeof(String))); T.Columns.Add(new DataColumn("idsor_siope", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idcsa_contractkind"], T.Columns["idcsa_contractkinddata"], T.Columns["ayear"] }; //////////////////// SORTING ///////////////////////////////// T = new DataTable("sorting"); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("defaultN1", typeof(Decimal))); T.Columns.Add(new DataColumn("defaultN2", typeof(Decimal))); T.Columns.Add(new DataColumn("defaultN3", typeof(Decimal))); T.Columns.Add(new DataColumn("defaultN4", typeof(Decimal))); T.Columns.Add(new DataColumn("defaultN5", typeof(Decimal))); T.Columns.Add(new DataColumn("defaultS1", typeof(String))); T.Columns.Add(new DataColumn("defaultS2", typeof(String))); T.Columns.Add(new DataColumn("defaultS3", typeof(String))); T.Columns.Add(new DataColumn("defaultS4", typeof(String))); T.Columns.Add(new DataColumn("defaultS5", typeof(String))); T.Columns.Add(new DataColumn("defaultv1", typeof(Decimal))); T.Columns.Add(new DataColumn("defaultv2", typeof(Decimal))); T.Columns.Add(new DataColumn("defaultv3", typeof(Decimal))); T.Columns.Add(new DataColumn("defaultv4", typeof(Decimal))); T.Columns.Add(new DataColumn("defaultv5", typeof(Decimal))); C = new DataColumn("description", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagnodate", typeof(String))); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("movkind", typeof(String))); T.Columns.Add(new DataColumn("printingorder", typeof(String))); T.Columns.Add(new DataColumn("rtf", typeof(Byte[]))); C = new DataColumn("sortcode", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("txt", typeof(String))); C = new DataColumn("idsorkind", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idsor", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridsor", typeof(Int32))); C = new DataColumn("nlevel", typeof(Byte)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("start", typeof(Int16))); T.Columns.Add(new DataColumn("stop", typeof(Int16))); T.Columns.Add(new DataColumn("email", typeof(String))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idsor"] }; #endregion #region DataRelation creation DataColumn [] CPar; DataColumn [] CChild; CPar = new DataColumn[2] { csa_contract.Columns["idcsa_contract"], csa_contract.Columns["ayear"] }; CChild = new DataColumn[2] { csa_contracttax.Columns["idcsa_contract"], csa_contracttax.Columns["ayear"] }; Relations.Add(new DataRelation("csa_contract_csa_contracttax", CPar, CChild, false)); CPar = new DataColumn[1] { csa_contractkind.Columns["idcsa_contractkind"] }; CChild = new DataColumn[1] { csa_contractkindyear.Columns["idcsa_contractkind"] }; Relations.Add(new DataRelation("csa_contractkind_csa_contractkindyear", CPar, CChild, false)); CPar = new DataColumn[1] { csa_contractkind.Columns["idcsa_contractkind"] }; CChild = new DataColumn[1] { csa_contract.Columns["idcsa_contractkind"] }; Relations.Add(new DataRelation("csa_contractkind_csa_contract", CPar, CChild, false)); CPar = new DataColumn[1] { csa_contractkind.Columns["idcsa_contractkind"] }; CChild = new DataColumn[1] { csa_contractkinddata.Columns["idcsa_contractkind"] }; Relations.Add(new DataRelation("csa_contractkind_csa_contractkinddata", CPar, CChild, false)); CPar = new DataColumn[1] { csa_contractkinddata.Columns["idsor_siope"] }; CChild = new DataColumn[1] { sorting.Columns["idsor"] }; Relations.Add(new DataRelation("csa_contractkinddata_sorting", CPar, CChild, false)); #endregion }
/// <summary> /// Checks if the type is a table. /// </summary> /// <param name="type">The table type.</param> /// <returns><see langword="true"/> if the type is a table, otherwise, <see langword="false"/>.</returns> public virtual bool IsTable(Type type) { return(Tables.ContainsKey(type.FullName)); }
private void InitClass() { DataSetName = "vistaForm"; Prefix = ""; Namespace = "http://tempuri.org/vistaForm.xsd"; EnforceConstraints = false; #region create DataTables DataTable T; DataColumn C; //////////////////// BANKDISPOSITIONSETUP ///////////////////////////////// T = new DataTable("bankdispositionsetup"); C = new DataColumn("ayear", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("kpaymenttransmission", typeof(Int32))); T.Columns.Add(new DataColumn("kproceedstransmission", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["ayear"] }; //////////////////// PAYMENTTRANSMISSION ///////////////////////////////// T = new DataTable("paymenttransmission"); C = new DataColumn("npaymenttransmission", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ypaymenttransmission", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("transmissiondate", typeof(DateTime))); T.Columns.Add(new DataColumn("idman", typeof(Int32))); T.Columns.Add(new DataColumn("idtreasurer", typeof(Int32))); C = new DataColumn("kpaymenttransmission", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagmailsent", typeof(String))); T.Columns.Add(new DataColumn("transmissionkind", typeof(String))); T.Columns.Add(new DataColumn("streamdate", typeof(DateTime))); T.Columns.Add(new DataColumn("flagtransmissionenabled", typeof(String))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["kpaymenttransmission"] }; //////////////////// PROCEEDSTRANSMISSION ///////////////////////////////// T = new DataTable("proceedstransmission"); C = new DataColumn("nproceedstransmission", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("yproceedstransmission", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("transmissiondate", typeof(DateTime))); T.Columns.Add(new DataColumn("idman", typeof(Int32))); T.Columns.Add(new DataColumn("idtreasurer", typeof(Int32))); C = new DataColumn("kproceedstransmission", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("transmissionkind", typeof(String))); T.Columns.Add(new DataColumn("streamdate", typeof(DateTime))); T.Columns.Add(new DataColumn("flagtransmissionenabled", typeof(String))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["kproceedstransmission"] }; //////////////////// XMLDOCS ///////////////////////////////// T = new DataTable("xmldocs"); C = new DataColumn("pk", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("xCol", typeof(String))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["pk"] }; #endregion #region DataRelation creation DataColumn [] CPar; DataColumn [] CChild; CPar = new DataColumn[1] { proceedstransmission.Columns["kproceedstransmission"] }; CChild = new DataColumn[1] { bankdispositionsetup.Columns["kproceedstransmission"] }; Relations.Add(new DataRelation("proceedstransmission_bankdispositionsetup", CPar, CChild, false)); CPar = new DataColumn[1] { paymenttransmission.Columns["kpaymenttransmission"] }; CChild = new DataColumn[1] { bankdispositionsetup.Columns["kpaymenttransmission"] }; Relations.Add(new DataRelation("paymenttransmission_bankdispositionsetup", CPar, CChild, false)); #endregion }
private void InitClass() { DataSetName = "vistaForm"; Prefix = ""; Namespace = "http://tempuri.org/vistaForm.xsd"; EnforceConstraints = false; #region create DataTables DataTable T; DataColumn C; //////////////////// INCOME ///////////////////////////////// T = new DataTable("income"); C = new DataColumn("adate", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("doc", typeof(String))); T.Columns.Add(new DataColumn("docdate", typeof(DateTime))); T.Columns.Add(new DataColumn("expiration", typeof(DateTime))); T.Columns.Add(new DataColumn("idreg", typeof(Int32))); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nmov", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("rtf", typeof(Byte[]))); T.Columns.Add(new DataColumn("txt", typeof(String))); C = new DataColumn("ymov", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idman", typeof(Int32))); C = new DataColumn("nphase", typeof(Byte)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idpayment", typeof(Int32))); C = new DataColumn("idinc", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("parentidinc", typeof(Int32))); T.Columns.Add(new DataColumn("autokind", typeof(Byte))); T.Columns.Add(new DataColumn("autocode", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idinc"] }; //////////////////// PETTYCASHOPERATION ///////////////////////////////// T = new DataTable("pettycashoperation"); C = new DataColumn("yoperation", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("noperation", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idpettycash", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("flag", typeof(Byte)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idfin", typeof(Int32))); T.Columns.Add(new DataColumn("idupb", typeof(String))); T.Columns.Add(new DataColumn("idman", typeof(Int32))); T.Columns.Add(new DataColumn("idexp", typeof(Int32))); T.Columns.Add(new DataColumn("yrestore", typeof(Int16))); T.Columns.Add(new DataColumn("nrestore", typeof(Int32))); C = new DataColumn("description", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("doc", typeof(String))); T.Columns.Add(new DataColumn("docdate", typeof(DateTime))); T.Columns.Add(new DataColumn("amount", typeof(Decimal))); C = new DataColumn("adate", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("txt", typeof(String))); T.Columns.Add(new DataColumn("rtf", typeof(Byte[]))); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idsor01", typeof(Int32))); T.Columns.Add(new DataColumn("idsor02", typeof(Int32))); T.Columns.Add(new DataColumn("idsor03", typeof(Int32))); T.Columns.Add(new DataColumn("idsor04", typeof(Int32))); T.Columns.Add(new DataColumn("idsor05", typeof(Int32))); T.Columns.Add(new DataColumn("idaccmotive_cost", typeof(String))); T.Columns.Add(new DataColumn("idaccmotive_debit", typeof(String))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["yoperation"], T.Columns["noperation"], T.Columns["idpettycash"] }; //////////////////// PETTYCASH ///////////////////////////////// T = new DataTable("pettycash"); C = new DataColumn("idpettycash", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("pettycode", typeof(String))); T.Columns.Add(new DataColumn("active", typeof(String))); C = new DataColumn("description", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idsor01", typeof(Int32))); T.Columns.Add(new DataColumn("idsor02", typeof(Int32))); T.Columns.Add(new DataColumn("idsor03", typeof(Int32))); T.Columns.Add(new DataColumn("idsor04", typeof(Int32))); T.Columns.Add(new DataColumn("idsor05", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idpettycash"] }; //////////////////// PETTYCASHSETUP ///////////////////////////////// T = new DataTable("pettycashsetup"); C = new DataColumn("idpettycash", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("registrymanager", typeof(Int32))); T.Columns.Add(new DataColumn("idfinincome", typeof(Int32))); T.Columns.Add(new DataColumn("idfinexpense", typeof(Int32))); T.Columns.Add(new DataColumn("amount", typeof(Decimal))); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flag", typeof(Int32))); T.Columns.Add(new DataColumn("idupb", typeof(String))); T.Columns.Add(new DataColumn("autoclassify", typeof(String))); T.Columns.Add(new DataColumn("idsor_siopeexp", typeof(Int32))); T.Columns.Add(new DataColumn("idsor_siopeinc", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idpettycash"], T.Columns["ayear"] }; //////////////////// PETTYCASHINCOME ///////////////////////////////// T = new DataTable("pettycashincome"); C = new DataColumn("yoperation", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("noperation", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idpettycash", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idinc", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["yoperation"], T.Columns["noperation"], T.Columns["idpettycash"], T.Columns["idinc"] }; //////////////////// INCOMEYEAR ///////////////////////////////// T = new DataTable("incomeyear"); C = new DataColumn("idinc", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idfin", typeof(Int32))); T.Columns.Add(new DataColumn("idupb", typeof(String))); T.Columns.Add(new DataColumn("amount", typeof(Decimal))); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idinc"], T.Columns["ayear"] }; //////////////////// FIN ///////////////////////////////// T = new DataTable("fin"); C = new DataColumn("idfin", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codefin", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idfin"] }; //////////////////// REGISTRY ///////////////////////////////// T = new DataTable("registry"); C = new DataColumn("idreg", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("title", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idreg"] }; //////////////////// INCOMEPHASE ///////////////////////////////// T = new DataTable("incomephase"); C = new DataColumn("nphase", typeof(Byte)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["nphase"] }; //////////////////// PROCEEDS ///////////////////////////////// T = new DataTable("proceeds"); C = new DataColumn("ypro", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("npro", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idtreasurer", typeof(Int32))); T.Columns.Add(new DataColumn("idreg", typeof(Int32))); T.Columns.Add(new DataColumn("idfin", typeof(Int32))); T.Columns.Add(new DataColumn("idman", typeof(Int32))); C = new DataColumn("adate", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("printdate", typeof(DateTime))); T.Columns.Add(new DataColumn("txt", typeof(String))); T.Columns.Add(new DataColumn("rtf", typeof(Byte[]))); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("ct", typeof(DateTime))); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("annulmentdate", typeof(DateTime))); C = new DataColumn("kpro", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idstamphandling", typeof(Int32))); T.Columns.Add(new DataColumn("idsor01", typeof(Int32))); T.Columns.Add(new DataColumn("idsor02", typeof(Int32))); T.Columns.Add(new DataColumn("idsor03", typeof(Int32))); T.Columns.Add(new DataColumn("idsor04", typeof(Int32))); T.Columns.Add(new DataColumn("idsor05", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["kpro"] }; //////////////////// UPB ///////////////////////////////// T = new DataTable("upb"); C = new DataColumn("idupb", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codeupb", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idupb"] }; //////////////////// INCOMESORTED ///////////////////////////////// T = new DataTable("incomesorted"); C = new DataColumn("idsor", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idinc", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idsubclass", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("amount", typeof(Decimal))); T.Columns.Add(new DataColumn("ayear", typeof(Int16))); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("description", typeof(String))); T.Columns.Add(new DataColumn("flagnodate", typeof(String))); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridsor", typeof(Int32))); T.Columns.Add(new DataColumn("paridsubclass", typeof(Int16))); T.Columns.Add(new DataColumn("rtf", typeof(Byte[]))); T.Columns.Add(new DataColumn("start", typeof(DateTime))); T.Columns.Add(new DataColumn("stop", typeof(DateTime))); T.Columns.Add(new DataColumn("tobecontinued", typeof(String))); T.Columns.Add(new DataColumn("txt", typeof(String))); T.Columns.Add(new DataColumn("valuen1", typeof(Decimal))); T.Columns.Add(new DataColumn("valuen2", typeof(Decimal))); T.Columns.Add(new DataColumn("valuen3", typeof(Decimal))); T.Columns.Add(new DataColumn("valuen4", typeof(Decimal))); T.Columns.Add(new DataColumn("valuen5", typeof(Decimal))); T.Columns.Add(new DataColumn("values1", typeof(String))); T.Columns.Add(new DataColumn("values2", typeof(String))); T.Columns.Add(new DataColumn("values3", typeof(String))); T.Columns.Add(new DataColumn("values4", typeof(String))); T.Columns.Add(new DataColumn("values5", typeof(String))); T.Columns.Add(new DataColumn("valuev1", typeof(Decimal))); T.Columns.Add(new DataColumn("valuev2", typeof(Decimal))); T.Columns.Add(new DataColumn("valuev3", typeof(Decimal))); T.Columns.Add(new DataColumn("valuev4", typeof(Decimal))); T.Columns.Add(new DataColumn("valuev5", typeof(Decimal))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idinc"], T.Columns["idsor"], T.Columns["idsubclass"] }; //////////////////// SORTINGKIND ///////////////////////////////// T = new DataTable("sortingkind"); C = new DataColumn("idsorkind", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("active", typeof(String))); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("description", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagdate", typeof(String))); T.Columns.Add(new DataColumn("forcedN1", typeof(String))); T.Columns.Add(new DataColumn("forcedN2", typeof(String))); T.Columns.Add(new DataColumn("forcedN3", typeof(String))); T.Columns.Add(new DataColumn("forcedN4", typeof(String))); T.Columns.Add(new DataColumn("forcedN5", typeof(String))); T.Columns.Add(new DataColumn("forcedS1", typeof(String))); T.Columns.Add(new DataColumn("forcedS2", typeof(String))); T.Columns.Add(new DataColumn("forcedS3", typeof(String))); T.Columns.Add(new DataColumn("forcedS4", typeof(String))); T.Columns.Add(new DataColumn("forcedS5", typeof(String))); T.Columns.Add(new DataColumn("forcedv1", typeof(String))); T.Columns.Add(new DataColumn("forcedv2", typeof(String))); T.Columns.Add(new DataColumn("forcedv3", typeof(String))); T.Columns.Add(new DataColumn("forcedv4", typeof(String))); T.Columns.Add(new DataColumn("forcedv5", typeof(String))); T.Columns.Add(new DataColumn("labelfordate", typeof(String))); T.Columns.Add(new DataColumn("labeln1", typeof(String))); T.Columns.Add(new DataColumn("labeln2", typeof(String))); T.Columns.Add(new DataColumn("labeln3", typeof(String))); T.Columns.Add(new DataColumn("labeln4", typeof(String))); T.Columns.Add(new DataColumn("labeln5", typeof(String))); T.Columns.Add(new DataColumn("labels1", typeof(String))); T.Columns.Add(new DataColumn("labels2", typeof(String))); T.Columns.Add(new DataColumn("labels3", typeof(String))); T.Columns.Add(new DataColumn("labels4", typeof(String))); T.Columns.Add(new DataColumn("labels5", typeof(String))); T.Columns.Add(new DataColumn("labelv1", typeof(String))); T.Columns.Add(new DataColumn("labelv2", typeof(String))); T.Columns.Add(new DataColumn("labelv3", typeof(String))); T.Columns.Add(new DataColumn("labelv4", typeof(String))); T.Columns.Add(new DataColumn("labelv5", typeof(String))); T.Columns.Add(new DataColumn("lockedN1", typeof(String))); T.Columns.Add(new DataColumn("lockedN2", typeof(String))); T.Columns.Add(new DataColumn("lockedN3", typeof(String))); T.Columns.Add(new DataColumn("lockedN4", typeof(String))); T.Columns.Add(new DataColumn("lockedN5", typeof(String))); T.Columns.Add(new DataColumn("lockedS1", typeof(String))); T.Columns.Add(new DataColumn("lockedS2", typeof(String))); T.Columns.Add(new DataColumn("lockedS3", typeof(String))); T.Columns.Add(new DataColumn("lockedS4", typeof(String))); T.Columns.Add(new DataColumn("lockedS5", typeof(String))); T.Columns.Add(new DataColumn("lockedv1", typeof(String))); T.Columns.Add(new DataColumn("lockedv2", typeof(String))); T.Columns.Add(new DataColumn("lockedv3", typeof(String))); T.Columns.Add(new DataColumn("lockedv4", typeof(String))); T.Columns.Add(new DataColumn("lockedv5", typeof(String))); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("nodatelabel", typeof(String))); T.Columns.Add(new DataColumn("nphaseexpense", typeof(Byte))); T.Columns.Add(new DataColumn("nphaseincome", typeof(Byte))); T.Columns.Add(new DataColumn("totalexpression", typeof(String))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idsorkind"] }; //////////////////// INCOMEVIEW ///////////////////////////////// T = new DataTable("incomeview"); C = new DataColumn("idinc", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("!livprecedente", typeof(String))); T.Columns.Add(new DataColumn("nphase", typeof(Byte))); C = new DataColumn("phase", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ymov", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nmov", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idsor01", typeof(Int32))); T.Columns.Add(new DataColumn("idsor02", typeof(Int32))); T.Columns.Add(new DataColumn("idsor03", typeof(Int32))); T.Columns.Add(new DataColumn("idsor04", typeof(Int32))); T.Columns.Add(new DataColumn("idsor05", typeof(Int32))); T.Columns.Add(new DataColumn("parentymov", typeof(Int16))); T.Columns.Add(new DataColumn("parentnmov", typeof(Int32))); T.Columns.Add(new DataColumn("parentidinc", typeof(Int32))); C = new DataColumn("ayear", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idfin", typeof(Int32))); T.Columns.Add(new DataColumn("codefin", typeof(String))); T.Columns.Add(new DataColumn("finance", typeof(String))); T.Columns.Add(new DataColumn("idupb", typeof(String))); T.Columns.Add(new DataColumn("codeupb", typeof(String))); T.Columns.Add(new DataColumn("upb", typeof(String))); T.Columns.Add(new DataColumn("idreg", typeof(Int32))); T.Columns.Add(new DataColumn("registry", typeof(String))); T.Columns.Add(new DataColumn("idman", typeof(Int32))); T.Columns.Add(new DataColumn("manager", typeof(String))); T.Columns.Add(new DataColumn("ypro", typeof(Int16))); T.Columns.Add(new DataColumn("npro", typeof(Int32))); T.Columns.Add(new DataColumn("doc", typeof(String))); T.Columns.Add(new DataColumn("docdate", typeof(DateTime))); C = new DataColumn("description", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("amount", typeof(Decimal))); T.Columns.Add(new DataColumn("ayearstartamount", typeof(Decimal))); T.Columns.Add(new DataColumn("curramount", typeof(Decimal))); T.Columns.Add(new DataColumn("available", typeof(Decimal))); T.Columns.Add(new DataColumn("unpartitioned", typeof(Decimal))); T.Columns.Add(new DataColumn("flag", typeof(Byte))); C = new DataColumn("totflag", typeof(Byte)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagarrear", typeof(String))); T.Columns.Add(new DataColumn("autokind", typeof(Byte))); T.Columns.Add(new DataColumn("autocode", typeof(Int32))); T.Columns.Add(new DataColumn("idpayment", typeof(Int32))); T.Columns.Add(new DataColumn("expiration", typeof(DateTime))); C = new DataColumn("adate", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("nbill", typeof(Int32))); T.Columns.Add(new DataColumn("idpro", typeof(Int32))); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); //////////////////// INCOMELAST ///////////////////////////////// T = new DataTable("incomelast"); C = new DataColumn("idinc", typeof(Int32)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("flag", typeof(Byte)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idpro", typeof(Int32))); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("nbill", typeof(Int32))); T.Columns.Add(new DataColumn("kpro", typeof(Int32))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["idinc"] }; //////////////////// CONFIG ///////////////////////////////// T = new DataTable("config"); C = new DataColumn("ayear", typeof(Int16)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("agencycode", typeof(String))); T.Columns.Add(new DataColumn("appname", typeof(String))); T.Columns.Add(new DataColumn("appropriationphasecode", typeof(Byte))); T.Columns.Add(new DataColumn("assessmentphasecode", typeof(Byte))); T.Columns.Add(new DataColumn("asset_flagnumbering", typeof(String))); T.Columns.Add(new DataColumn("asset_flagrestart", typeof(String))); T.Columns.Add(new DataColumn("assetload_flag", typeof(Byte))); T.Columns.Add(new DataColumn("boxpartitiontitle", typeof(String))); T.Columns.Add(new DataColumn("cashvaliditykind", typeof(Byte))); T.Columns.Add(new DataColumn("casualcontract_flagrestart", typeof(String))); C = new DataColumn("ct", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("currpartitiontitle", typeof(String))); T.Columns.Add(new DataColumn("deferredexpensephase", typeof(String))); T.Columns.Add(new DataColumn("deferredincomephase", typeof(String))); T.Columns.Add(new DataColumn("electronicimport", typeof(String))); T.Columns.Add(new DataColumn("electronictrasmission", typeof(String))); T.Columns.Add(new DataColumn("expense_expiringdays", typeof(Int16))); T.Columns.Add(new DataColumn("expensephase", typeof(Byte))); T.Columns.Add(new DataColumn("flagautopayment", typeof(String))); T.Columns.Add(new DataColumn("flagautoproceeds", typeof(String))); T.Columns.Add(new DataColumn("flagcredit", typeof(String))); T.Columns.Add(new DataColumn("flagepexp", typeof(String))); T.Columns.Add(new DataColumn("flagfruitful", typeof(String))); T.Columns.Add(new DataColumn("flagpayment", typeof(String))); T.Columns.Add(new DataColumn("flagproceeds", typeof(String))); T.Columns.Add(new DataColumn("flagrefund", typeof(String))); T.Columns.Add(new DataColumn("foreignhours", typeof(Int32))); T.Columns.Add(new DataColumn("idacc_accruedcost", typeof(String))); T.Columns.Add(new DataColumn("idacc_accruedrevenue", typeof(String))); T.Columns.Add(new DataColumn("idacc_customer", typeof(String))); T.Columns.Add(new DataColumn("idacc_deferredcost", typeof(String))); T.Columns.Add(new DataColumn("idacc_deferredcredit", typeof(String))); T.Columns.Add(new DataColumn("idacc_deferreddebit", typeof(String))); T.Columns.Add(new DataColumn("idacc_deferredrevenue", typeof(String))); T.Columns.Add(new DataColumn("idacc_ivapayment", typeof(String))); T.Columns.Add(new DataColumn("idacc_ivarefund", typeof(String))); T.Columns.Add(new DataColumn("idacc_patrimony", typeof(String))); T.Columns.Add(new DataColumn("idacc_pl", typeof(String))); T.Columns.Add(new DataColumn("idacc_supplier", typeof(String))); T.Columns.Add(new DataColumn("idaccmotive_admincar", typeof(String))); T.Columns.Add(new DataColumn("idaccmotive_foot", typeof(String))); T.Columns.Add(new DataColumn("idaccmotive_owncar", typeof(String))); T.Columns.Add(new DataColumn("idclawback", typeof(Int32))); T.Columns.Add(new DataColumn("idfinexpense", typeof(Int32))); T.Columns.Add(new DataColumn("idfinexpensesurplus", typeof(Int32))); T.Columns.Add(new DataColumn("idfinincomesurplus", typeof(Int32))); T.Columns.Add(new DataColumn("idfinivapayment", typeof(Int32))); T.Columns.Add(new DataColumn("idfinivarefund", typeof(Int32))); T.Columns.Add(new DataColumn("idivapayperiodicity", typeof(Int32))); T.Columns.Add(new DataColumn("idregauto", typeof(Int32))); T.Columns.Add(new DataColumn("idsortingkind1", typeof(Int32))); T.Columns.Add(new DataColumn("idsortingkind2", typeof(Int32))); T.Columns.Add(new DataColumn("idsortingkind3", typeof(Int32))); T.Columns.Add(new DataColumn("importappname", typeof(String))); T.Columns.Add(new DataColumn("income_expiringdays", typeof(Int16))); T.Columns.Add(new DataColumn("incomephase", typeof(Byte))); T.Columns.Add(new DataColumn("linktoinvoice", typeof(String))); C = new DataColumn("lt", typeof(DateTime)); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(String)); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("minpayment", typeof(Decimal))); T.Columns.Add(new DataColumn("minrefund", typeof(Decimal))); T.Columns.Add(new DataColumn("motivelen", typeof(Int16))); T.Columns.Add(new DataColumn("motiveprefix", typeof(String))); T.Columns.Add(new DataColumn("motiveseparator", typeof(String))); T.Columns.Add(new DataColumn("payment_finlevel", typeof(Byte))); T.Columns.Add(new DataColumn("payment_flag", typeof(Byte))); T.Columns.Add(new DataColumn("payment_flagautoprintdate", typeof(String))); T.Columns.Add(new DataColumn("paymentagency", typeof(Int32))); T.Columns.Add(new DataColumn("prevpartitiontitle", typeof(String))); T.Columns.Add(new DataColumn("proceeds_finlevel", typeof(Byte))); T.Columns.Add(new DataColumn("proceeds_flag", typeof(Byte))); T.Columns.Add(new DataColumn("proceeds_flagautoprintdate", typeof(String))); T.Columns.Add(new DataColumn("profservice_flagrestart", typeof(String))); T.Columns.Add(new DataColumn("refundagency", typeof(Int32))); T.Columns.Add(new DataColumn("wageaddition_flagrestart", typeof(String))); T.Columns.Add(new DataColumn("flagpcashautopayment", typeof(String))); T.Columns.Add(new DataColumn("flagpcashautoproceeds", typeof(String))); Tables.Add(T); T.PrimaryKey = new DataColumn[] { T.Columns["ayear"] }; #endregion #region DataRelation creation DataColumn [] CPar; DataColumn [] CChild; CPar = new DataColumn[1] { income.Columns["idinc"] }; CChild = new DataColumn[1] { incomelast.Columns["idinc"] }; Relations.Add(new DataRelation("income_incomelast", CPar, CChild, false)); CPar = new DataColumn[1] { proceeds.Columns["kpro"] }; CChild = new DataColumn[1] { incomelast.Columns["kpro"] }; Relations.Add(new DataRelation("proceeds_incomelast", CPar, CChild, false)); CPar = new DataColumn[1] { income.Columns["idinc"] }; CChild = new DataColumn[1] { incomesorted.Columns["idinc"] }; Relations.Add(new DataRelation("income_incomesorted", CPar, CChild, false)); CPar = new DataColumn[1] { fin.Columns["idfin"] }; CChild = new DataColumn[1] { incomeyear.Columns["idfin"] }; Relations.Add(new DataRelation("finincomeyear", CPar, CChild, false)); CPar = new DataColumn[1] { income.Columns["idinc"] }; CChild = new DataColumn[1] { incomeyear.Columns["idinc"] }; Relations.Add(new DataRelation("incomeincomeyear", CPar, CChild, false)); CPar = new DataColumn[1] { upb.Columns["idupb"] }; CChild = new DataColumn[1] { incomeyear.Columns["idupb"] }; Relations.Add(new DataRelation("upbincomeyear", CPar, CChild, false)); CPar = new DataColumn[1] { income.Columns["idinc"] }; CChild = new DataColumn[1] { pettycashincome.Columns["idinc"] }; Relations.Add(new DataRelation("incomepettycashincome", CPar, CChild, false)); CPar = new DataColumn[3] { pettycashoperation.Columns["yoperation"], pettycashoperation.Columns["noperation"], pettycashoperation.Columns["idpettycash"] }; CChild = new DataColumn[3] { pettycashincome.Columns["yoperation"], pettycashincome.Columns["noperation"], pettycashincome.Columns["idpettycash"] }; Relations.Add(new DataRelation("pettycashoperationpettycashincome", CPar, CChild, false)); CPar = new DataColumn[1] { pettycash.Columns["idpettycash"] }; CChild = new DataColumn[1] { pettycashoperation.Columns["idpettycash"] }; Relations.Add(new DataRelation("pettycashpettycashoperation", CPar, CChild, false)); CPar = new DataColumn[1] { upb.Columns["idupb"] }; CChild = new DataColumn[1] { pettycashoperation.Columns["idupb"] }; Relations.Add(new DataRelation("upbpettycashoperation", CPar, CChild, false)); CPar = new DataColumn[1] { incomephase.Columns["nphase"] }; CChild = new DataColumn[1] { income.Columns["nphase"] }; Relations.Add(new DataRelation("incomephaseincome", CPar, CChild, false)); CPar = new DataColumn[1] { registry.Columns["idreg"] }; CChild = new DataColumn[1] { income.Columns["idreg"] }; Relations.Add(new DataRelation("registryincome", CPar, CChild, false)); CPar = new DataColumn[1] { income.Columns["idinc"] }; CChild = new DataColumn[1] { income.Columns["parentidinc"] }; Relations.Add(new DataRelation("incomeincome", CPar, CChild, false)); #endregion }
public virtual IAsyncEnumerable <IRelationalDatabaseTable> GetAllTables(CancellationToken cancellationToken = default) => Tables.ToAsyncEnumerable();
public Table FindTable(string tableName, string tableSchemaName = null) => Tables .Where(t => tableSchemaName == null || t.Schema.Name == tableSchemaName) .Single(t => t.Name == tableName);
private void InitClass() { this.DataSetName = "vistaForm"; this.Prefix = ""; this.Namespace = "http://tempuri.org/vistaForm.xsd"; this.EnforceConstraints = false; DataTable T; DataColumn C; DataColumn [] key; T = new DataTable("accmotivedetail"); C = new DataColumn("idaccmotive", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("idacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); Tables.Add(T); //Primary Key key = new DataColumn[2] { T.Columns["idaccmotive"], T.Columns["idacc"] }; T.PrimaryKey = key; T = new DataTable("account"); C = new DataColumn("idacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ayear", typeof(System.Int16), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("codeacc", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("paridacc", typeof(System.String), "")); C = new DataColumn("printingorder", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("title", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("flagtransitory", typeof(System.String), "")); T.Columns.Add(new DataColumn("txt", typeof(System.String), "")); T.Columns.Add(new DataColumn("rtf", typeof(System.Byte[]), "")); C = new DataColumn("cu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("ct", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lu", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("lt", typeof(System.DateTime), ""); C.AllowDBNull = false; T.Columns.Add(C); C = new DataColumn("nlevel", typeof(System.String), ""); C.AllowDBNull = false; T.Columns.Add(C); T.Columns.Add(new DataColumn("idaccountkind", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagregistry", typeof(System.String), "")); T.Columns.Add(new DataColumn("flagupb", typeof(System.String), "")); Tables.Add(T); //Primary Key key = new DataColumn[1] { T.Columns["idacc"] }; T.PrimaryKey = key; //Relations DataTable TPar; DataTable TChild; DataColumn [] CPar; DataColumn [] CChild; TPar = Tables["account"]; TChild = Tables["accmotivedetail"]; CPar = new DataColumn[1] { TPar.Columns["idacc"] }; CChild = new DataColumn[1] { TChild.Columns["idacc"] }; Relations.Add(new DataRelation("accountaccmotivedetail", CPar, CChild)); }
/// <inheritdoc/> public void AddChild(Base child) { Tables.Add(child as TableDataSource); }