Esempio n. 1
0
 private void Show_Button_Click(object sender, EventArgs e)
 {
     if (Requests_DataGridView.CurrentRow == null)
     {
         Alert.DisplayError("No item selected!");
         return;
     }
     try
     {
         Request request = new Request();
         request.id_request = (int)Requests_DataGridView.CurrentRow.Cells[0].Value;
         request            = ManagerService.GetRequests(request).SingleOrDefault();
         RequestEditor requestEditor = new RequestEditor(request);
         requestEditor.ShowDialog();
     } catch (ServiceException exc)
     {
         Alert.DisplayError(exc.Message);
     }
 }
Esempio n. 2
0
 private void AddRequest_Button_Click(object sender, EventArgs e)
 {
     if (Objects_DataGridView.CurrentRow == null)
     {
         Alert.DisplayError("No item selected!");
         return;
     }
     DataLayer.Object obj = new DataLayer.Object();
     obj.id_object = (int)Objects_DataGridView.CurrentRow.Cells[0].Value;
     try
     {
         obj = ManagerService.GetObjects(obj).SingleOrDefault();
         RequestEditor requestEditor = new RequestEditor(obj);
         requestEditor.ShowDialog();
     }
     catch (ServiceException exc)
     {
         Alert.DisplayError(exc.Message);
     }
 }