Exemplo n.º 1
0
        protected decimal getDecimalFromRow(string colName)
        {
            object v = getAttrFromRow(colName);

            if (v != null)
            {
                return(ServiceFunctions.convertToDecimal(v));
            }
            else
            {
                return(0);
            }
        }
        private void FillCoeffs()
        {
            string query = "SELECT temperature, coeff_val FROM isolation_material_tcoeffs WHERE isolation_material_id = {0}";

            query = String.Format(query, this.Id);
            DataTable dt = getFromDB(query);

            if (dt.Rows.Count > 0)
            {
                this.coeffs.Clear();
                this.temperatures.Clear();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    this.coeffs.Add(ServiceFunctions.convertToDecimal(dt.Rows[i]["coeff_val"]));
                    this.temperatures.Add(ServiceFunctions.convertToInt16(dt.Rows[i]["temperature"]));
                }
            }
        }