Esempio n. 1
0
 /// <summary>
 /// Сохранение измененных данных в редактируемом элементе
 /// </summary>
 public void SaveData()
 {
     if (!generalDataAndPerformanceControl.SaveData())
     {
         return;
     }
     try
     {
         currentDirective.Save(true);
         ReloadDirective();
     }
     catch (Exception ex)
     {
         Program.Provider.Logger.Log("Error while saving data", ex);
     }
 }
 protected bool AddNewDirective(bool changePageName)
 {
     if (generalDataAndPerformanceControl.CPCPNumber == "")
     {
         MessageBox.Show("You should enter CPCP Number", new GlobalTermsProvider()["SystemName"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return(false);
     }
     if (generalDataAndPerformanceControl.RepeatInterval == null)
     {
         MessageBox.Show("You should enter Repeat Interval", new GlobalTermsProvider()["SystemName"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return(false);
     }
     if (!generalDataAndPerformanceControl.SaveData(addedDirective, changePageName))
     {
         return(false);
     }
     addedDirective.FirstPerformSinceNew = new Lifelength(generalDataAndPerformanceControl.RepeatInterval);
     parentBaseDetail.Add(addedDirective);
     return(true);
 }