Ejemplo n.º 1
0
        public Form_FindData(GatherData pGatherData, StationCode pStationCode, GatherError pGatherError)
        {
            InitializeComponent();
            mGatherData   = pGatherData;
            mStationCode  = pStationCode;
            mGatherError  = pGatherError;
            mGetParaValue = new GetParaValue(pStationCode.Dictionary,
                                             pGatherData.Dictionary, pGatherError.Dictionary);

            this.labelTime.Text = DateTime.Now.ToString();
            InitData();
            Count++;
        }
Ejemplo n.º 2
0
        public string FindGatherErrors(List <GatherError> pGatherErrors)
        {
            try
            {
                command            = new SqlCommand();
                command.Connection = con;
                //command.CommandType = CommandType.Text;
                command.CommandText = "SELECT * FROM [dbo].[gather_currentdata_errors]";
                var abc = command.ExecuteNonQuery();
                if (abc != -1)
                {
                    return("");
                }
                SqlDataReader dataReader = command.ExecuteReader();
                string        str        = "";

                pGatherErrors.Clear();
                while (dataReader.Read())
                {
                    var gatherError = new GatherError();
                    foreach (var name in GatherError.ParaNames)
                    {
                        string temp = dataReader[name].ToString();
                        gatherError.Dictionary[name] = temp;
                        str += temp + " ";
                    }
                    pGatherErrors.Add(gatherError);
                    str += "\r\n";
                }
                dataReader.Close();
                return(str);
            }
            catch
            {
                throw;
                return("Error");
            }
        }