private void Client_ReceivedDataSetResult(object sender, TcpCore.ReceivedDataSetResultEventArgs e)
        {
            if (!e.Result.Success)
            {
                Debug.Error("서버로부터 데이터를 수신하는데 실패하였습니다.");
            }

            if (RecentAttReq.Equals(e.Result.Requirement))
            {
                this.Dispatcher.Invoke(() =>
                {
                    // 출석부가 존재함. 준비 완료.
                    if (e.Result.Data.Tables[0].Rows.Count > 0)
                    {
                        ProcessAndShowData(e.Result.Data.Tables[0]);

                        this.IsEnabled = true;

                        ToExcel.IsEnabled          = true;
                        ToExcel_Selected.IsEnabled = true;
                    }
                    // 출석부가 존재하지 않음. 근태 불량자가 없는것으로 취급.
                    else
                    {
                        ProcessAndShowData(null);
                        this.IsEnabled = true;

                        ToExcel.IsEnabled          = false;
                        ToExcel_Selected.IsEnabled = false;
                    }
                });
            }
        }
Example #2
0
        private void Client_ReceivedDataSetResult(object sender, TcpCore.ReceivedDataSetResultEventArgs e)
        {
            if (!e.Result.Success)
            {
                Debug.Error("서버로부터 데이터를 수신하는데 실패하였습니다.");
            }

            if (RecentAttReq.Equals(e.Result.Requirement))
            {
                this.Dispatcher.Invoke(() =>
                {
                    // 출석부 조회 성공.
                    if (e.Result.Data.Tables[0].Rows.Count > 0)
                    {
                        ShowFaultsList(e.Result.Data.Tables[0]);
                        this.IsEnabled = true;
                    }
                    // 출석부가 존재하지 않음. 벌점이 없는것으로 처리.
                    else
                    {
                        ShowEmptyFaultsList();
                        this.IsEnabled = true;
                    }
                });

                return;
            }

            if (RecentStuListReq.Equals(e.Result.Requirement))
            {
                this.Dispatcher.Invoke(() =>
                {
                    // 학생 목록을 가져왔음.
                    if (e.Result.Data.Tables[0].Rows.Count > 0)
                    {
                        ShowStuList(e.Result.Data.Tables[0]);
                        this.IsEnabled = true;

                        ToExcel.IsEnabled = true;

                        mFaultsTable?.Clear();
                    }
                    // 학생 목록 없음. 출석부 조회 불가.
                    else
                    {
                        ParentWindow.Dispatcher.Invoke(() => MessageBox.Show("서버에 기간에 맞는 학급 학생명단이 입력되지 않았습니다.", "학생 명단 없음", MessageBoxButton.OK, MessageBoxImage.Warning));
                        this.IsEnabled = true;

                        ToExcel.IsEnabled = true;
                    }
                });

                return;
            }
        }
        private void Client_ReceivedDataSetResult(object sender, TcpCore.ReceivedDataSetResultEventArgs e)
        {
            if (!e.Result.Success)
            {
                Debug.Error("서버로부터 데이터를 수신하는데 실패하였습니다.");
            }

            if (RecentAttReq.Equals(e.Result.Requirement))
            {
                this.Dispatcher.Invoke(() =>
                {
                    // 출석부 조회 성공.
                    if (e.Result.Data.Tables[0].Rows.Count > 0)
                    {
                        if (mLoading != null)
                        {
                            mLoading.SetMainText("벌점 정보 추출 중...");
                        }

                        ImportData(e.Result.Data.Tables[0]);

                        StuDataGrid.DataContext = mStudents;
                        if (mLoading != null)
                        {
                            mLoading.Dispatcher.Invoke(() => mLoading.Close());
                        }

                        this.IsEnabled    = true;
                        ToExcel.IsEnabled = true;
                    }
                    else
                    {
                        ParentWindow.Dispatcher.Invoke(() => MessageBox.Show(ParentWindow, "벌점이 있는 학생이 없습니다.", "근태 불량자 없음", MessageBoxButton.OK, MessageBoxImage.Information));

                        if (mLoading != null)
                        {
                            mLoading.Dispatcher.Invoke(() => mLoading.Close());
                        }
                        ;
                        this.IsEnabled = true;
                    }
                });

                return;
            }
        }