private async void btnAdd_Click(object sender, EventArgs e) { var view = new RetailEquipmentView(_manager, _mainPanel, new RetailEquipment() { Id = 0, }); view.Anchor = Constants.FullScreenStyles; view.Width = _mainPanel.Width; view.Height = _mainPanel.Height; _mainPanel.Controls.Clear(); _mainPanel.Controls.Add(view); }
private async void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == dataGridView1.Columns["col_Edit"].Index) { int id = (int)dataGridView1.Rows[e.RowIndex].Cells[0].Value; var retailEquipment = await _manager.Get <RetailEquipment>("RetailEquipments", id); var view = new RetailEquipmentView(_manager, _mainPanel, retailEquipment); view.Anchor = Constants.FullScreenStyles; view.Width = _mainPanel.Width; view.Height = _mainPanel.Height; _mainPanel.Controls.Clear(); _mainPanel.Controls.Add(view); } }