Example #1
0
        public void FireDeleteEntity(WorkingModel c)
         {
             if (ReadOnly) return;
             WorkingModel entity = c;

             if (entity == null) entity = FocusedEntity;

             if (entity != null)
             {
                 //if (IsUsedWorkingModel(entity.ID)) return;

                 if (QuestionMessageYes(GetLocalized("QuestionDeleteLunchModel")))
                 {
                     try
                     {
                         ClientEnvironment.CountryService.WorkingModelService.DeleteByID(entity.ID);
                         _listEntities.Remove(entity);
                         UpdateBarButtonEnable();
                     }
                     catch (ValidationException)
                     {
                         ErrorMessage(GetLocalized("CantDeleteLunchModel"));
                     }
                     catch (EntityException ex)
                     {
                         ProcessEntityException(ex);
                     }

                 }
             }
         }
Example #2
0
         public void FireNewEntity()
         {
             if (ReadOnly) return;
             if (Country == null) return;

             WorkingModel entity = new WorkingModel();
             entity.CountryID = Country.ID;
             entity.WorkingModelType = WorkingModelType.LunchModel; 
             FormLunchModel countryform = new FormLunchModel(entity);
             countryform.Text = GetLocalized("NewLunch");
             countryform.isNew = true;
             if (FocusedEntity != null)
             {
                 countryform.setReadOnlyTypeLunch(FocusedEntity.IsDurationTime);
             }
             if (countryform.ShowDialog() == DialogResult.OK)
             {
                 _listEntities.Add((WorkingModel)countryform.Entity);
                 UpdateBarButtonEnable();
             }

         }
Example #3
0
 public void FireEditEntity(WorkingModel c)
  {
      if (ReadOnly) return;
      WorkingModel entity = c;
      if (entity == null) entity = FocusedEntity;
      if (entity != null)
      {
          FormLunchModel countryform = new FormLunchModel(entity);
          countryform.Text = GetLocalized("editLunch");
          countryform.isNew = false;
          if (FocusedEntity != null && gridViewLunch.RowCount > 1)
          {
              countryform.setReadOnlyTypeLunch(FocusedEntity.IsDurationTime);
          }
          if (countryform.ShowDialog() == DialogResult.OK)
          {
              _listEntities.ResetItemById(entity.ID);
          }
      }
  }
Example #4
0
 public WorkingModelName( long languageID, string name, WorkingModel workingModel )
 {
     this._languageID = languageID;
     this._name = name;
     this._workingModel = workingModel;
 }
Example #5
0
 public WorkingModelName(long languageID, string name, WorkingModel workingModel)
 {
     this._languageID   = languageID;
     this._name         = name;
     this._workingModel = workingModel;
 }
Example #6
0
 public WorkingModelWrapper(WorkingModel model)
 {
     _workingmodel = model;
     BuildConditions ();
 }