Ejemplo n.º 1
0
 private void filler()
 {
     EmailClass emailClass = new EmailClass();
       emailClass.ID = 0;
       emailClass.Name = "Yeni";
       emailClass.Email = "";
       emailClass.ToEnd = 0;
       emailClass.ToYol = 0;
       this.cbValues.Items.Clear();
       this.cbValues.Items.Add((object)emailClass);
       this.cbValues.Items.AddRange((object[])EmailClass.Emails_GetAll());
 }
Ejemplo n.º 2
0
        public static EmailClass[] Emails_GetAll()
        {
            string query = "Emails_GetAll";

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

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

              for (int i = 0; i < dt.Rows.Count; i++)
              {
            EmailClass tmp = new EmailClass();
            tmp.ID = Convert.ToInt32(dt.Rows[i]["ID"].ToString());
            tmp.Name = dt.Rows[i]["Name"].ToString();
            tmp.Email = dt.Rows[i]["Email"].ToString();
            tmp.ToEnd = Convert.ToInt32(dt.Rows[i]["ToEnd"].ToString());
            tmp.ToYol = Convert.ToInt32(dt.Rows[i]["ToYol"].ToString());

            res.Add(tmp);
              }

              return res.ToArray();
        }