private void btnAdd_Click(object sender, EventArgs e) { Addcar_Form frm = new Addcar_Form(); frm.ShowDialog(); this.dgGetAllCar.DataSource = Cmg.GET_ALL_CARS(); }
private void btnEdit_Click(object sender, EventArgs e) { Addcar_Form frm = new Addcar_Form(); frm.cmbboxcarcategory.Text = this.dgGetAllCar.CurrentRow.Cells[0].Value.ToString(); frm.txtcarname.Text = this.dgGetAllCar.CurrentRow.Cells[1].Value.ToString(); frm.txtcarprice.Text = this.dgGetAllCar.CurrentRow.Cells[2].Value.ToString(); frm.txtquantity.Text = this.dgGetAllCar.CurrentRow.Cells[3].Value.ToString(); frm.Text = "Edit_form"; frm.btnaccept.Text = "modify"; frm.state = "update"; frm.txtcarname.ReadOnly = true; byte[] byteImage = (byte[])Cmg.Get_Imagecar(Convert.ToInt32(this.dgGetAllCar.CurrentRow.Cells[0].Value.ToString())).Rows[0][0]; MemoryStream ms = new MemoryStream(byteImage); frm.picboxcarimage.Image = Image.FromStream(ms); frm.ShowDialog(); this.dgGetAllCar.DataSource = Cmg.GET_ALL_CARS(); }
private void addNewCarForm_Click(object sender, EventArgs e) { Addcar_Form addform = new Addcar_Form(); addform.ShowDialog(); }