Esempio n. 1
0
 private Domain.WorkingModel GetEntityByRowHandle(int rowHandle)
 {
     Domain.WorkingModel entity = null;
     if (gridView.IsDataRow(rowHandle))
     {
         entity = (Domain.WorkingModel)gridView.GetRow(rowHandle);
     }
     return(entity);
 }
Esempio n. 2
0
        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);
                }
            }
        }
Esempio n. 3
0
 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);
         }
     }
 }
Esempio n. 4
0
        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();
            }
        }
Esempio n. 5
0
        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);
                    }
                }
            }
        }
Esempio n. 6
0
        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();
            }

        }