Exemplo n.º 1
0
        public List <HisDatabase> GetHisDatabases()
        {
            List <HisDatabase>      fake = new List <HisDatabase>();
            List <HisDataBaseModel> hisDataBaseModels = BodSqliteHelp.SelectHisData();

            foreach (var item in hisDataBaseModels)
            {
                HisDatabase hisDatabase = new HisDatabase();
                item.CopyToHisDatabase(hisDatabase);
                fake.Add(hisDatabase);
            }
            return(fake);
        }
Exemplo n.º 2
0
 public void CopyToHisDatabase(HisDatabase hisDatabase)
 {
     hisDatabase.Id                 = id;
     hisDatabase.HumidityData       = (float)Humidity;
     hisDatabase.PHData             = (float)PH;
     hisDatabase.TemperatureData    = (float)Temperature;
     hisDatabase.TurbidityData      = (float)Turbidity;
     hisDatabase.Uv254Data          = (float)Uv254;
     hisDatabase.AirTemperatureData = (float)AirTemperature;
     hisDatabase.Bod                = (float)Bod;
     hisDatabase.BodElePot          = (float)BodElePot;
     hisDatabase.BodElePotDrop      = (float)BodElePotDrop;
     hisDatabase.CodData            = (float)Cod;
     hisDatabase.CreateDate         = CreateDate;
     hisDatabase.CreateTime         = CreateTime;
     hisDatabase.DoData             = (float)DO;
 }
Exemplo n.º 3
0
        public void AddData(HisDatabase hisDatabase)
        {
            try
            {
                hisDatabase.Id = AllHisData.Count + 1;
                _source.Add(hisDatabase);
                AllHisData.Add(hisDatabase);
                int LastTotalPage = TotalPage;

                int index = _source.Count % PageSize;
                if (index > 0)
                {
                    TotalPage = _source.Count / PageSize + 1;
                }
                else
                {
                    TotalPage = _source.Count / PageSize;
                }

                if (CurrentPage != LastTotalPage)
                {
                    return;
                }

                if (CurrentPage == LastTotalPage)
                {
                    if (_fakeSoruce.Count < PageSize)
                    {
                        _fakeSoruce.Add(hisDatabase);
                    }
                    else
                    {
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                LogUtil.LogError(ex);
            }
        }