private void btn_addcar_Click(object sender, EventArgs e) { try { mainID = Form_Methods.GenerateID(txt_brand.Text, txt_year.Text); filepath = Application.StartupPath + @"\\images\" + mainID + "\\"; Directory.CreateDirectory(filepath); File.Copy(picloc, filepath + Path.GetFileName(picloc)); File.Move(filepath + Path.GetFileName(picloc), filepath + "img.jpg"); Form_Methods.AddCar(mainID, txt_brand.Text, txt_year.Text, txt_design.Text, txt_engine.Text, txt_type.Text); MessageBox.Show("Car Added"); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { txt_brand.Text = ""; txt_year.Text = ""; txt_design.Text = ""; txt_engine.Text = ""; txt_type.Text = ""; pictureBox1.Image = null; } }
public MainForm() { InitializeComponent(); try { Form_Methods.FillCombo(comboBox1); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button1_Click(object sender, EventArgs e) { try { Form_Methods.LoadData(dataGridView1, "archive"); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { } }
private void btn_load_Click(object sender, EventArgs e) { try { Form_Methods.LoadCarDetails(lbl_brand, lbl_year, lbl_design, lbl_engine, lbl_type); pictureBox2.ImageLocation = Application.StartupPath + @"\\images\" + comboBox1.Text + "\\img.jpg"; Form_Methods.LoadStatus("Asigurare", "yes", lbl_asig); Form_Methods.LoadStatus("ITP", "yes", lbl_itp); Form_Methods.LoadStatus("Ulei", "yes", lbl_ulei); Form_Methods.LoadStatus("Rovinieta", "yes", lbl_rov); Form_Methods.LoadStatus("Filtre", "yes", lbl_filtre); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btn_add_Click(object sender, EventArgs e) { try { Form_Methods.RemoveLatest(comboBox1.Text); Form_Methods.AddMaint(comboBox1.Text, dateTimePicker1.Text, dateTimePicker2.Text, txt_cost.Text); MessageBox.Show("Work Added"); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { txt_cost.Text = ""; } }
private void btn_add_Click(object sender, EventArgs e) { try { Form_Methods.AddWork(dateTimePicker1.Text, txt_work.Text, txt_cost.Text, txt_desc.Text); MessageBox.Show("Work Added"); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { txt_work.Text = ""; txt_cost.Text = ""; txt_desc.Text = ""; } }
private void btn_addpic_Click(object sender, EventArgs e) { picloc = Form_Methods.addImgPicbox(pictureBox1); }