private void ReadSchema() { if (!DoneSchema) { using (var api = new EntityApi(_Name)) { Formater = api.Formater; TableSchemas = api.Builder.TableSchemas; ViewSchemas = api.Builder.ViewSchemas; PackageSchemas = api.Builder.PackageSchemas; } DoneSchema = true; } if (InvokeRequired) { Invoke( new MethodInvoker(ReadSchema) ); } else { try { foreach (var one in TableSchemas) { if (Skip(one.TableName)) { continue; } lbxTables.Items.Add(one.TableName); } foreach (var one in ViewSchemas) { if (Skip(one.ViewName)) { continue; } lbxTables.Items.Add(one.ViewName); } foreach (var one in PackageSchemas) { if (Skip(one.PackageName)) { continue; } lbxPackages.Items.Add(one.PackageName); } } catch (Exception ex) { MessageBox.Show( ex.Message, frmMain._Name, MessageBoxButtons.OK, MessageBoxIcon.Error ); } finally { this.BackColor = SystemColors.Control; } } }
public string ToOutFormatMethod(ISqlFormater formater) { var count = Outs.IsNullOrEmpty() ? 0 : Outs.Count(); switch (count) { case 0: return(string.Empty); case 1: return(string.Concat( ".To", Outs .FirstOrDefault() .ToTypeName(formater) .ToPascalCasing(), "()" )); default: return(".ToDynamics()"); } }
public string ToMethodArgument(ISqlFormater formater) { return(string.Concat( ToTypeName(formater), " ", ArgumentName )); }
public string ToTypeName(ISqlFormater formater) { var ef = EnumCache.Get<DataFormat>(); var format = formater.ToDataFormat(DataType); var ei = ef.Get(format.ToStringX()); var type = ei.Description; return type; }
public string ToMethodArgument(ISqlFormater formater) { return string.Concat( ToTypeName(formater), " ", ArgumentName ); }
/// <summary> /// ctor /// </summary> public SqlBuilder(DatabaseType databaseType) { _TableAlias = new List <string> { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" }; _QueueTableAlias = new Queue <string>(_TableAlias); _DatabaseType = databaseType; _SqlFormater = FormaterFactory.SqlFormater(_DatabaseType); }
public string ToTypeName(ISqlFormater formater) { var ef = EnumCache.Get <DataFormat>(); var format = formater.ToDataFormat(DataType); var ei = ef.Get(format.ToStringX()); var type = ei.Description; return(type); }
public string ToOutType(ISqlFormater formater) { var count = Outs.IsNullOrEmpty() ? 0 : Outs.Count(); switch (count) { case 0: return("DataResult"); case 1: return(Outs.FirstOrDefault().ToTypeName(formater)); default: return("List<dynamic>[]"); } }