Beispiel #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (int.Parse(listView1.SelectedItems[0].SubItems[6].Text) > Sqlite.ClientBalance(listView1.SelectedItems[0].SubItems[1].Text))
            {
                MessageBox.Show("Not enough balance");
                return;
            }
            SQLiteConnection scn = new SQLiteConnection(@"data source = main.db");

            scn.Open();
            SQLiteCommand sq;

            sq = new SQLiteCommand("update Trips set Status='Paid' where Tripno = '" + listView1.SelectedItems[0].Text + "'", scn);
            sq.ExecuteNonQuery();
            filter.PerformClick();
        }
Beispiel #2
0
        private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            TripAdd          tadd = new TripAdd();
            SQLiteConnection scn  = new SQLiteConnection(@"data source = main.db");

            scn.Open();
            SQLiteCommand sq;

            sq = new SQLiteCommand("select * from Trips where Tripno = '" + listView1.SelectedItems[0].Text + "'", scn);
            SQLiteDataReader dr = sq.ExecuteReader();

            tadd.truckdetails.Items.Clear();
            while (dr.Read())
            {
                tadd.isNew          = false;
                tadd.invoiceno.Text = listView1.SelectedItems[0].Text;
                tadd.customername.Items.AddRange(Sqlite.LoadClients());
                tadd.customername.Text    = dr["Name"].ToString();
                tadd.from.Text            = dr["Froom"].ToString();
                tadd.to.Text              = dr["Tao"].ToString();
                tadd.comments.Text        = dr["Comments"].ToString();
                tadd.dateTimePicker1.Text = dr["Date"].ToString();
                tadd.status       = dr["Status"].ToString();
                tadd.Qty.Text     = dr["Qty"].ToString();
                tadd.amount.Text  = dr["Amount"].ToString();
                tadd.typebox.Text = dr["Type"].ToString();
                tadd.other.Text   = dr["Other"].ToString();
            }

            sq = new SQLiteCommand("select * from TripDetails where Tripno = '" + listView1.SelectedItems[0].Text + "'", scn);

            dr = sq.ExecuteReader();
            while (dr.Read())
            {
                tadd.truckdetails.Items.Add(new ListViewItem(new[] { dr["Truckno"].ToString(),
                                                                     dr["Weight"].ToString(),
                                                                     dr["Location"].ToString(),
                                                                     dr["Qty"].ToString(),
                                                                     dr["Amount"].ToString() }));
            }
            tadd.ShowTrucksQty();
            tadd.Show();
        }
Beispiel #3
0
 private void RecevingsAdd_Load(object sender, EventArgs e)
 {
     payer.Items.AddRange(Sqlite.LoadClients());
 }
Beispiel #4
0
 private void button6_Click(object sender, EventArgs e)
 {
     Sqlite.ExportToExcel(listView1);
 }
Beispiel #5
0
 private void listView1_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     Sqlite.ColumnSorter(e.Column, listView1);
 }
Beispiel #6
0
 private void Recevings_Load(object sender, EventArgs e)
 {
     payer.Items.Add("-");
     payer.Items.AddRange(Sqlite.LoadClients());
     payer.SelectedIndex = 0;
 }
Beispiel #7
0
 private void Bill_Load(object sender, EventArgs e)
 {
     clientname.Items.AddRange(Sqlite.LoadClients());
 }
 private void button6_Click(object sender, EventArgs e)
 {
     Sqlite.ExportToExcel(truckdetails);
 }
Beispiel #9
0
 private void Trips_Load(object sender, EventArgs e)
 {
     clientname.Items.AddRange(Sqlite.LoadClients());
     clientname.SelectedIndex = 0;
 }
Beispiel #10
0
 private void button2_Click_1(object sender, EventArgs e)
 {
     MessageBox.Show(Sqlite.ClientBalance(clientname.Text).ToString());
 }