Exemplo n.º 1
0
        public static List<TelTypes> TelTypes_GetAll()
        {
            string query = "TelTypes_GetAll";

              DataTable dt = Connection.runQuery(query, new SqlParameter[0]);

              List<TelTypes> res = new List<TelTypes>();

              for (int i = 0; i < dt.Rows.Count; i++ )
              {
            TelTypes tmp = new TelTypes();

            tmp.ID = Convert.ToInt32(dt.Rows[i]["ID"].ToString());
            tmp.TelTypeName = dt.Rows[i]["TelTypeName"].ToString();

            res.Add(tmp);
              }

              return res;
        }
Exemplo n.º 2
0
        public static TelTypes TelTypes_GetByID(int id)
        {
            string query = "TelTypes_GetByID";

              List<SqlParameter> prms = new List<SqlParameter>();
              prms.Add(new SqlParameter("@ID", id));

              DataTable dt = Connection.runQuery(query,prms.ToArray());

              TelTypes res = new TelTypes();

              for (int i = 0; i < dt.Rows.Count; i++)
              {
            TelTypes tmp = new TelTypes();

            tmp.ID = Convert.ToInt32(dt.Rows[i]["ID"].ToString());
            tmp.TelTypeName = dt.Rows[i]["TelTypeName"].ToString();

            res=tmp;
              }
              return res;
        }