public DataTable GetBillDetailsByBillId(int?id)
        {
            const string query         = "SELECT p.id, p.name, p.price, bd.quantity FROM `bill_detail` bd INNER JOIN `product` p WHERE bd.id_product = p.id AND bd.id_bill = @id GROUP BY p.id";
            var          sqlParameters = new MySqlParameter[1];

            sqlParameters[0] = new MySqlParameter("@id", MySqlDbType.Int32)
            {
                Value = id
            };
            return(_mySqlDbConnection.ExecuteSelectQuery(query, sqlParameters));
        }
        public DataTable GetImageFileNameByProductId(int?id)
        {
            const string query         = "select link from images, product where images.id_product = product.id and product.id = @id";
            var          sqlParameters = new MySqlParameter[1];

            sqlParameters[0] = new MySqlParameter("@id", MySqlDbType.Int32)
            {
                Value = id
            };
            return(mySqlDbConnection.ExecuteSelectQuery(query, sqlParameters));
        }
예제 #3
0
        public bool Login(string user, string pass)
        {
            const string query         = "select * from user_administrator where username = @user and password = @pass";
            var          sqlParameters = new MySqlParameter[2];

            sqlParameters[0] = new MySqlParameter("@user", MySqlDbType.VarChar)
            {
                Value = user
            };
            sqlParameters[1] = new MySqlParameter("@pass", MySqlDbType.VarChar)
            {
                Value = pass
            };

            return(_mySqlDbConnection.ExecuteSelectQuery(query, sqlParameters).Rows.Count > 0);
        }
예제 #4
0
        public DataTable GetAllProductTypes()
        {
            const string query = "select * from product_type";

            return(_mySqlDbConnection.ExecuteSelectQuery(query));
        }
        public DataTable GetAllBill()
        {
            const string query = "select * from bill";

            return(_mySqlDbConnection.ExecuteSelectQuery(query));
        }
        public DataTable GetAllShippers()
        {
            const string query = "select * from shippers";

            return(_mySqlDbConnection.ExecuteSelectQuery(query));
        }
예제 #7
0
        public DataTable GetAllImportProducts()
        {
            const string query = "select * from import";

            return(_mySqlDbConnection.ExecuteSelectQuery(query));
        }