Esempio n. 1
0
 /// <summary>
 /// Сохранаяет данные текущего базового агрегата
 /// </summary>
 public void SaveData()
 {
     if (currentBaseDetail == null)
     {
         return;
     }
     if (textBoxEngineModel.Text != currentBaseDetail.Model)
     {
         currentBaseDetail.Model = textBoxEngineModel.Text;
     }
     if (textBoxManufacturer.Text != currentBaseDetail.Manufacturer)
     {
         currentBaseDetail.Manufacturer = textBoxManufacturer.Text;
     }
     if (textBoxPosition.Text != currentBaseDetail.PositionNumber)
     {
         TransferRecord transferRecord = currentBaseDetail.GetLastTransferRecord();
         transferRecord.Position = textBoxPosition.Text;
         transferRecord.Save();
     }
     if (textBoxSerialNumber.Text != currentBaseDetail.SerialNumber)
     {
         currentBaseDetail.SerialNumber = textBoxSerialNumber.Text;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Сохранаяет данные о шасси
 /// </summary>
 public void SaveData()
 {
     if (currentGearAssembly == null)
     {
         return;
     }
     if (textBoxManufacturer.Text != currentGearAssembly.Manufacturer)
     {
         currentGearAssembly.Manufacturer = textBoxManufacturer.Text;
     }
     if (textBoxPosition.Text != currentGearAssembly.PositionNumber)
     {
         TransferRecord transferRecord = currentGearAssembly.GetLastTransferRecord();
         transferRecord.Position = textBoxPosition.Text;
         transferRecord.Save();
     }
     if (textBoxPartNumber.Text != currentGearAssembly.PartNumber)
     {
         currentGearAssembly.PartNumber = textBoxPartNumber.Text;
     }
     if (textBoxSerialNumber.Text != currentGearAssembly.SerialNumber)
     {
         currentGearAssembly.SerialNumber = textBoxSerialNumber.Text;
     }
     if (textBoxMTOGW.Text != currentGearAssembly.MTOGW)
     {
         currentGearAssembly.MTOGW = textBoxMTOGW.Text;
     }
 }
Esempio n. 3
0
        private void MoveDetailToBaseDetail(AbstractDetail detail)
        {
            TransferRecord transferRecord = new TransferRecord();

            transferRecord.Description = textBoxRemarks.Text;
            transferRecord.RecordDate  = dateTimePickerDate.Value;
            transferRecord.Position    = textBoxPosition.Text;
            transferRecord.Reference   = textBoxReference.Text;
            //transferRecord.AttachedFile = fileControl.AttachedFile;

            if (detail is Detail)
            {
                ((Detail)detail).MoveDetail((BaseDetail)comboBoxBaseDetails.SelectedItem, transferRecord);
            }
            if (detail is BaseDetail)
            {
                ((BaseDetail)detail).MoveBaseDetail(checkedBaseDetailContainer, transferRecord);
            }
            if (fileControl.AttachedFile != null)
            {
                transferRecord.AttachedFile.FileData = fileControl.AttachedFile.FileData;
                transferRecord.AttachedFile.FileName = fileControl.AttachedFile.FileName;
                transferRecord.Save(true);
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Данные работы обновляются по введенным значениям
 /// </summary>
 private bool SaveData()
 {
     if (currentRecord.Position != textBoxToAdditional.Text)
     {
         currentRecord.Position = textBoxToAdditional.Text;
     }
     if (fileControl.AttachedFile != currentRecord.AttachedFile)
     {
         currentRecord.AttachedFile.FileName = fileControl.AttachedFile.FileName;
         currentRecord.AttachedFile.FileData = fileControl.AttachedFile.FileData;
     }
     if (currentRecord.Description != textBoxRemarks.Text)
     {
         currentRecord.Description = textBoxRemarks.Text;
     }
     try
     {
         currentRecord.Save(true);
         if (RecordChanged != null)
         {
             RecordChanged(this, EventArgs.Empty);
         }
     }
     catch (Exception ex)
     {
         Program.Provider.Logger.Log("Error while saving data", ex);
         return(false);
     }
     return(true);
 }