Exemplo n.º 1
0
        /// <summary>
        /// Сохранение измененных данных в редактируемом элементе
        /// </summary>
        public bool SaveData()
        {
/*            string message = "";
 *          if (generalInformationControl.PartNumber == "")
 *          {
 *              GetMessage(ref message, "Part Number");
 *          }
 *          if (generalInformationControl.SerialNumber == "")
 *          {
 *              GetMessage(ref message, "Serial Number");
 *          }
 *          if (generalInformationControl.Description == "")
 *          {
 *              GetMessage(ref message, "Description");
 *          }
 *          if (message != "")
 *          {
 *              MessageBox.Show(message, new TermsProvider()["SystemName"].ToString(), MessageBoxButtons.OK,
 *                              MessageBoxIcon.Exclamation);
 *              return false;
 *          }*/
            _generalDataAndPerformanceControl.Focus();
            if (_baseDetailHeaderControl != null)
            {
                _baseDetailHeaderControl.SaveData();
            }
            _generalDataAndPerformanceControl.SaveData();
            if (_detailWorkParamsControl != null && _detailWorkParamsControl.GetChangeStatus())
            {
                _detailWorkParamsControl.ApplyChanges();
                _detailWorkParamsControl.SaveData();
            }
            _compliancePerformanceControl.SaveData();
            //easaControl.SaveData();
            //if (!currentDetail.InUse)
            //storeControl.SaveData();

            try
            {
                //currentDetail.Save(true);
                if (_currentDetail is BaseDetail)
                {
                    GlobalObjects.ComponentCore.Save(_currentDetail);
                }
                else
                {
                    // ((BaseDetail) currentDetail).ATAChapter = 21;
                    GlobalObjects.ComponentCore.Save(_currentDetail);
                }
            }
            catch (Exception ex)
            {
                Program.Provider.Logger.Log("Error while saving data", ex);
                return(false);
            }
            CancelAsync();
            UpdateDetail(false);
            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Сохранение измененных данных в редактируемом элементе
        /// </summary>
        public bool SaveData()
        {
/*            string message = "";
 *          if (generalInformationControl.PartNumber == "")
 *          {
 *              GetMessage(ref message, "Part Number");
 *          }
 *          if (generalInformationControl.SerialNumber == "")
 *          {
 *              GetMessage(ref message, "Serial Number");
 *          }
 *          if (generalInformationControl.Description == "")
 *          {
 *              GetMessage(ref message, "Description");
 *          }
 *          if (message != "")
 *          {
 *              MessageBox.Show(message, new TermsProvider()["SystemName"].ToString(), MessageBoxButtons.OK,
 *                              MessageBoxIcon.Exclamation);
 *              return false;
 *          }*/
            generalInformationControl.Focus();
            baseDetailHeaderControl.SaveData();
            generalInformationControl.SaveData();
            compliancePerformanceControl.SaveData();
            warrantyControl.SaveData();
            easaControl.SaveData();
            if (!currentDetail.InUse)
            {
                storeControl.SaveData();
            }

            try
            {
                currentDetail.Save(true);
            }
            catch (Exception ex)
            {
                Program.Provider.Logger.Log("Error while saving data", ex);
                return(false);
            }
            UpdateDetail(false);
            return(true);
        }