Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
        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;
            }
        }
Esempio n. 3
0
 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();
 }
Esempio n. 4
0
 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();
 }