private Domain.WorkingModel GetEntityByRowHandle(int rowHandle) { Domain.WorkingModel entity = null; if (gridView.IsDataRow(rowHandle)) { entity = (Domain.WorkingModel)gridView.GetRow(rowHandle); } return(entity); }
private void gridControl_MouseDoubleClick(object sender, MouseEventArgs e) { if (!isUserWriteRight) { return; } GridHitInfo info = gridView.CalcHitInfo(e.X, e.Y); if (info.InRowCell && gridView.IsDataRow(info.RowHandle)) { Domain.WorkingModel entity = GetEntityByRowHandle(info.RowHandle); if (entity != null) { FireEditEntity(entity); } } }
public void FireEditEntity(Domain.WorkingModel c) { if (ReadOnly) { return; } Domain.WorkingModel entity = c; if (entity == null) { entity = FocusedEntity; } if (entity != null) { WorkingModelForm countryform = new WorkingModelForm(entity); if (countryform.ShowDialog() == DialogResult.OK) { _listEntities.ResetItemById(entity.ID); } } }
public void FireNewEntity() { if (ReadOnly) { return; } if (Country == null) { return; } Domain.WorkingModel entity = new Domain.WorkingModel(); entity.CountryID = Country.ID; WorkingModelForm countryform = new WorkingModelForm(entity); if (countryform.ShowDialog() == DialogResult.OK) { _listEntities.Add((Domain.WorkingModel)countryform.Entity); UpdateBarButtonEnable(); } }
public void FireDeleteEntity(Domain.WorkingModel c) { if (ReadOnly) { return; } Domain.WorkingModel entity = c; if (entity == null) { entity = FocusedEntity; } if (entity != null) { if (IsUsedWorkingModel(entity.ID)) { return; } if (QuestionMessageYes(GetLocalized("QuestionDeleteWorkingModel"))) //"Are you sure to remove working model?")) { try { ClientEnvironment.CountryService.WorkingModelService.DeleteByID(entity.ID); _listEntities.Remove(entity); UpdateBarButtonEnable(); } catch (ValidationException) { ErrorMessage(GetLocalized("CantDeleteWorkingModel")); } catch (EntityException ex) { ProcessEntityException(ex); } } } }
public void FireNewEntity() { if (ReadOnly) return; if (Country == null) return; Domain.WorkingModel entity = new Domain.WorkingModel(); entity.CountryID = Country.ID; WorkingModelForm countryform = new WorkingModelForm(entity); if (countryform.ShowDialog() == DialogResult.OK) { _listEntities.Add((Domain.WorkingModel)countryform.Entity); UpdateBarButtonEnable(); } }