Ejemplo n.º 1
0
 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;
     }
 }
Ejemplo n.º 2
0
 public MainForm()
 {
     InitializeComponent();
     try
     {
         Form_Methods.FillCombo(comboBox1);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         Form_Methods.LoadData(dataGridView1, "archive");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally
     {
     }
 }
Ejemplo n.º 4
0
 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);
     }
 }
Ejemplo n.º 5
0
 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 = "";
     }
 }
Ejemplo n.º 6
0
 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 = "";
     }
 }
Ejemplo n.º 7
0
 private void btn_addpic_Click(object sender, EventArgs e)
 {
     picloc = Form_Methods.addImgPicbox(pictureBox1);
 }