Esempio n. 1
0
        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));
            }
        }
Esempio n. 2
0
        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;
                }
            }
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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;
        }
Esempio n. 5
0
 public bool AddValue(string colName, Int_attr attr)
 {
     return(this.AddValue(colName, attr, true));
 }