public bool AddValue(string colName, Int_attr attr, bool ignoreNull_flag) { if (attr == null) { return(false); } if (attr.IsNull_flag) { if (ignoreNull_flag) { return(false); } SqlParameter sp = new SqlParameter(); sp.Value = DBNull.Value; sp.SqlDbType = SqlDbType.Int; this.col_val_dic[colName] = sp; return(true); } else { return(this.AddValue(colName, attr.Value)); } }
public void GetInt(string colName, Int_attr attr) { if (attr == null) { return; } if (!this.Check_getCol(colName)) { return; } object temp_obj = this.reader[colName]; if (temp_obj == DBNull.Value) { attr.IsNull_flag = true; } else { if (this.reader[colName].GetType() == typeof(byte)) { attr.Value = (byte)temp_obj; } else if (this.reader[colName].GetType() == typeof(double)) { double db_val = (double)temp_obj; attr.Value = (int)db_val; } else { attr.Value = (int)temp_obj; } } }
public bool AddValue(string colName, Int_attr attr) { if (attr == null) { return(false); } if (this.template == null || !this.template.Exist_colName(colName, false)) { return(false); } SqlParameter sp = new SqlParameter(); if (attr.IsNull_flag) { sp.Value = DBNull.Value; } else { sp.Value = attr.Value; } sp.SqlDbType = SqlDbType.Int; this.col_val_dic[colName] = sp; return(true); }
public StrAttr_UserControl(string name, Int_attr attr, bool readOnly = false) { this.InitializeComponent(); this.name_label.Text = name; this.intAttr = attr; this.Refresh_Data(); this.ReadOnly_flag = readOnly; }
public bool AddValue(string colName, Int_attr attr) { return(this.AddValue(colName, attr, true)); }