Esempio n. 1
0
 private void UploadAllReport(object sender, EventArgs e)
 {
     if (isDataSet)
     {
         var waitForm = new WaitForm(this);
     }
 }
Esempio n. 2
0
        private void UploadReport(object sender, EventArgs e)
        {
            var waitForm = new WaitForm(this);

            try
            {
                waitForm.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ошибка при загрузке", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 3
0
        public async void upload(WaitForm f)
        {
            var r = await HttpController.UploadReport(data[index], Program.periods[form.periodList.SelectedIndex]);

            f.Close();
            if (!r.ContainsKey("create") || !r.ContainsKey("edit"))
            {
                MessageBox.Show("Произшла ошибка!");
            }
            else
            if ((r.ContainsKey("create") && r["create"].code == System.Net.HttpStatusCode.OK) &&
                (r.ContainsKey("edit") && r["edit"].code == System.Net.HttpStatusCode.OK))
            {
                MessageBox.Show("Отчет загружен успешно");
            }
            else
            {
                MessageBox.Show("Произшла ошибка!");
            }
        }
Esempio n. 4
0
        public async void upload(WaitForm f)
        {
            var errors = new List <String>();

            Cursor = Cursors.WaitCursor;
            foreach (var h in data)
            {
                try
                {
                    var r = await HttpController.UploadReport(h, Program.periods[periodList.SelectedIndex]);

                    if (!r.ContainsKey("create") || !r.ContainsKey("edit"))
                    {
                        errors.Add(h.House);
                    }
                    else
                    if ((r.ContainsKey("create") && r["create"].code != System.Net.HttpStatusCode.OK) ||
                        (r.ContainsKey("edit") && r["edit"].code != System.Net.HttpStatusCode.OK))
                    {
                        errors.Add(h.House);
                    }
                }catch (Exception e)
                {
                    errors.Add(h.House);
                }
            }
            Cursor = Cursors.Arrow;
            f.Close();
            if (errors.Count == 0)
            {
                MessageBox.Show("Отчеты загружены успешно");
            }
            else
            {
                var form = new ErrorForm(errors);
                form.ShowDialog();
            }
        }