Esempio n. 1
0
        private async void DateControl2()
        {
            ScheduleEntity se = new ScheduleEntity()
            {
                id   = cf.userID,
                date = CDateTime.GetDateTimeFormat(DateTime.Now, "yyyymmdd")
            };

            var result3 = Task.Run(() => new CallWebApi().CallPostApiSchedules("scheduleFind", se));

            Schedule scheduleList = JsonConvert.DeserializeObject <Schedule>(await result3);

            cf.scheduleList = new List <AppointmentBusinessObject>();

            foreach (ScheduleEntity _item in scheduleList.scheduleList)
            {
                AppointmentBusinessObject newObject = new AppointmentBusinessObject();
                newObject.Subject = _item.subject;
                newObject.Start   = CDateTime.GetDateFrom_yyyyMMddHHmmss(_item.start);
                newObject.End     = CDateTime.GetDateFrom_yyyyMMddHHmmss(_item.end);
                newObject.Body    = _item.body;

                cf.scheduleList.Add(newObject);
            }
        }
Esempio n. 2
0
        private async void Import()
        {
            _list.Clear();
            ScheduleEntity se = new ScheduleEntity()
            {
                id = cf.userID
            };

            var result = Task.Run(() => new CallWebApi().CallPostApiSchedules("scheduleFind", se));

            Schedule scheduleList = JsonConvert.DeserializeObject <Schedule>(await result);

            var _targerList = scheduleList.scheduleList;

            foreach (ScheduleEntity _item in _targerList)
            {
                AppointmentBusinessObject _object = new AppointmentBusinessObject();
                _object.Subject     = _item.subject;
                _object.Start       = CDateTime.GetDateFrom_yyyyMMddHHmmss(_item.start);
                _object.End         = CDateTime.GetDateFrom_yyyyMMddHHmmss(_item.end);
                _object.Body        = _item.body;
                _object.BOProperty1 = _item._id;

                _list.Add(_object);
            }
        }
Esempio n. 3
0
        private void c1Scheduler1_AppointmentAdded(object sender, C1.WPF.Schedule.AppointmentActionEventArgs e)
        {
            AppointmentBusinessObject newApp = FindMyAppointment((Guid)e.Appointment.Key[0]);

            if (newApp.BOProperty1.Equals(""))
            {
                Import();
            }
        }
Esempio n. 4
0
        private async void showDashBoard()
        {
            try
            {
                WorkEntity we = new WorkEntity()
                {
                    id = cf.userID
                };

                String result   = await new CallWebApi().CallPostApiWorks("workInfoFind", we);
                Works  workList = JsonConvert.DeserializeObject <Works>(result);

                IEnumerable <WorkEntity> totalOverTimeSum = workList.workList
                                                            .Where(w => w.status.Equals("1"))
                                                            .GroupBy(g => g.id)
                                                            .Select(s => new WorkEntity
                {
                    workOver = s.Sum(x => x.workOver)
                });

                if (totalOverTimeSum != null)
                {
                    foreach (WorkEntity _sums in totalOverTimeSum)
                    {
                        lb_totalOverTime.Content = (_sums.workOver / 60).ToString() + "시간 " + (_sums.workOver % 60) + "분";
                    }
                }

                var _targerWorkList = workList.workList
                                      .Where(w => Int32.Parse(w.workDate) >= Int32.Parse(sDate.Content.ToString())
                                             &&
                                             Int32.Parse(w.workDate) <= Int32.Parse(eDate.Content.ToString())
                                             &&
                                             w.status.Equals("1")
                                             ).ToList <WorkEntity>();


                int _totalWorkTime = 0;
                int _totlaOverTime = 0;
                for (int i = 0; i < _targerWorkList.Count; i++)
                {
                    WorkEntity item = _targerWorkList[i];

                    _totalWorkTime += item.workHour;
                    _totlaOverTime += item.workOver;
                }

                _totlaOverTime       = 720 - _totlaOverTime;
                leftOverTime.Content = (_totlaOverTime / 60).ToString() + "시간 " + (_totlaOverTime % 60) + "분";

                lb_workTime.Content = "누적근무시간 : " + (_totalWorkTime / 60).ToString() + "시간 " + (_totalWorkTime % 60) + "분";

                workChart.Value = Math.Round(((double)_totalWorkTime / (52 * 60)) * 100);

                ScheduleEntity se = new ScheduleEntity()
                {
                    id   = cf.userID,
                    date = CDateTime.GetDateTimeFormat(DateTime.Now, "yyyymmdd")
                };

                var result3 = Task.Run(() => new CallWebApi().CallPostApiSchedules("scheduleFind", se));

                Schedule scheduleList = JsonConvert.DeserializeObject <Schedule>(await result3);
                cf.scheduleList = new List <AppointmentBusinessObject>();

                foreach (ScheduleEntity _item in scheduleList.scheduleList)
                {
                    AppointmentBusinessObject newObject = new AppointmentBusinessObject();
                    newObject.Subject = _item.subject;
                    newObject.Start   = CDateTime.GetDateFrom_yyyyMMddHHmmss(_item.start);
                    newObject.End     = CDateTime.GetDateFrom_yyyyMMddHHmmss(_item.end);
                    newObject.Body    = _item.body;

                    cf.scheduleList.Add(newObject);
                }
            }
            catch (Exception ex)
            {
                //MessageBox.Show("관리자에게 문의 부탁드립니다.");
                _vm.ShowError("관리자에게 문의 부탁드립니다.");
            }
        }