Example #1
0
 public static CLiveData updateLiveData(CLiveData cl)
 {
     if (selectLiveDataByIdChild(cl.IdChild) != null)
     {
         removeLiveData(cl);
     }
     return(addLiveData(cl));
 }
Example #2
0
        public static void CheckAttendance(CLiveData liveData)
        {
            string fname = DChildrenManager.selectchildrenById(liveData.IdChild).FirstName;

            sendmail(DUsersManager.selectUserByIdChild(liveData.IdChild).mailAddress, fname);
            //  sendMessage(DUsersManager.selectUserByIdChild(liveData.IdChild).PhoneNum,fname);
            // DLiveDataManager.ChangeStatus(liveData.IdChild, General.Statuses.Sent);
        }
Example #3
0
        public static CLiveData addLiveData(CLiveData cl)
        {
            LiveData l = Mapper.convertToLiveData(cl);

            using (NDBEntities db = new NDBEntities())
            {
                db.LiveData.Add(l);
                db.SaveChanges();
            }
            return(Mapper.convertToCLiveData(l));
        }
Example #4
0
        public static PreviousData converCLiveToPreviousData(CLiveData cl)
        {
            PreviousData p = new PreviousData();

            p.IdChild          = cl.IdChild;
            p.KindergardenCode = cl.KinderGardenCode;
            p.Date             = cl.Date;
            p.Status           = StatusEnumToInt(cl.Status);
            p.UpdateDate       = cl.UpdateDate;
            p.UpdateBy         = cl.UpdateBy;
            p.Alarm            = cl.Alarm;
            p.Comments         = cl.Comments;
            return(p);
        }
Example #5
0
        public static CLiveData convertToCLiveData(LiveData l)
        {
            CLiveData cl = new CLiveData();

            cl.IdChild          = l.IdChild;
            cl.KinderGardenCode = l.KindergardenCode;
            cl.Date             = l.Date;
            cl.Status           = StatusIntToEnum(l.Status);
            cl.UpdateDate       = l.UpdateDate;
            cl.UpdateBy         = l.UpdateBy;
            cl.Alarm            = l.Alarm;
            cl.Comments         = l.Comments;
            return(cl);
        }
Example #6
0
        public static LiveData convertToLiveData(CLiveData cl)
        {
            LiveData l = new LiveData();

            l.IdChild          = cl.IdChild;
            l.KindergardenCode = cl.KinderGardenCode;
            l.Date             = cl.Date;
            l.Status           = StatusEnumToInt(cl.Status);
            l.UpdateDate       = cl.UpdateDate;
            l.UpdateBy         = cl.UpdateBy;
            l.Alarm            = cl.Alarm;
            l.Comments         = cl.Comments;
            return(l);
        }
Example #7
0
 public static void removeLiveData(CLiveData cl)
 {
     using (NDBEntities db = new NDBEntities())
     {
         LiveData l = (from x in db.LiveData
                       where x.IdChild.Equals(cl.IdChild)
                       select x).FirstOrDefault();
         try
         {
             db.LiveData.Remove(l);
             db.SaveChanges();
         }
         catch (Exception)
         {
             throw new allreadyExist();
         }
     }
 }
Example #8
0
        public static void CopyFutureToLiveData()
        {
            List <CFutureData> listCFuture   = DFutureDataManager.selectByToday();
            List <CLiveData>   listCLivaData = selectAllLiveData();

            using (NDBEntities db = new NDBEntities())
            {
                foreach (var item in listCFuture)
                {
                    foreach (var item2 in listCLivaData)
                    {
                        if (item.IdChild.Equals(item2.IdChild))
                        {
                            CLiveData cl = new CLiveData(item.IdChild, item.KinderGardenCode, item.Date, item.Status, item.UpdateDate, item.UpdateBy, item.Alarm, item.Comments);
                            updateLiveData(cl);
                            DFutureDataManager.removeFutureData(item.IdChild);
                        }
                    }
                }
            }
        }
Example #9
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            List <CFutureData> listCF = new List <CFutureData>();

            listCF = BFutureDataManager.readAllFutureData();
            CLiveData c = new CLiveData();
            DateTime  d = new DateTime(2020, 2, 23);

            foreach (var item in listCF)
            {
                if (item.Date.Equals(d))
                {
                    c.IdChild          = item.IdChild;
                    c.KinderGardenCode = item.KinderGardenCode;
                    c.Date             = item.Date;
                    c.UpdateDate       = item.UpdateDate;
                    c.UpdateBy         = item.UpdateBy;
                    c.Alarm            = item.Alarm;
                    c.Comments         = item.Comments;
                    c.Status           = item.Status;
                    //BLiveDataManager.addLiveData(c);
                }
            }
        }
Example #10
0
        public static void CopyChildrenToLiveData()
        {
            List <CChildren> listCChildren = DChildrenManager.selectAllChildren();

            using (NDBEntities db = new NDBEntities())
            {
                foreach (var item in listCChildren)
                {
                    TimeSpan tt = (DKinderGardenManager.selectKinderByCode(item.KinderGardenCode).BeginingHour);
                    TimeSpan tt1;
                    if (tt.Minutes < 30)
                    {
                        tt1 = new TimeSpan(tt.Hours, tt.Minutes + 30, tt.Seconds);
                    }
                    else
                    {
                        tt1 = new TimeSpan(tt.Hours + 1, tt.Minutes - 30, tt.Seconds);
                    }
                    CLiveData d = new CLiveData(item.Id, item.KinderGardenCode, DateTime.Now, General.Statuses.NonPresent, DateTime.Today, "fffff", tt1, null);
                    db.LiveData.Add(Mapper.convertToLiveData(d));
                    db.SaveChanges();
                }
            }
        }
Example #11
0
 public static CLiveData updateLiveData(CLiveData cl)
 {
     return(DLiveDataManager.updateLiveData(cl));
 }
Example #12
0
 public static void removeLiveData(CLiveData cl)
 {
     DLiveDataManager.removeLiveData(cl);
 }
Example #13
0
 public static void addLiveData(CLiveData cl)
 {
     DLiveDataManager.addLiveData(cl);
 }