Ejemplo n.º 1
0
        //public void

        private void TripAdd_Load(object sender, EventArgs e)
        {
            checkBox1.Checked = Properties.Settings.Default.showcontent;
            if (checkBox1.Checked)
            {
                amount.PasswordChar = '\0';
                other.PasswordChar  = '\0';
            }
            else
            {
                amount.PasswordChar = '*';
                other.PasswordChar  = '*';
            }

            if (!isNew)
            {
                return;
            }

            SQLiteConnection scn = new SQLiteConnection(@"data source = main.db");

            customername.Items.AddRange(Sqlite.LoadClients());
            scn.Open();
            SQLiteCommand sq;

            sq = new SQLiteCommand("select seq from sqlite_sequence where name='Trips'", scn);
            int lastid = Convert.ToInt32(sq.ExecuteScalar());

            invoiceno.Text = (lastid + 1).ToString();
            scn.Close();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 3
0
 private void RecevingsAdd_Load(object sender, EventArgs e)
 {
     payer.Items.AddRange(Sqlite.LoadClients());
 }
Ejemplo n.º 4
0
 private void Recevings_Load(object sender, EventArgs e)
 {
     payer.Items.Add("-");
     payer.Items.AddRange(Sqlite.LoadClients());
     payer.SelectedIndex = 0;
 }
Ejemplo n.º 5
0
 private void Bill_Load(object sender, EventArgs e)
 {
     clientname.Items.AddRange(Sqlite.LoadClients());
 }
Ejemplo n.º 6
0
 private void Trips_Load(object sender, EventArgs e)
 {
     clientname.Items.AddRange(Sqlite.LoadClients());
     clientname.SelectedIndex = 0;
 }