Exemplo n.º 1
0
        private void btnRefreshDirection_Click(object sender, EventArgs e)
        {
            var    aux   = Convert.ToInt32(user.idUser);
            string query = String.Format(
                "SELECT idAddress, Address FROM ADDRESS WHERE idUser = '******';", aux);

            var view = ConectionDB.ExecuteQuery(query);

            dgvDirection.DataSource = view;
        }
Exemplo n.º 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            var aux = Convert.ToInt32(user.idUser);

            string query = String.Format(
                "SELECT ao.idOrder, ao.createDate, pr.name, au.fullname, ad.address" +
                "FROM APPORDER ao, ADDRESS ad, PRODUCT pr, APPUSER au" +
                "WHERE ao.idProduct = pr.idProduct" +
                "AND ao.idAddress = ad.idAddress" +
                "AND ad.'{0}' = au.'{0}';", aux);

            var view = ConectionDB.ExecuteQuery(query);

            dgvOrderUser.DataSource = view;
        }
Exemplo n.º 3
0
        public static List <Address> getLista()
        {
            string query = "SELECT * FROM ADDRESS";

            DataTable dt = ConectionDB.ExecuteQuery(query);

            List <Address> list = new List <Address>();

            foreach (DataRow row in dt.Rows)
            {
                Address a = new Address();
                a.idAddress = Convert.ToInt32(row[0].ToString());
                a.idUser    = Convert.ToInt32(row[1].ToString());
                a.address   = row[2].ToString();

                list.Add(a);
            }
            return(list);
        }
        public static List <Business> getLista()
        {
            string query = "SELECT * FROM BUSINESS";

            DataTable dt = ConectionDB.ExecuteQuery(query);

            List <Business> list = new List <Business>();

            foreach (DataRow row in dt.Rows)
            {
                Business b = new Business();
                b.idBusiness  = Convert.ToInt32(row[0].ToString());
                b.name        = row[1].ToString();
                b.description = row[2].ToString();

                list.Add(b);
            }
            return(list);
        }
        public static List <appOrder> getLista()
        {
            string query = "SELECT * FROM APPORDER";

            DataTable dt = ConectionDB.ExecuteQuery(query);

            List <appOrder> list = new List <appOrder>();

            foreach (DataRow row in dt.Rows)
            {
                appOrder ap = new appOrder();
                ap.idOrder    = Convert.ToInt32(row[0].ToString());
                ap.createDate = Convert.ToDateTime(row[1].ToString());
                ap.idProduct  = Convert.ToInt32(row[2].ToString());
                ap.idAddress  = Convert.ToInt32(row[3].ToString());

                list.Add(ap);
            }
            return(list);
        }
Exemplo n.º 6
0
        public static List <appUser> getLista()
        {
            string query = "SELECT * FROM APPUSER";

            DataTable dt = ConectionDB.ExecuteQuery(query);

            List <appUser> list = new List <appUser>();

            foreach (DataRow row in dt.Rows)
            {
                appUser au = new appUser();
                au.idUser   = Convert.ToInt32(row[0].ToString());
                au.fullName = row[1].ToString();
                au.userName = row[2].ToString();
                au.password = row[3].ToString();
                au.userType = Convert.ToBoolean(row[4].ToString());

                list.Add(au);
            }
            return(list);
        }