Ejemplo n.º 1
0
        public static CPreviousData converToCPreviousData(PreviousData p)
        {
            CPreviousData cp = new CPreviousData();

            cp.IdChild          = p.IdChild;
            cp.KinderGardenCode = p.KindergardenCode;
            cp.Date             = p.Date;
            cp.Status           = StatusIntToEnum(p.Status);
            cp.UpdateDate       = p.UpdateDate;
            cp.UpdateBy         = p.UpdateBy;
            cp.Alarm            = p.Alarm;
            cp.Comments         = p.Comments;
            return(cp);
        }
Ejemplo n.º 2
0
        public static void copyLiveToPreviousData()
        {
            CPreviousData    cp            = new CPreviousData();
            List <CLiveData> listCLiveData = DLiveDataManager.selectAllLiveData();

            using (NDBEntities db = new NDBEntities())
            {
                foreach (var item in listCLiveData)
                {
                    db.PreviousData.Add(Mapper.converCLiveToPreviousData(item));
                    //     db.LiveData.Remove(Mapper.convertToLiveData(item));
                    db.SaveChanges();
                }
            }
        }