Ejemplo n.º 1
0
        protected bool Save()
        {
            if (view == OperatorScreenView.Add && operatorControl.OperatorName == "")
            {
                MessageBox.Show("Please fill operator name", (string)new TermsProvider()["SystemName"], MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }

            if (operatorControl.GetChangeStatus())
            {
                operatorControl.SaveData();

                try
                {
                    if (view == OperatorScreenView.Edit)
                    {
                        currentOperator.Save();
                    }
                    else
                    {
                        OperatorCollection.Instance.Add(currentOperator);
                    }
                }
                catch (Exception ex)
                {
                    Program.Provider.Logger.Log("Error while saving data", ex);
                    return(false);
                }
            }
            return(true);
        }
Ejemplo n.º 2
0
        private bool Save()
        {
            if (OperatorControl.OperatorName == "")
            {
                MessageBox.Show("Please fill operator name", (string)new GlobalTermsProvider()["SystemName"], MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }

            if (OperatorControl.GetChangeStatus())
            {
                OperatorControl.SaveData();

                try
                {
                    GlobalObjects.CasEnvironment.NewKeeper.Save(CurrentOperator);
                }
                catch (Exception ex)
                {
                    Program.Provider.Logger.Log("Error while saving data", ex);
                    return(false);
                }

                MessageBox.Show("Saving was successful", "Message infomation", MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
            }
            return(true);
        }
Ejemplo n.º 3
0
 private void HeaderControl1ReloadRised(object sender, EventArgs e)
 {
     if (OperatorControl.GetChangeStatus())
     {
         if (MessageBox.Show("All unsaved data will be lost. Are you sure you want to continue?", (string)new GlobalTermsProvider()["SystemName"], MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
         {
             OperatorControl.UpdateInformation();
         }
     }
     else
     {
         OperatorControl.UpdateInformation();
     }
 }