Esempio n. 1
0
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="key"></param>
        /// <param name="startRow"></param>
        /// <returns></returns>
        private List <FSFXData> CopyDataToList(int key, int startRow)
        {
            List <FSFXData> result = new List <FSFXData>();

            try
            {
                // 取最小值 ,保证不越界
                int       endRow = Math.Min(m_mapDataTable[key].Rows.Count, startRow + CDBParams.GetInstance().UIPageRowCount);
                DataTable table  = m_mapDataTable[key];
                for (; startRow < endRow; ++startRow)
                {
                    FSFXData fsfx = new FSFXData();
                    //  rain.RainID = long.Parse(table.Rows[startRow][CN_RainID].ToString());
                    fsfx.StationID   = table.Rows[startRow][CN_StationId].ToString();
                    fsfx.TimeCollect = DateTime.Parse(table.Rows[startRow][CN_DataTime].ToString());
                    if (!table.Rows[startRow][CN_shfx].ToString().Equals(""))
                    {
                        fsfx.shfx = Decimal.Parse(table.Rows[startRow][CN_shfx].ToString());
                    }
                    if (!table.Rows[startRow][CN_shfs].ToString().Equals(""))
                    {
                        fsfx.shfs = Decimal.Parse(table.Rows[startRow][CN_shfs].ToString());
                    }
                    if (!table.Rows[startRow][CN_yxszdshfx].ToString().Equals(""))
                    {
                        fsfx.yxszdshfx = Decimal.Parse(table.Rows[startRow][CN_yxszdshfx].ToString());
                    }
                    if (!table.Rows[startRow][CN_yxszdshfs].ToString().Equals(""))
                    {
                        fsfx.yxszdshfs = Decimal.Parse(table.Rows[startRow][CN_yxszdshfs].ToString());
                    }
                    fsfx.maxTime = DateTime.Parse(table.Rows[startRow][CN_maxTime].ToString());
                    if (!table.Rows[startRow][CN_avg2fx].ToString().Equals(""))
                    {
                        fsfx.avg2fx = Decimal.Parse(table.Rows[startRow][CN_avg2fx].ToString());
                    }
                    if (!table.Rows[startRow][CN_avg2fs].ToString().Equals(""))
                    {
                        fsfx.avg2fs = Decimal.Parse(table.Rows[startRow][CN_avg2fs].ToString());
                    }
                    if (!table.Rows[startRow][CN_avg10fx].ToString().Equals(""))
                    {
                        fsfx.avg10fx = Decimal.Parse(table.Rows[startRow][CN_avg10fx].ToString());
                    }
                    if (!table.Rows[startRow][CN_avg10fs].ToString().Equals(""))
                    {
                        fsfx.avg10fs = Decimal.Parse(table.Rows[startRow][CN_avg10fs].ToString());
                    }
                    if (!table.Rows[startRow][CN_max10fx].ToString().Equals(""))
                    {
                        fsfx.max10fx = Decimal.Parse(table.Rows[startRow][CN_max10fx].ToString());
                    }
                    if (!table.Rows[startRow][CN_max10fs].ToString().Equals(""))
                    {
                        fsfx.max10fs = Decimal.Parse(table.Rows[startRow][CN_max10fs].ToString());
                    }
                    fsfx.max10tm = DateTime.Parse(table.Rows[startRow][CN_max10tm].ToString());
                    fsfx.BState  = 1;
                    //fsfx.ChannelType = CEnumHelper.DBStrToChannelType(table.Rows[startRow][CN_TransType].ToString());
                    //fsfx.MessageType = CEnumHelper.DBStrToMessageType(table.Rows[startRow][CN_MsgType].ToString());


                    //if (!table.Rows[startRow][CN_State].ToString().Equals(""))
                    //{
                    //    // 数据状态
                    //    fsfx.BState = int.Parse(table.Rows[startRow][CN_State].ToString());
                    //}
                    //else
                    //{
                    //    fsfx.BState = 1;
                    //}
                    result.Add(fsfx);
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine("" + e.ToString());
            }
            return(result);
        }
Esempio n. 2
0
 public void AddNewRow(FSFXData obsData)
 {
     throw new NotImplementedException();
 }