Exemplo n.º 1
0
        public List <Data> GetDataByDate(DateTime DateTest)
        {
            ClayEntities MaClayEntities = new ClayEntities();
            List <Data>  ListData       = new List <Data>();

            foreach (var a in MaClayEntities.Data)
            {
                if (a.date == DateTest)
                {
                    ListData.Add(a);
                }
            }

            return(ListData);
        }
Exemplo n.º 2
0
        public void SetData(List <Data> ListDataInsert)
        {
            ClayEntities MaClayEntities  = new ClayEntities();
            List <Data>  ListDataCompare = GetAllData();

            if (ListDataCompare.Count == 0)
            {
                foreach (var c in ListDataInsert)
                {
                    MaClayEntities.Data.Add(c);
                }
            }
            foreach (var b in ListDataInsert)
            {
                if (!isInList(ListDataCompare, b))
                {
                    MaClayEntities.Data.Add(b);
                }
            }
            MaClayEntities.SaveChanges();
        }
Exemplo n.º 3
0
        public List <Data> GetAllData()
        {
            ClayEntities MaClayEntities = new ClayEntities();

            return(MaClayEntities.Data.ToList());
        }