示例#1
0
 private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     // adding services to datagrid //
     using (AddServiceForm add_service = new AddServiceForm(null, null)
     {
         service_model = new Services_Model()
     })
     {
         if (add_service.ShowDialog() == DialogResult.OK)
         {
             servicesModelBindingSource2.Add(add_service.service_model);
         }
     }
 }
示例#2
0
        private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            // edit rows in datagrid //
            var row = this.dataGridView1.SelectedRows[0];

            using (AddServiceForm add_service = new AddServiceForm(row.Cells[0].Value.ToString(), row.Cells[1].Value.ToString())
            {
                service_model = new Services_Model()
            })
            {
                if (add_service.ShowDialog() == DialogResult.OK)
                {
                    servicesModelBindingSource2.Add(add_service.service_model);
                }
            }
            linkLabel2_LinkClicked(null, null);
        }