Ejemplo n.º 1
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            fUpdateDeleteBike frm = new fUpdateDeleteBike();

            frm.textBoxID.Text = textBoxSearch.Text;

            frm.ShowDialog(this);
        }
Ejemplo n.º 2
0
        private void dataGridViewBikeList_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            //id - fname - lnane - bd - gdr - phn - adrs - pic
            fUpdateDeleteBike fm = new fUpdateDeleteBike();

            fm.textBoxID.Text              = dataGridViewBikeList.CurrentRow.Cells[0].Value.ToString();
            fm.textBoxNameOwner.Text       = dataGridViewBikeList.CurrentRow.Cells[3].Value.ToString();
            fm.textBoxAddress.Text         = dataGridViewBikeList.CurrentRow.Cells[4].Value.ToString();
            fm.textBoxPhone.Text           = dataGridViewBikeList.CurrentRow.Cells[5].Value.ToString();
            fm.numericUpDownTimeRent.Value = (int)dataGridViewBikeList.CurrentRow.Cells[6].Value;
            fm.dateTimePicker1.Value       = (DateTime)dataGridViewBikeList.CurrentRow.Cells[7].Value;
            if ((dataGridViewBikeList.CurrentRow.Cells[8].Value.ToString().Trim() == "Hour"))
            {
                fm.radioButtonHour.Checked = true;
            }
            else if ((dataGridViewBikeList.CurrentRow.Cells[8].Value.ToString().Trim() == "Week"))
            {
                fm.radioButtonWeek.Checked = true;
            }
            else
            {
                fm.radioButtonMonth.Checked = true;
            }

            // code xu ly hinh anh up len, version 01, chay OK, tim hieu them de code nhe hon
            byte[] pic1;
            pic1 = (byte[])dataGridViewBikeList.CurrentRow.Cells[1].Value;
            MemoryStream picture1 = new MemoryStream(pic1);

            fm.pictureBoxBike.Image = Image.FromStream(picture1);

            byte[] pic2;
            pic2 = (byte[])dataGridViewBikeList.CurrentRow.Cells[2].Value;
            MemoryStream picture2 = new MemoryStream(pic2);

            fm.pictureBoxBike.Image = Image.FromStream(picture2);

            this.Show();
            fm.Show();
        }
Ejemplo n.º 3
0
        private void editBikeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fUpdateDeleteBike frm = new fUpdateDeleteBike();

            frm.ShowDialog(this);
        }