internal void Reset(List <SqlType> sqlTypes) { this.Children.Clear(); var orderSqls = sqlTypes.OrderBy(x => x.Name).ToList(); foreach (SqlType sqlType in orderSqls) { SqlNode sqlNode = new SqlNode(); sqlNode.ConnectionString = this.ConnectionString; sqlNode.DataInfo = sqlType; sqlNode.Parent = this; } }
internal void Reset(List<SqlType> sqlTypes) { this.Children.Clear(); var orderSqls = sqlTypes.OrderBy(x => x.Name).ToList(); foreach (SqlType sqlType in orderSqls) { SqlNode sqlNode = new SqlNode(); sqlNode.ConnectionString = this.ConnectionString; sqlNode.DataInfo = sqlType; sqlNode.Parent = this; } }
void frm_Save(SqlType sql, ref int hashcode) { foreach (var child in this.Children) { if (child.Name == sql.Name) { if (hashcode != child.GetHashCode()) { MessageBox.Show("名称不能重复"); return; } } } if (hashcode == 0) { SqlNode sqlNode = new SqlNode(); sqlNode.ConnectionString = this.ConnectionString; sqlNode.DataInfo = sql; sqlNode.Parent = this; hashcode = sqlNode.GetHashCode(); } DBGlobalService.Save(); }
void frm_Save(SqlType sql, ref int hashcode) { foreach (var child in this.Children) { if (child.Name == sql.Name) { if (hashcode != child.GetHashCode()) { MessageBox.Show("名称不能重复"); return; } } } if (hashcode == 0) { SqlNode sqlNode = new SqlNode(); sqlNode.ConnectionString = DBGlobalService.ConnectionString; sqlNode.DataInfo = sql; sqlNode.Parent = this; this.dataInfo.Sqls.AddChild(sql); hashcode = sqlNode.GetHashCode(); } DBGlobalService.Save(); }