Ejemplo n.º 1
0
        public void mSQL_FakturaIzmeni(int ID, string Dbroj, DateTimePicker picker)
        {
            Connect();
            MySqlCommand check_ID = new MySqlCommand();

            check_ID.CommandText = "SELECT COUNT(*) FROM fakture WHERE xID=@ID";
            check_ID.Parameters.AddWithValue("@ID", ID);
            check_ID.Connection = connection;
            var checkNumberID = check_ID.ExecuteScalar();
            int valueID       = Convert.ToInt32(checkNumberID);

            if (valueID > 0)
            {
                ListaFaktura faktPage = new ListaFaktura();
                MySqlCommand cmd      = new MySqlCommand();
                cmd.CommandText = "UPDATE fakture SET xBroj = @Dbroj, xDatum = @datum WHERE xID = @ID";
                cmd.Parameters.AddWithValue("@ID", ID);
                cmd.Parameters.AddWithValue("@Dbroj", Dbroj);
                cmd.Parameters.AddWithValue("@datum", picker.Text);
                cmd.Connection = connection;
                var check = cmd.ExecuteScalar();
                int value = Convert.ToInt32(check);
                MessageBox.Show("Uspesno ste izmenili fakturu");
                faktPage.RefreshGrid();
            }
            else
            {
                MessageBox.Show("Taj ID Fakture ne postoji");
            }
        }
Ejemplo n.º 2
0
        private void btnLisFaktura_Click(object sender, EventArgs e)
        {
            ListaFaktura listaPage = new  ListaFaktura();

            listaPage.ShowDialog();
        }