Ejemplo n.º 1
0
        private static void Main(string[] args)
        {
            XmlConfigurator.Configure();
            Log.Info("-------------------------- Starting " + NaroAppConstantNames.AppName + " " +
                     NaroAppConstantNames.Version + " session ---------------------------");

            AttemptUpdate(@"UpdateFailed\", @"auxiliary", @"DownloadSucceeded\");
            NaroStartInfo.Instance.Arguments      = args;
            ServicePointManager.Expect100Continue = false;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
#if NO_INSTALLER
            CheckEnvironmentRuntime();

            if (EnvironmentErrorsForm.NoOcc || EnvironmentErrorsForm.NoVcRuntime)
            {
                Application.Run(new EnvironmentErrorsForm());

                if (!EnvironmentErrorsForm.IgnoreErrors)
                {
                    return;
                }
            }
#endif

            ReportingForm form;
            var           fromLastCrash = false;
            do
            {
                CheckEnvironmentRuntime();
                form = null;

                StarterUtils.RunNaroCad(!EnvironmentErrorsForm.NoOcc, fromLastCrash);
                var guardExists = File.Exists(NaroAppConstantNames.GuardFileName);


                var logExists = File.Exists(NaroAppConstantNames.LogFileName);

                if (!guardExists /* || !logExists*/)
                {
                    continue;
                }
                bool sent;
                fromLastCrash = File.Exists(NaroAppConstantNames.AutoSaveFileName);
                do
                {
                    form = new ReportingForm();
                    sent = StarterUtils.SendBugReport(form);
                } while (!sent);
            } while (form != null && form.NaroNeedRestart);
        }
Ejemplo n.º 2
0
 private void reportABugToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ReportingForm form = new ReportingForm();
     form.checkBoxRestart.Checked = false;
     form.checkBoxRestart.Visible = false;
     form.FileNames.Add(NaroAppConstantNames.LogFileName);
     form.FileNames.Add(NaroAppConstantNames.AutoSaveFileName);
     form.ShowDialog();
     if (form.DialogResult == DialogResult.OK)
     {
         var sent = StarterUtils.SendReportToSf(form, form.FileNames);
         if (!sent)
         {
             MessageBox.Show("Error seding the log to internet. There may be internet problems");
         }
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Обработчик события нажатия клавиши мыши на элемент главного меню,
        /// который открывает диалоговое окно предварительного просмотра отчета по стоимости предоставления сервисов
        /// </summary>
        private void стоимостьПредоставленияСервисовToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                var headerText = dg_ServiceDetailInfo.Columns[5].HeaderText;
                BindingList <ServiceDetailInfo> sdi = (BindingList <ServiceDetailInfo>)serviceDetailInfoBindingSource.DataSource;

                if (sdi.Count == 0)
                {
                    MessageBox.Show("Отсутствуют предоставляемые сервисы!");
                    return;
                }

                var reportingForm = new ReportingForm(sdi, headerText);
                reportingForm.ShowDialog();
            }
            catch
            {
                MessageBox.Show("Произошла ошибка при создании отчета!", "Ошибка", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Обработчик события нажатия клавиши мыши на кнопку,
        /// который открывает диалоговое окно предварительного просмотра отчета по текущему простою
        /// </summary>
        private void btn_PrintReport_Click(object sender, EventArgs e)
        {
            var costIdleParams = costIdleParamsBindingSource.DataSource as CostIdleParams;

            if (costIdleParams == null)
            {
                MessageBox.Show("Не удалось получить параметры для расчета простоя!", "Ошибка", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }

            if (costIdleParams.YearIncome <= 0)
            {
                MessageBox.Show("Введите годовой валовой доход компании для расчета стоимости простоя!", "Предупреждение", MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                return;
            }

            if (costIdleParams.TotalEmployeeCount <= 0)
            {
                MessageBox.Show("Введите общее число сотрудников для расчета стоимости простоя!", "Предупреждение", MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                return;
            }

            if (costIdleParams.TotalEmployeeCount < (_disabledUsersCount + _usedAdminsCount))
            {
                MessageBox.Show("Общее число сотрудников должно быть больше количества отключенных и задействованных!", "Предупреждение", MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                return;
            }

            if (costIdleParams.AvgAdminSalary <= 0)
            {
                MessageBox.Show("Введите размер средней часовой оплаты труда администратора для расчета стоимости простоя!", "Предупреждение", MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                return;
            }

            if (costIdleParams.AvgEmployeeSalary <= 0)
            {
                MessageBox.Show("Введите размер средней часовой оплаты труда работника для расчета стоимости простоя!", "Предупреждение", MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                return;
            }

            if (_total <= 0)
            {
                MessageBox.Show("Не расчитана итоговая стоимость простоя!", "Предупреждение", MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                return;
            }

            var sip = new ServiceIdleParams();

            sip.Id                = _serviceIdle.Id;
            sip.Service           = _serviceIdle.Service.ServiceType.Name;
            sip.Platform          = _serviceIdle.Service.PaasType.Name;
            sip.Begin             = _serviceIdle.BeginPeriod;
            sip.End               = _serviceIdle.EndPeriod;
            sip.DurationType      = comboBox_DurationType.Text;
            sip.DurationValue     = txt_Duration.Text;
            sip.IdleType          = _serviceIdle.IdleType.Name;
            sip.IdleReason        = _serviceIdle.IdleReason.Name;
            sip.DisabledEmployees = _disabledUsersCount;
            sip.UsedEmployees     = _disabledUsersCount;
            sip.ServerCost        = _servicePlannedCost;
            sip.LostCost          = _brokenIncome;
            sip.TotalCost         = _total;

            var reportingForm = new ReportingForm(sip);

            reportingForm.ShowDialog();
        }
 /// <summary>
 /// Обработчик события нажатия клавиши мыши на кнопку, 
 /// который открывает диалоговое окно предварительного просмотра отчета заявки
 /// </summary>
 private void btn_PrintReport_Click(object sender, EventArgs e)
 {
     var reportingForm = new ReportingForm(_selectedServiceRequest, InstalledSoftware);
     reportingForm.ShowDialog();
 }