Ejemplo 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);
 }
Ejemplo 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);
                }
            }
        }
Ejemplo 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);
         }
     }
 }
Ejemplo 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();
            }
        }
Ejemplo 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);
                    }
                }
            }
        }
Ejemplo 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();
            }

        }