Esempio n. 1
0
        private void dataGridViewCountry_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int id = Convert.ToInt32(dataGridViewCountry.Rows[e.RowIndex].Cells[0].Value);

            country = WarehouseBack.Classes.Country.GetCountry(id);
            textBoxCountryName.Text = country.Name;
        }
Esempio n. 2
0
 private void button_SubmitCountry_Click(object sender, EventArgs e)
 {
     if (!IsEmtyStr(textBoxCountryName.Text))
     {
         try
         {
             if (country == null)
             {
                 WarehouseBack.Classes.Country newCountry = new WarehouseBack.Classes.Country();
                 newCountry.Name = textBoxCountryName.Text;
                 newCountry.Save();
             }
             else
             {
                 country.Name = textBoxCountryName.Text;
                 country.Save();
             }
             country = null;
             textBoxCountryName.Text = "";
             MessageBoxOk1();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.ToString());
         }
     }
 }
Esempio n. 3
0
 private void dataGridViewCountry_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.Button == System.Windows.Forms.MouseButtons.Right)
     {
         if (MessageBoxOk())
         {
             int id = Convert.ToInt32(dataGridViewCountry.Rows[e.RowIndex].Cells[0].Value);
             country = WarehouseBack.Classes.Country.GetCountry(id);
             country.Delete();
         }
     }
 }
Esempio n. 4
0
 private void button_CountryCancel_Click(object sender, EventArgs e)
 {
     country = null;
     textBoxCountryName.Text = "";
 }