public static void UpdateField(Myfield field) { SQL_utils sql = new SQL_utils(); string fldpk = field.fldpk; string fldtypepk = field.fldtypepk; string fieldlabel = field.fieldlabel; string fieldvaluesetID = field.fieldvaluesetID; string missval = field.missval; string minval = field.minval; string maxval = field.maxval; string regex = field.regex; string regexdesc = field.regexdesc; string validlist = field.validlist; string InAnalysis = field.InAnalysis; string RelItem = field.RelItem; string RelAgreeThreshold = field.RelAgreeThreshold; List <SqlParameter> ps = new List <SqlParameter>(); ps.Add(sql.CreateParam("fldpk", fldpk, "int")); ps.Add(sql.CreateParam("fldtypepk", fldtypepk, "int")); ps.Add(sql.CreateParam("fieldlabel", fieldlabel, "text")); ps.Add(sql.CreateParam("missval", missval, "text")); ps.Add(sql.CreateParam("minval", minval, "int")); ps.Add(sql.CreateParam("maxval", maxval, "int")); ps.Add(sql.CreateParam("regex", regex, "text")); ps.Add(sql.CreateParam("regexdesc", regexdesc, "text")); ps.Add(sql.CreateParam("validlist", validlist, "text")); ps.Add(sql.CreateParam("InAnalysis", InAnalysis, "int")); ps.Add(sql.CreateParam("RelItem", RelItem, "int")); ps.Add(sql.CreateParam("RelAgreeThreshold", RelAgreeThreshold, "text")); if (fieldvaluesetID == "") { ps.Add(sql.CreateParam("fieldvaluesetID", "-999", "int")); } else { ps.Add(sql.CreateParam("fieldvaluesetID", fieldvaluesetID, "int")); } sql.NonQuery_from_ProcName("def.spEdit_Fld2", ps); sql.Close(); }
public static int Main() { Console.WriteLine("\nReflection.FieldInfo"); Myfield Myfield = new Myfield(); // Get the Type and FieldInfo. Type MyType = typeof(Myfield); FieldInfo Myfieldinfo = MyType.GetField("field", BindingFlags.NonPublic | BindingFlags.Instance); // Get and display the MemberType. Console.Write("\n{0}.", MyType.FullName); Console.Write("{0} - ", Myfieldinfo.Name); Console.Write("{0};", Myfield.Field); MemberTypes Mymembertypes = Myfieldinfo.MemberType; Console.Write("MemberType is a {0}.", Mymembertypes.ToString()); return(0); }
public static void UpdateField(Myfield field) { SQL_utils sql = new SQL_utils(); string fldpk = field.fldpk; int? layout_section = ToInt(field.layout_section.ToString(), -9876); int? layout_row = ToInt(field.layout_row.ToString(), -9876); int? layout_col = ToInt(field.layout_col.ToString(), -9876); int?width_label = ToInt(field.width_label, -9876); int?width_box = ToInt(field.width_box, -9876); int fldtypepk = ToInt(field.fldtypepk, 1); int showValueLabels = ToInt(field.showValueLabels, 0); string aspxfieldlabeltext = field.aspxfieldlabeltext; string fieldlabel = field.fieldlabel; int fieldvaluesetID = ToInt(field.fieldvaluesetID, -9876); int inAnalysis = ToInt(field.inAnalysis, -9876); int fieldcodeID = ToInt(field.fieldcodeID, -9876); int relitem = ToInt(field.relitem, -9876); int relagreethreshold = ToInt(field.relagreethreshold, -9876); string validlist = field.validlist; int minval = ToInt(field.minval, -9876); int maxval = ToInt(field.maxval, -9876); //Either the section, row, and col are all > 0 else null if (layout_col <= 0 | layout_row <= 0 | layout_section <= 0) { layout_section = null; layout_row = null; layout_col = null; width_label = null; width_box = null; } List <SqlParameter> ps = new List <SqlParameter>(); ps.Add(sql.CreateParam("fldpk", fldpk, "int")); ps.Add(sql.CreateParam("layout_section", layout_section.ToString(), "int")); ps.Add(sql.CreateParam("layout_row", layout_row.ToString(), "int")); ps.Add(sql.CreateParam("layout_col", layout_col.ToString(), "int")); ps.Add(sql.CreateParam("width_label", width_label.ToString(), "int")); ps.Add(sql.CreateParam("width_box", width_box.ToString(), "int")); ps.Add(sql.CreateParam("fldtypepk", fldtypepk.ToString(), "int")); ps.Add(sql.CreateParam("showValueLabels", showValueLabels.ToString(), "int")); ps.Add(sql.CreateParam("aspxfieldlabeltext", aspxfieldlabeltext, "text")); ps.Add(sql.CreateParam("fieldlabel", fieldlabel, "text")); ps.Add(sql.CreateParam("inAnalysis", inAnalysis.ToString(), "int")); ps.Add(sql.CreateParam("fieldvaluesetID", fieldvaluesetID.ToString(), "int")); ps.Add(sql.CreateParam("fieldcodeID", fieldcodeID.ToString(), "int")); ps.Add(sql.CreateParam("relitem", relitem.ToString(), "int")); ps.Add(sql.CreateParam("relagreethreshold", relagreethreshold.ToString(), "int")); ps.Add(sql.CreateParam("validlist", validlist, "text")); ps.Add(sql.CreateParam("minval", minval.ToString(), "int")); ps.Add(sql.CreateParam("maxval", maxval.ToString(), "int")); sql.NonQuery_from_ProcName("def.spEdit_Fld", ps); sql.Close(); }
public static void UpdateField(Myfield field) { SQL_utils sql = new SQL_utils(); string pk = field.pk; string layout_section = field.layout_section; string layout_row = field.layout_row; string layout_col = field.layout_col; string width_label = field.width_label; string width_box = field.width_box; string isReadOnly = field.isReadOnly; string DoubleEntryRequired = field.DoubleEntryRequired; string showValueLabels = field.showValueLabels; string aspxfieldlabeltext = field.aspxfieldlabeltext; string fieldlabel = field.fieldlabel; if (layout_section == "") { layout_section = "0"; } if (layout_row == "") { layout_row = "0"; } if (layout_col == "") { layout_col = "0"; } if (isReadOnly == "") { isReadOnly = "0"; } if (DoubleEntryRequired == "") { DoubleEntryRequired = "1"; } if (showValueLabels == "") { showValueLabels = "0"; } if (width_label == "") { width_label = "300"; } if (width_box == "") { width_box = "50"; } List <SqlParameter> ps = new List <SqlParameter>(); ps.Add(sql.CreateParam("pk", pk, "int")); ps.Add(sql.CreateParam("layout_section", layout_section, "int")); ps.Add(sql.CreateParam("layout_row", layout_row, "int")); ps.Add(sql.CreateParam("layout_col", layout_col, "int")); ps.Add(sql.CreateParam("width_label", width_label, "int")); ps.Add(sql.CreateParam("width_box", width_box, "int")); ps.Add(sql.CreateParam("isReadOnly", isReadOnly, "int")); ps.Add(sql.CreateParam("DoubleEntryRequired", DoubleEntryRequired, "int")); ps.Add(sql.CreateParam("showValueLabels", showValueLabels, "int")); ps.Add(sql.CreateParam("aspxfieldlabeltext", aspxfieldlabeltext, "text")); ps.Add(sql.CreateParam("fieldlabel", fieldlabel, "text")); sql.NonQuery_from_ProcName("spDEF_Edit_FieldInfo", ps); sql.Close(); }