示例#1
0
        protected bool AddNewDetail(bool changePageName)
        {
            string message = "";

            if (addnewcomponentControl.BaseDetailAddTo == null)
            {
                message += "Please choose base component";
            }
            if (generalInformationControl.PartNumber == "")
            {
                if (message == "")
                {
                    message += "Please fill Part Number";
                }
                else
                {
                    message += " and fill Part Number";
                }
            }
            if (generalInformationControl.ATAChapter == null)
            {
                GetMessage(ref message, "ATA Chapter");
            }
            if (generalInformationControl.MaintenanceType == null)
            {
                GetMessage(ref message, "Maintenance Type");
            }
            if (parametersControl.LandingGearMark && parametersControl.LandingGearMarkType == LandingGearMarkType.None)
            {
                GetMessage(ref message, "Landing Gears");
            }
            if (parametersControl.AvionicsInventoryMark && parametersControl.AvionicsInventoryMarkType == AvionicsInventoryMarkType.None)
            {
                GetMessage(ref message, "Avionics Inventory");
            }
            if (message != "")
            {
                MessageBox.Show(message, new TermsProvider()["SystemName"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }
            else
            {
                generalInformationControl.SaveData(addedDetail, changePageName);
                limitationControl.SaveData(addedDetail);
                parametersControl.SaveData(addedDetail);
                parentDetail = addnewcomponentControl.BaseDetailAddTo;
                parentDetail.Add(addedDetail);
                return(true);
            }
        }
示例#2
0
        /// <summary>
        /// —охранение измененных данных в редактируемом элементе
        /// </summary>
        public void SaveData()
        {
            generalInformationControl.SaveData();
            limitationControl.SaveData();
            parametersControl.SaveData();

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