public CustomerDetailsPresenter(CustomerDetailsViev view, int id)
 {
     this.view = view;
     if (id < 0)
     {
         customer = new Customer();
     }
     else
     {
         customer = model.GetById(id);
     }
 }
 private void customersGridView_DoubleClick(object sender, EventArgs e)
 {
     GridHitInfo hi = customersGridView.CalcHitInfo(customersGridControl.PointToClient(MousePosition));
     if (hi.InRowCell)
     {
         GridView view = (GridView)sender;
         GridHitInfo info = view.CalcHitInfo(view.GridControl.PointToClient(Control.MousePosition));
         int id = (int)view.GetRowCellValue(info.RowHandle, "Id");
         var form = new CustomerDetailsViev(id);
         form.MdiParent = this.MdiParent;
         form.Show();
     }
 }
示例#3
0
 private void addNewCustomerBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     var form = new CustomerDetailsViev();
     form.MdiParent = this;
     form.Show();
 }