protected void btnAdd_Click(object sender, EventArgs e) { field s = new field(); s.description = DropDownList2.SelectedItem.Text; List<Stationary_Catalogue> Codelist = empCtrl.getItemCode(s.description); ItemCode = Codelist.First().Item_Code.ToString(); s.itemCode = ItemCode; s.quantity = txtQuantity.Text; data1.Add(s); itemDetailsGrid.DataSource = data1; itemDetailsGrid.DataBind(); }
// funciones llamadas por los user control private void alterField(string oldNameTable, string oldNameField, object campito) { field cp = new field(); cp = (field)campito; // if oldName its empty its a new field.. if (oldNameField.Equals("")) { foreach (table item in actualProject.tables) { if (item.Name.Equals(oldNameTable)) { item.fields.Add(campito); } } } else { foreach (table item in actualProject.tables) { if (item.Name.Equals(oldNameTable)) { foreach (field itemf in item.fields) { if (itemf.Name.Equals(oldNameTable)) { itemf.Name = cp.Name; itemf.nameChanged = true; } } } } } kp1.Controls.Clear(); actualProject.saveProject(Path.Combine(util.projects_dir, actualProject.name) + ".xml"); cargarCampos(); }
public void Set(field id, byte value) { Set(id.index, value); }
public UInt16 GetWord(field id, int index) { return GetWord(id.index + index * 2); }
public UInt16 GetWord(field id) { return GetWord(id.index); }
public byte GetByte(field id, int index) { return GetByte(id.index + index); }
public Field(int i, int j, field f) { x = i; y = j; content = f; }
public void Fill(field id, UInt16 value) { for (int i = id.index; i < id.index + id.arrayLen * 2; i += 2) Set(i, value); }
public void Set(field id, UInt16 value, int index) { Set(id.index + index * 2, value); }
public List<field> getFields(string cadconexion, string database, string table) { MySqlConnection conexion = null; try { // ' ESTO SERIA PARA LA TABLA COMMENTS //' PARA SACARLO CON SQL... // SELECT *, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS where table_name = 'cars' List<field> lista = new List<field>(); // Retrieve a list of primary keys for a table. //List<String> primaryKeys = getKeys(cadconexion, table); conexion = new MySqlConnection(cadconexion); miComando = new MySqlCommand(""); miComando.Connection = conexion; conexion.ConnectionString = cadconexion; conexion.Open(); System.Data.DataTable dt = new System.Data.DataTable(); dt = conexion.GetSchema("Columns", new String[] { null, database, table, null }); foreach (System.Data.DataRow row in dt.Rows) { field fi = new field(); fi.Name = row[3].ToString(); fi.targetName = row[3].ToString(); string tipo = null; tipo = row[7].ToString(); switch (tipo) { case "text": fi.type = field.fieldType._text; break; case "mediumtext": fi.type = field.fieldType._text; break; case "char": fi.type = field.fieldType._string; break; case "nchar": fi.type = field.fieldType._string; break; case "varchar": fi.type = field.fieldType._string; break; case "nvarchar": fi.type = field.fieldType._string; break; case "binary": fi.type = field.fieldType._string; break; case "varbinary": fi.type = field.fieldType._string; break; case "mediumint": fi.type = field.fieldType._integer; break; case "smallint": fi.type = field.fieldType._integer; break; case "int": fi.type = field.fieldType._integer; break; case "numeric": fi.type = field.fieldType._integer; break; case "tinyint": fi.type = field.fieldType._boolean; break; case "boolean": fi.type = field.fieldType._boolean; break; case "bool": fi.type = field.fieldType._boolean; break; case "bit": fi.type = field.fieldType._boolean; break; case "bigint": fi.type = field.fieldType._double; break; case "double": fi.type = field.fieldType._double; break; case "float": fi.type = field.fieldType._double; break; case "smalldatetime": fi.type = field.fieldType._date; break; case "datetime": fi.type = field.fieldType._date; break; case "date": fi.type = field.fieldType._date; break; case "timestamp": fi.type = field.fieldType._date; break; default: fi.type = field.fieldType._string; break; } fi.targetType = fi.type; fi.allowNulls = sf.boolean(row["IS_NULLABLE"]); fi.size = sf.entero(row["CHARACTER_MAXIMUM_LENGTH"]); // if the size is > 250 and type is string.... if (fi.size >= 250) { switch (tipo) { case "mediumtext": fi.type = field.fieldType._text; fi.targetType = field.fieldType._text; break; case "char": fi.type = field.fieldType._text; fi.targetType = field.fieldType._text; break; case "nchar": fi.type = field.fieldType._text; fi.targetType = field.fieldType._text; break; case "varchar": fi.type = field.fieldType._text; fi.targetType = field.fieldType._text; break; case "nvarchar": fi.type = field.fieldType._text; fi.targetType = field.fieldType._text; break; } } // fi.comment = sf.Cadena(tbl.Rows(i)!COLUMN_COMMENT); fi.defaultValue = sf.cadena(row["COLUMN_DEFAULT"]); //try //{ // if (primaryKeys.Contains(fi.Name)) // { // fi.isKey = true; // // fi.autoNumber = true; // } //} //catch (Exception) //{ //} //fi.autoNumber = sf.boolean(row["COLUMN_KEY"]); // fi.isKey = sf.boolean(row["COLUMN_KEY"]); fi.decimals = sf.entero(row["NUMERIC_PRECISION"]); // // Retrieve the column's default value. // fi.defaultValue = ((row["COLUMN_DEFAULT"] as DBNull) // != null) ? "Null" : row["COLUMN_DEFAULT"].ToString(); // // Retrieve the column's precision. // //column.Precision = ((row["NUMERIC_PRECISION"] as DBNull) // // != null) ? 0 : Int32.Parse(row["NUMERIC_PRECISION"].ToString()); // // Retrieve the column's scale. //// column.Scale = ((row["NUMERIC_SCALE"] as DBNull) != null) ? 0 : Int32.Parse(row["NUMERIC_SCALE"].ToString()); // // Specify if the column is a primary key. // fi.isKey = primaryKeys.Contains(row["COLUMN_NAME"].ToString()); // // Specify that the column is not an identity column. // //column.IsIdentity = false; // // Retrieve the column length. // fi.size = ((OleDbType)Int32.Parse(row["DATA_TYPE"].ToString()) != OleDbType.WChar) ? -1 : Int32.Parse(row["CHARACTER_MAXIMUM_LENGTH"].ToString()); // // Append the column to the list. //fi.size = sf.Entero(tbl.Rows(i)!CHARACTER_MAXIMUM_LENGTH) // fi.comment = sf.Cadena(tbl.Rows(i)!COLUMN_COMMENT) //fi.allowNulls = sf.boolean(row["IS_NULLABLE"]);//tbl.Rows(i)!IS_NULLABLE) // fi.defaultValue = sf.Cadena(tbl.Rows(i)!COLUMN_DEFAULT) // fi.autoNumber = sf.boolean(tbl.Rows(i)!COLUMN_KEY) // fi.decimals = sf.Entero(tbl.Rows(i)!NUMERIC_PRECISION) lista.Add(fi); } return lista; } catch (Exception ep) { // lo.tratarError(ep, "Error en dbClass.new", ""); return null; } finally { conexion.Close(); } }
private field _produceField(string key) { uint pos = (uint)(key.GetHashCode()) % MAX_FIELDS; field f = (field)fields[pos]; while (f != null) { if (f.key == key) return f; f = f.next; } f = new field(key); f.next = (field)fields[pos]; fields[pos] = f; return f; }
public fieldNode(field fieldx) { campito = fieldx; this.Text = fieldx.Name; }
/// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.
public List<field> getFields(string cadconexion, string table) { SqlConnection conexion = null; try { List<field> lista = new List<field>(); conexion = new SqlConnection(cadconexion); miComando = new SqlCommand(""); miComando.Connection = conexion; conexion.ConnectionString = cadconexion; conexion.Open(); System.Data.DataTable dt = new System.Data.DataTable(); dt = conexion.GetSchema(SqlClientMetaDataCollectionNames.Columns, new String[] { null, null, table, null }); foreach (System.Data.DataRow row in dt.Rows) { field fi = new field(); fi.Name = row[3].ToString(); fi.targetName = row[3].ToString(); string tipo = null; tipo = row[7].ToString(); switch (tipo) { case "text": fi.type = field.fieldType._text; break; case "char": if (fi.size > 155) fi.type = field.fieldType._text; else fi.type = field.fieldType._string; break; case "nchar": if (fi.size > 155) fi.type = field.fieldType._text; else fi.type = field.fieldType._string; break; case "varchar": if (fi.size > 155) fi.type = field.fieldType._text; else fi.type = field.fieldType._string; break; case "nvarchar": if (fi.size > 155) fi.type = field.fieldType._text; else fi.type = field.fieldType._string; break; case "binary": fi.type = field.fieldType._string; break; case "varbinary": fi.type = field.fieldType._string; break; case "mediumint": fi.type = field.fieldType._integer; break; case "smallint": fi.type = field.fieldType._integer; break; case "int": fi.type = field.fieldType._integer; break; case "numeric": fi.type = field.fieldType._integer; break; case "tinyint": fi.type = field.fieldType._boolean; break; case "bit": fi.type = field.fieldType._boolean; break; case "bigint": fi.type = field.fieldType._double; break; case "float": fi.type = field.fieldType._double; break; case "smalldatetime": fi.type = field.fieldType._date; break; case "datetime": fi.type = field.fieldType._date; break; case "date": fi.type = field.fieldType._date; break; case "timestamp": fi.type = field.fieldType._date; break; case "uniqueidentifier": fi.type = field.fieldType._uniqueidentifier; break; case "decimal": fi.type = field.fieldType._decimal; break; default: fi.type = field.fieldType._string; break; } fi.targetType = fi.type; fi.allowNulls = sf.boolean(row["IS_NULLABLE"]); fi.size = sf.entero(row["CHARACTER_MAXIMUM_LENGTH"]); // fi.comment = sf.Cadena(tbl.Rows(i)!COLUMN_COMMENT); fi.defaultValue = sf.cadena(row["COLUMN_DEFAULT"]); if (fi.defaultValue.Equals("-1")) fi.defaultValue = "0"; //if (fi.defaultValue.Equals("(getdate())")) // fi.defaultValue = "0"; //if (sf.cadena(row["COLUMN_DEFAULT"]).IndexOf("getdate()") != -1) // fi.defaultValue = "0"; //fi.autoNumber = sf.boolean(row["COLUMN_KEY"]); // fi.isKey = sf.boolean(row["COLUMN_KEY"]); fi.decimals = sf.entero(row["NUMERIC_PRECISION"]); // // Retrieve the column's default value. // fi.defaultValue = ((row["COLUMN_DEFAULT"] as DBNull) // != null) ? "Null" : row["COLUMN_DEFAULT"].ToString(); // // Retrieve the column's precision. // //column.Precision = ((row["NUMERIC_PRECISION"] as DBNull) // // != null) ? 0 : Int32.Parse(row["NUMERIC_PRECISION"].ToString()); // // Retrieve the column's scale. //// column.Scale = ((row["NUMERIC_SCALE"] as DBNull) != null) ? 0 : Int32.Parse(row["NUMERIC_SCALE"].ToString()); // // Specify if the column is a primary key. // fi.isKey = primaryKeys.Contains(row["COLUMN_NAME"].ToString()); // // Specify that the column is not an identity column. // //column.IsIdentity = false; // // Retrieve the column length. // fi.size = ((OleDbType)Int32.Parse(row["DATA_TYPE"].ToString()) != OleDbType.WChar) ? -1 : Int32.Parse(row["CHARACTER_MAXIMUM_LENGTH"].ToString()); // // Append the column to the list. //fi.size = sf.Entero(tbl.Rows(i)!CHARACTER_MAXIMUM_LENGTH) // fi.comment = sf.Cadena(tbl.Rows(i)!COLUMN_COMMENT) //fi.allowNulls = sf.boolean(row["IS_NULLABLE"]);//tbl.Rows(i)!IS_NULLABLE) // fi.defaultValue = sf.Cadena(tbl.Rows(i)!COLUMN_DEFAULT) // fi.autoNumber = sf.boolean(tbl.Rows(i)!COLUMN_KEY) // fi.decimals = sf.Entero(tbl.Rows(i)!NUMERIC_PRECISION) //// lets get the comment fi.comment = getComments(cadconexion, table, fi.Name); String comentario; comentario = fi.comment; if (comentario.Contains("#date#")) { fi.targetType = field.fieldType._date; } if (comentario.Contains("#img#") | comentario.Contains("#image#")) { fi.targetType = field.fieldType._image; } if (comentario.Contains("#audio#")) { fi.targetType = field.fieldType._audio; } if (comentario.Contains("#money#")) { fi.targetType = field.fieldType._money; } if (comentario.Contains("#video#")) { fi.targetType = field.fieldType._video; } if (comentario.Contains("#doc#") | comentario.Contains("#document#")) { fi.targetType = field.fieldType._document; } if (comentario.Contains("#hide#")) { fi.invisible = true; fi.targetType = field.fieldType._hidden; } if (comentario.Contains("#desc#")) { fi.isDescriptionInCombo = true; // table.fieldDescription = fi.Name; } comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#date#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#img#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#image#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#audio#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#money#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#video#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#doc#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#document#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#hide#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#desc#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); // ahora reglas - now validation rules... if (comentario.Contains("#url#")) fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Url)); if (comentario.Contains("#email#")) fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Email)); if (comentario.Contains("#requerido#")) fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Required)); if (comentario.Contains("#requerido#")) fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Required)); if (comentario.Contains("#alphaNumeric#")) fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Alphanumeric)); if (comentario.Contains("#creditcard#")) fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.CreditCard)); if (comentario.Contains("#date#")) fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Date)); if (comentario.Contains("#decimal#")) fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Decimal)); if (comentario.Contains("#ip#")) fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.IP)); if (comentario.Contains("#isUnique#")) fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.IsUnique)); if (comentario.Contains("#money#")) fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Money)); if (comentario.Contains("#numeric#")) fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Numeric)); if (comentario.Contains("#phone#")) fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Phone)); if (comentario.Contains("#postal#")) fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Postal)); if (comentario.Contains("#between")) { string IPMatchExp = @"#between(?:(?<t>[^#]*))"; Match theMatch = Regex.Match(comentario, IPMatchExp); string st = ""; if (theMatch.Success) st = theMatch.Groups[1].Value; if (st.Equals("")) { fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Between)); } } if (comentario.Contains("#comparison")) { string IPMatchExp = @"#comparison(?:(?<t>[^#]*))"; Match theMatch = Regex.Match(comentario, IPMatchExp); string st = ""; if (theMatch.Success) st = theMatch.Groups[1].Value; if (st.Equals("")) { fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Between)); } } if (comentario.Contains("#extension")) { string IPMatchExp = @"#extension(?:(?<t>[^#]*))"; Match theMatch = Regex.Match(comentario, IPMatchExp); string st = ""; if (theMatch.Success) st = theMatch.Groups[1].Value; if (st.Equals("")) { fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Between)); } } if (comentario.Contains("#minLength")) { string IPMatchExp = @"#minLength(?:(?<t>[^#]*))"; Match theMatch = Regex.Match(comentario, IPMatchExp); string st = ""; if (theMatch.Success) st = theMatch.Groups[1].Value; if (st.Equals("")) { fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Between)); } } if (comentario.Contains("#maxLength")) { string IPMatchExp = @"#maxLength(?:(?<t>[^#]*))"; Match theMatch = Regex.Match(comentario, IPMatchExp); string st = ""; if (theMatch.Success) st = theMatch.Groups[1].Value; if (st.Equals("")) { fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Between)); } } if (comentario.Contains("#inList")) { string IPMatchExp = @"#inList(?:(?<t>[^#]*))"; Match theMatch = Regex.Match(comentario, IPMatchExp); string st = ""; if (theMatch.Success) st = theMatch.Groups[1].Value; if (st.Equals("")) { fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Between)); } } if (comentario.Contains("#regexp")) { string IPMatchExp = @"#regexp(?:(?<t>[^#]*))"; Match theMatch = Regex.Match(comentario, IPMatchExp); string st = ""; if (theMatch.Success) st = theMatch.Groups[1].Value; if (st.Equals("")) { fi.validationRules.Add(new validationRule(validationRule.typeOfValidation.Between)); } } // comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#between(?:(?<t>[^#]*))#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#url#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#email#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#requerido#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#required#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#alphaNumeric#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#creditcard#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#date#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#decimal#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#ip#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#isUnique#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#money#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#numeric#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#phone#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#postal#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#comparison(?:(?<t>[^#]*))#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#between(?:(?<t>[^#]*))#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#extension(?:(?<t>[^#]*))#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#minlength(?:(?<t>[^#]*))#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#maxlength(?:(?<t>[^#]*))#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#inList(?:(?<t>[^#]*))#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); comentario = System.Text.RegularExpressions.Regex.Replace(comentario, @"#regexp(?:(?<t>[^#]*))#", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); if (comentario != "") fi.targetName = comentario.Trim(); //if (fi.comment.IndexOf("#image#") >= 1 or ) //{ // fi.targetType = field.fieldType._image; // fi.comment=fi.comment.Replace("#image#", ""); //} //if (fi.comment.IndexOf("#audio#") >= 1) //{ // fi.targetType = field.fieldType._audio; // fi.comment = fi.comment.Replace("#image#", ""); //} //if (fi.comment.IndexOf("#doc#") >= 1) //{ // fi.targetType = field.fieldType._document; // fi.comment = fi.comment.Replace("#doc#", ""); //} //if (!fi.comment.Equals("")) // fi.targetName = fi.comment; lista.Add(fi); } return lista; } catch (Exception ep) { // lo.tratarError(ep, "Error en dbClass.new", ""); return null; } finally { conexion.Close(); } }
GroupBy(field, fields);
public void Set(field id, byte value, int index) { Set(id.index + index, value); }
public void Set(field id, UInt16 value) { Set(id.index, value); }
public List<field> getFields(string cadconexion, string table) { OleDbConnection conexion = null; try { List<field> lista = new List<field>(); conexion = new OleDbConnection(cadconexion); miComando = new OleDbCommand(""); miComando.Connection = conexion; conexion.ConnectionString = cadconexion; conexion.Open(); System.Data.DataTable dt = new System.Data.DataTable(); dt = conexion.GetSchema(OleDbMetaDataCollectionNames.Columns, new String[] { null, null, table, null }); //foreach (System.Data.DataColumn col in dt.Columns) //{ //} foreach (System.Data.DataRow row in dt.Rows) { // Debug.WriteLine(row["TABLE_NAME"] + " " + row["COLUMN_NAME"] + " " + row["DATA_TYPE"]); field fi = new field(); fi.Name = row[3].ToString(); // le cambiamos el nombre para evitar caracteres raros... fi.targetName = fi.Name; adoTypes at = new adoTypes(); at = (adoTypes)sf.entero(row[11].ToString()); switch (at) { case adoTypes.adUnsignedTinyInt: fi.type = field.fieldType._integer; break; case adoTypes.adSingle: fi.type = field.fieldType._integer; break; case adoTypes.adInteger: fi.type = field.fieldType._integer; break; case adoTypes.adDouble: fi.type = field.fieldType._double; break; case adoTypes.adCurrency: fi.type = field.fieldType._double; break; case adoTypes.adDBDate: fi.type = field.fieldType._date; break; case adoTypes.adDate: fi.type = field.fieldType._date; break; case adoTypes.adWChar: fi.type = field.fieldType._string; break; case adoTypes.adBoolean: fi.type = field.fieldType._boolean; break; default: fi.type = field.fieldType._string; break; } fi.targetType = fi.type; fi.allowNulls = sf.boolean(row["IS_NULLABLE"]); fi.size = sf.entero(row["CHARACTER_MAXIMUM_LENGTH"]); fi.defaultValue = sf.cadena(row["COLUMN_DEFAULT"]); // if text is large ... if ( (fi.type == field.fieldType._string && fi.size >= 240) || (fi.type == field.fieldType._string && fi.size == 0) ) { fi.type = field.fieldType._text; fi.targetType = field.fieldType._text; } try { fi.comment = sf.cadena(row[27].ToString()); } catch (Exception) { throw; } fi.decimals = sf.entero(row["NUMERIC_PRECISION"]); //fi.autoNumber = sf.boolean(row["COLUMN_KEY"]); // fi.isKey = sf.boolean(row["COLUMN_KEY"]); // fi.autoNumber = sf.boolean(row["ISIDENTITY"]); // // Retrieve the column's default value. // fi.defaultValue = ((row["COLUMN_DEFAULT"] as DBNull) // != null) ? "Null" : row["COLUMN_DEFAULT"].ToString(); // // Retrieve the column's precision. // //column.Precision = ((row["NUMERIC_PRECISION"] as DBNull) // // != null) ? 0 : Int32.Parse(row["NUMERIC_PRECISION"].ToString()); // // Retrieve the column's scale. //// column.Scale = ((row["NUMERIC_SCALE"] as DBNull) != null) ? 0 : Int32.Parse(row["NUMERIC_SCALE"].ToString()); // // Specify if the column is a primary key. // fi.isKey = primaryKeys.Contains(row["COLUMN_NAME"].ToString()); // // Specify that the column is not an identity column. // //column.IsIdentity = false; // // Retrieve the column length. // fi.size = ((OleDbType)Int32.Parse(row["DATA_TYPE"].ToString()) != OleDbType.WChar) ? -1 : Int32.Parse(row["CHARACTER_MAXIMUM_LENGTH"].ToString()); // // Append the column to the list. //fi.size = sf.Entero(tbl.Rows(i)!CHARACTER_MAXIMUM_LENGTH) // fi.comment = sf.Cadena(tbl.Rows(i)!COLUMN_COMMENT) //fi.allowNulls = sf.boolean(row["IS_NULLABLE"]);//tbl.Rows(i)!IS_NULLABLE) // fi.defaultValue = sf.Cadena(tbl.Rows(i)!COLUMN_DEFAULT) // fi.autoNumber = sf.boolean(tbl.Rows(i)!COLUMN_KEY) // fi.decimals = sf.Entero(tbl.Rows(i)!NUMERIC_PRECISION) // lets get the comment // fi.comment = getComments(cadconexion, table, fi.Name); if (fi.comment.IndexOf("#image#") >= 1) { fi.targetType = field.fieldType._image; fi.comment = fi.comment.Replace("#image#", ""); } if (fi.comment.IndexOf("#audio#") >= 1) { fi.targetType = field.fieldType._audio; fi.comment = fi.comment.Replace("#image#", ""); } if (fi.comment.IndexOf("#doc#") >= 1) { fi.targetType = field.fieldType._document; fi.comment = fi.comment.Replace("#doc#", ""); } if (!fi.comment.Equals("")) fi.targetName = fi.comment; lista.Add(fi); } return lista; } catch (Exception ep) { // lo.tratarError(ep, "Error en dbClass.new", ""); return null; } finally { conexion.Close(); } }
public void Fill(field id, byte value) { for (int i = id.index; i < id.index + id.arrayLen; i++) Set(i, value); }
public byte GetByte(field id) { return GetByte(id.index); }
public userControlEditField() { InitializeComponent(); campito = new field(); txtField.Focus(); }
public Field() { x = 0; y = 0; content = field.e; }