Esempio n. 1
0
        private void buttonRunRawData_Click(object sender, EventArgs e)
        {
            Login login = new Login();

            if (login.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            try
            {
                Cursor = Cursors.WaitCursor;
                string pc = Pcode;
                if (checkBoxAllPcodes.Checked)
                {
                    pc = "ALL";
                }
                string status = HydrometEditsVMS.RunArchiver(login.Username, login.Password, new string[] { Cbtt }, pc, T1, T2, false);
                FormStatus.ShowStatus(status);
                Logger.WriteLine("", "ui");
            }
            finally
            {
                Cursor = Cursors.Default;
                checkBoxAllPcodes.Checked = false;
            }
        }
Esempio n. 2
0
        private void SaveShift_Click(object sender, System.EventArgs e)
        {
            float?num = null;

            if (this.textBoxDischarge.Text.Trim() != "")
            {
                num = new float?(System.Convert.ToSingle(this.textBoxDischarge.Text));
            }
            float?num2 = null;

            if (this.textBoxGageHeight.Text.Trim() != "")
            {
                num2 = new float?(System.Convert.ToSingle(this.textBoxGageHeight.Text));
            }
            HydrometTools.Login login = new HydrometTools.Login();
            if (login.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                try
                {
                    string text = HydrometEditsVMS.UpdateShift(login.Username, login.Password, this.cbtt.ToUpper().Trim(), this.textBoxPcode.Text.ToUpper().Trim(), (double)System.Convert.ToSingle(this.textBoxNewShift.Text));
                    if (text.ToLower().Contains("error"))
                    {
                        FormStatus.ShowStatus(text, true);
                    }
                    else
                    {
                        FormStatus.ShowStatus(text, false);
                        System.Console.WriteLine(text);
                        double          shift     = System.Convert.ToDouble(this.textBoxNewShift.Text);
                        string          arg_1D9_1 = this.cbtt.ToUpper().Trim();
                        string          arg_1D9_2 = this.textBoxPcode.Text.ToUpper().Trim();
                        System.DateTime arg_1D9_3 = System.Convert.ToDateTime(this.DateMeasured.Text);
                        float?          num3      = num;
                        double?         arg_1D9_4 = num3.HasValue ? new double?((double)num3.GetValueOrDefault()) : null;
                        num3 = num2;
                        Database.InsertShift(arg_1D9_1, arg_1D9_2, arg_1D9_3, arg_1D9_4, num3.HasValue ? new double?((double)num3.GetValueOrDefault()) : null, shift, this.textBoxComments.Text, System.DateTime.Now);
                        Reclamation.Core.BasicDBServer postgresServer = Reclamation.Core.PostgreSQL.GetPostgresServer("", "", "");
                        TimeSeriesName tn = new TimeSeriesName(this.cbtt.ToLower() + "_" + this.textBoxPcode.Text.ToLower(), "instant");
                        TimeSeriesDatabaseDataSet.seriespropertiesDataTable.Set("shift", shift.ToString(), tn, postgresServer);
                        this.ReadShiftTable();
                        this.textBoxPcode.Text      = "";
                        this.textBoxCbtt.Text       = "";
                        this.textBoxDischarge.Text  = "";
                        this.textBoxComments.Text   = "";
                        this.textBoxNewShift.Text   = "";
                        this.textBoxGageHeight.Text = "";
                    }
                }
                catch (System.Exception ex)
                {
                    System.Windows.Forms.MessageBox.Show(ex.Message);
                }
            }
        }
Esempio n. 3
0
        private void buttonRun_Click(object sender, EventArgs e)
        {
            Login login = new Login();

            if (login.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            try
            {
                Cursor = Cursors.WaitCursor;

                int    increment = Convert.ToInt32(this.domainUpDown1.SelectedItem.ToString());
                string status    = HydrometEditsVMS.InsertDayFileValue(login.Username, login.Password, T1, T2, textBoxCbtt.Text, textBoxPcode.Text, 0, increment);
                FormStatus.ShowStatus(status);
                Logger.WriteLine("", "ui");
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }
Esempio n. 4
0
        private void buttonRunRawData_Click(object sender, EventArgs e)
        {
            if (!File.Exists(this.textBoxCbttFilename.Text))
            {
                MessageBox.Show("File does not exist");
                return;
            }

            TextFile tf = new TextFile(this.textBoxCbttFilename.Text);


            Login login = new Login();

            if (login.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            try
            {
                Cursor = Cursors.WaitCursor;
                string pc = Pcode;
                if (checkBoxAllPcodes.Checked)
                {
                    pc = "ALL";
                }

                string status = HydrometEditsVMS.RunArchiver(login.Username, login.Password, tf.FileData, pc, T1, T2, checkBoxPreview.Checked);
                FormStatus.ShowStatus(status);
                Logger.WriteLine("", "ui");
            }
            finally
            {
                Cursor = Cursors.Default;
                checkBoxAllPcodes.Checked = false;
            }
        }