Example #1
0
        private void saveToolStripButton_Click(object sender, EventArgs e)
        {
            //string id = "";
            //string name = "";
            //string address_st = "";
            string st = "";

            //id = dataGridViewModels.Rows[selectIndex].Cells[1].Value.ToString();
            //name = dataGridViewModels.Rows[selectIndex].Cells[2].Value.ToString();
            //address_st = dataGridViewModels.Rows[selectIndex].Cells[3].Value.ToString();
            //tel = dataGridViewModels.Rows[selectIndex].Cells[4].Value.ToString();

            st += IdDelete + ";" + IdBrand + ";" + IdModels + ";" + IdAddress + ";" + IdType + ";" + IdColor + ";" + IdBaseProperties + ";" + textBoxPP.Text + ";" + textBoxZP.Text +
                  ";" + textBoxPT.Text + ";" + textBoxZT.Text + ";" + textBoxGasCity.Text +
                  ";" + textBoxGasRoad.Text + ";" + textBoxGasCombi.Text + ";" + textBoxMaxSpeed.Text + ";" + textBoxSizeCar.Text +
                  ";" + textBoxKliners.Text + ";" + textBoxVB.Text + ";" + textBoxVBag.Text + ";" + textBoxSizeS.Text +
                  ";" + textBoxYears.Text + ";" + textBoxPrice.Text + ";" + checkBoxCZ.Checked + ";" + checkBoxSP.Checked + ";" + checkBoxPF.Checked +
                  ";" + checkBoxC.Checked + ";" + checkBoxE.Checked + ";" + checkBoxPZS.Checked + ";" + checkBoxPPS.Checked + ";" + checkBoxPC.Checked + ";" + checkBoxDZ.Checked + ";";
            car.Edit(int.Parse(IdDelete), st);
        }
Example #2
0
 private void toolStripButton3_Click(object sender, EventArgs e)
 {
     try
     {
         string id         = "";
         string name       = "";
         string address_st = "";
         string tel        = "";
         if (edit)
         {
             id         = dataGridViewAddress.Rows[selectIndex].Cells[1].Value.ToString();
             name       = dataGridViewAddress.Rows[selectIndex].Cells[2].Value.ToString();
             address_st = dataGridViewAddress.Rows[selectIndex].Cells[3].Value.ToString();
             tel        = dataGridViewAddress.Rows[selectIndex].Cells[4].Value.ToString();
             address.Edit(selectId, id + ";" + name + ";" + address_st + ";" + tel + ";");
         }
         else
         {
             int n = dataGridViewAddress.RowCount - 1;
             int k = int.Parse(address.lastId());
             id         = (k + 1).ToString();
             name       = dataGridViewAddress.Rows[n].Cells[2].Value.ToString();
             address_st = dataGridViewAddress.Rows[n].Cells[3].Value.ToString();
             tel        = dataGridViewAddress.Rows[n].Cells[4].Value.ToString();
             List <string> rowAddress = new List <string>();
             rowAddress.Add(id);
             rowAddress.Add(name);
             rowAddress.Add(address_st);
             rowAddress.Add(tel);
             address.Add(rowAddress);
         }
         dataGridViewAddress.ReadOnly = true;
     }
     catch
     {
     }
 }