コード例 #1
0
        private async void Page_Loaded(object sender, RoutedEventArgs e)
        {
            string usercode = GlobalObjects.currentLoginUser.UserCode;
            IAsyncProxy <ISubSystemModelService> asyncProxySubSystem = await Task.Run(() => ServiceHelper.GetSubSystemService());

            IList <SubSystemDisplayModel> LstSubSystemDisplayModel = await asyncProxySubSystem.CallAsync(c => c.FindSubSystemByUserCode(usercode.Trim()));

            foreach (SubSystemDisplayModel ssdm in LstSubSystemDisplayModel)
            {
                TextBlock tb = new TextBlock();
                tb.TextWrapping = TextWrapping.Wrap;
                tb.Inlines.Add(new Bold(new Run(ssdm.SubSystemName)));
                tb.Inlines.Add(new LineBreak());
                tb.Inlines.Add(new Run(ssdm.Remark));

                Tile tile = new Tile();
                //tile.Content = ssdm.SubSystemName;
                tile.Content  = tb;
                tile.FontSize = 18;
                tile.Tag      = ssdm.SubSystemCode;
                tile.TileType = ssdm.MetroType == "Single" ? TileType.Single : ssdm.MetroType == "Double" ? TileType.Double : TileType.Quadruple;
                BrushConverter brushConverter = new BrushConverter();
                tile.Background         = (Brush)brushConverter.ConvertFromString(ssdm.BackColor);
                tile.MouseLeftButtonUp += tile_MouseLeftButtonUp;



                //考虑如何增加图形
                //Path path = new Path();
                //var gc=new GeometryConverter();
                //path.Data = (Geometry)gc.ConvertFromString("F1 M 26.3223,22.7077L 43.3206,22.7077L 43.3206,27.1212L 31.6976,27.1212L 31.6976,35.2485L 42.535,35.2485L 42.535,39.6624L 31.6976,39.6624L 31.6976,52.1595L 26.3223,52.1595L 26.3223,22.7077 Z M 46.073,52.1595L 46.073,21.1345L 51.491,21.1345L 51.491,52.1595L 46.073,52.1595 Z ");

                MainTileList.Items.Add(tile);
            }
        }
コード例 #2
0
ファイル: CheckStudentWindow.xaml.cs プロジェクト: wpmyj/LC
        private async void btnUnCheck_Click(object sender, RoutedEventArgs e)
        {
            string strErrorMsg = "";

            try
            {
                StudentDisplayModel            sdm = StudentTree.SelectedItem as StudentDisplayModel;
                IAsyncProxy <IScheduleService> scheduleAsyncProxy = await Task.Run(() => ServiceHelper.GetScheduleService());

                await scheduleAsyncProxy.CallAsync(c => c.UnCheckStudent(ScheduleId, sdm.Id, GlobalObjects.currentLoginUser));

                this.ShowAutoCloseDialogOwter(UIResources.MsgInfo, "撤销学员上课记录成功!");
                this.DialogResult = true;
            }
            catch (TimeoutException timeProblem)
            {
                strErrorMsg = timeProblem.Message + UIResources.TimeOut + timeProblem.Message;
            }
            catch (FaultException <LCFault> af)
            {
                strErrorMsg = af.Detail.Message;
            }
            catch (FaultException unknownFault)
            {
                strErrorMsg = UIResources.UnKnowFault + unknownFault.Message;
            }
            catch (CommunicationException commProblem)
            {
                strErrorMsg = UIResources.ConProblem + commProblem.Message + commProblem.StackTrace;
            }
            if (strErrorMsg != string.Empty)
            {
                await DialogManager.ShowMessageAsync(this, UIResources.MsgError, "撤销学员上课记录失败!原因:" + strErrorMsg, MessageDialogStyle.Affirmative, null);
            }
        }
コード例 #3
0
        private async Task bindClassroomList()
        {
            IAsyncProxy <IClassroomService> classroomAyncProxy = await Task.Run(() => ServiceHelper.GetClassroomService());;
            IList <ClassroomModel>          RM = await classroomAyncProxy.CallAsync(c => c.GetAllClassroom());

            this.cmbClassroom.ItemsSource = RM;
        }
コード例 #4
0
        private async Task GetReportResult()
        {
            DateTime startDate = dateStart.SelectedDate.Value;
            DateTime endDate   = dateEnd.SelectedDate.Value;
            int      teacherId = (cmbTeacher.SelectedItem as TeacherModel).Id;
            IAsyncProxy <ITeacherService> _teacherAyncProxy = await Task.Run(() => ServiceHelper.GetTeacherService());

            IList <TeacherClassRecordDetailModel> tcrdml = await _teacherAyncProxy.CallAsync(c => c.FindTeacherClassRecordDetailByDate(startDate, endDate, teacherId));

            Telerik.Reporting.ObjectDataSource objectDataSource = new Telerik.Reporting.ObjectDataSource();
            objectDataSource.DataSource = tcrdml; // GetData returns a DataTable

            //Creating a new report
            Telerik.Reporting.Report report1 = new TeacherClassRecordDetailReport();
            report1.ReportParameters["StartDate"].Value = startDate.ToString("yyyy-MM-dd");
            report1.ReportParameters["EndDate"].Value   = endDate.ToString("yyyy-MM-dd");
            report1.ReportParameters["Teacher"].Value   = cmbTeacher.Text;

            // Assigning the ObjectDataSource component to the DataSource property of the report.
            report1.DataSource = objectDataSource;

            // Use the InstanceReportSource to pass the report to the viewer for displaying
            Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource();
            reportSource.ReportDocument = report1;

            // Assigning the report to the report viewer.
            ReportViewer1.ReportSource = reportSource;

            // Calling the RefreshReport method in case this is a WinForms application.
            ReportViewer1.RefreshReport();
        }
コード例 #5
0
ファイル: EditDeptWindow.xaml.cs プロジェクト: wpmyj/LC
        private async void MetroWindow_Loaded(object sender, RoutedEventArgs e)
        {
            string strErrorMsg = string.Empty;

            try
            {
                asyncProxy = await Task.Run(() => ServiceHelper.GetDepartmentService());
            }
            catch (TimeoutException timeProblem)
            {
                strErrorMsg = timeProblem.Message + UIResources.TimeOut + timeProblem.Message;
            }
            catch (FaultException <LCFault> af)
            {
                strErrorMsg = af.Detail.Message;
            }
            catch (FaultException unknownFault)
            {
                strErrorMsg = UIResources.UnKnowFault + unknownFault.Message;
            }
            catch (CommunicationException commProblem)
            {
                strErrorMsg = UIResources.ConProblem + commProblem.Message + commProblem.StackTrace;
            }
            catch (Exception ex)
            {
                strErrorMsg = ex.Message;
                //AisinoMessageBox.Show(ex.Message, UIResources.MsgInfo, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
            }
            if (strErrorMsg != string.Empty)
            {
                await DialogManager.ShowMessageAsync(this, UIResources.MsgError, "初始化窗体失败!原因:" + strErrorMsg, MessageDialogStyle.Affirmative, null);

                //AisinoMessageBox.Show("创建部门WCF代理失败!原因:" + strMsg, UIResources.MsgError, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
                return;
            }

            if (Om == OperationMode.AddMode)
            {
                this.Title            = "新增部门";
                txtDeptCode.IsEnabled = true;
                chkIsStoped.IsEnabled = false;
                if (IsParent)
                {
                    BindDepartment(null);
                }
                else
                {
                    BindDepartment(SelectSysDepartment);
                }
            }
            else
            {
                this.Title            = "修改部门";
                txtDeptCode.IsEnabled = false;
                txtName.IsEnabled     = false;
                chkIsStoped.IsEnabled = true;
                BindDepartment(SelectSysDepartment);
            }
        }
コード例 #6
0
ファイル: EditClassWindow.xaml.cs プロジェクト: wpmyj/LC
        private async void MetroWindow_Loaded(object sender, RoutedEventArgs e)
        {
            string         strErrorMsg    = string.Empty;
            ClassEditModel classEditModel = new ClassEditModel();

            try
            {
                classTypeAsyncProxy = await Task.Run(() => ServiceHelper.GetClassTypeService());

                classesAsyncProxy = await Task.Run(() => ServiceHelper.GetClassService());

                IList <ClassTypeModel> classTypeLists = await classTypeAsyncProxy.CallAsync(c => c.GetAllClassType());

                this.cmbClassType.ItemsSource = classTypeLists;

                if (this.classTypeId != 0)
                {
                    classTypeModel = await classTypeAsyncProxy.CallAsync(c => c.GetClassTypeById(classTypeId));
                }
            }
            catch (TimeoutException timeProblem)
            {
                strErrorMsg = timeProblem.Message + UIResources.TimeOut + timeProblem.Message;
            }
            catch (FaultException <LCFault> af)
            {
                strErrorMsg = af.Detail.Message;
            }
            catch (FaultException unknownFault)
            {
                strErrorMsg = UIResources.UnKnowFault + unknownFault.Message;
            }
            catch (CommunicationException commProblem)
            {
                strErrorMsg = UIResources.ConProblem + commProblem.Message + commProblem.StackTrace;
            }
            catch (Exception ex)
            {
                strErrorMsg = ex.Message;
            }
            if (strErrorMsg != string.Empty)
            {
                await DialogManager.ShowMessageAsync(this, UIResources.MsgError, "初始化界面失败!原因:" + strErrorMsg, MessageDialogStyle.Affirmative, null);

                return;
            }

            if (Om == OperationMode.AddMode)
            {
                this.Title        = "新增班级";
                txtName.IsEnabled = true;
                BindClassInfo();
            }
            else
            {
                this.Title = "修改班级";
                //txtName.IsEnabled = false;
                BindClassInfo();
            }
        }
コード例 #7
0
        private async void bindUserList()
        {
            userAyncProxy = await Task.Run(() => ServiceHelper.GetUserService());

            roleAyncProxy = await Task.Run(() => ServiceHelper.GetRoleService());

            IList <UserDisplayModel> allUser = await userAyncProxy.CallAsync(u => u.GetAllUser());

            RoleEditModel roleEditModel = await roleAyncProxy.CallAsync(c => c.GetRoleByCode(this._roleDisplayModel.Code));

            for (int i = allUser.Count - 1; i >= 0; i--)
            {
                bool             flag             = true;
                UserDisplayModel userDisplayModel = allUser[i];
                ListViewItem     listViewItem     = new ListViewItem();
                listViewItem.Content = userDisplayModel.Name;
                listViewItem.Tag     = userDisplayModel;
                foreach (UserEditModel sysUser in roleEditModel.SysUsers)
                {
                    if (userDisplayModel.Code == sysUser.UserCode)
                    {
                        this.backUser.Items.Add(listViewItem);
                        flag = false;
                        break;
                    }
                }
                if (flag)
                {
                    this.forceUser.Items.Add(listViewItem);
                }
            }
        }
コード例 #8
0
ファイル: RoleManagerPage.xaml.cs プロジェクト: wpmyj/LC
        private async void btnDeleteRole_Click(object sender, RoutedEventArgs e)
        {
            if (this.listRole.SelectedItems.Count == 0 || this._roleDisplayModel == null)
            {
                await DialogManager.ShowMessageAsync(this.GetMainWindow(), UIResources.MsgInfo, "请选择需要删除的角色!", MessageDialogStyle.Affirmative, null);

                //AisinoMessageBox.Show("没有选择角色,请选择", "提示", MessageBoxButton.OK, MessageBoxImage.Warning, MessageBoxResult.OK);
                return;
            }

            MessageDialogResult result = await DialogManager.ShowMessageAsync(this.GetMainWindow(), UIResources.MsgInfo, "确定删除该角色吗?", MessageDialogStyle.AffirmativeAndNegative, null);

            //MessageBoxResult result = AisinoMessageBox.Show("确定删除该权限吗", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Warning, MessageBoxResult.OK);
            if (result == MessageDialogResult.Affirmative)
            {
                roleAyncProxy = await Task.Run(() => ServiceHelper.GetRoleService());

                foreach (RoleDisplayModel roleDisplayModel in this.listRole.SelectedItems)
                {
                    await roleAyncProxy.CallAsync(d => d.DeleteByCode(roleDisplayModel.Code));
                }
                this._roleDisplayModel = null;
                bindRoleList();
            }
        }
コード例 #9
0
        private async Task bindSchedule()
        {
            IAsyncProxy <ITeacherService> teacherAsyncProxy = await Task.Run(() => ServiceHelper.GetTeacherService());

            TeacherModel tm = await teacherAsyncProxy.CallAsync(t => t.FindTeacherByUserCode(GlobalObjects.currentLoginUser.UserCode));

            this.currentDate = classSchedule.CurrentDate;
            IAsyncProxy <IScheduleService> scheduleAsyncProxy = await Task.Run(() => ServiceHelper.GetScheduleService());

            IList <ScheduleDisplayModel> RM = null;

            if (tm.Id == 0)
            {
                RM = await scheduleAsyncProxy.CallAsync(c => c.FindScheduleByMonth(classSchedule.CurrentDate.ToString("yyyyMM")));
            }
            else
            {
                RM = await scheduleAsyncProxy.CallAsync(c => c.FindScheduleByMonthAndTeacher(classSchedule.CurrentDate.ToString("yyyyMM"), tm.Id));
            }

            if (RM != null)
            {
                ObservableCollection <ScheduleAppointment> appointments = new ObservableCollection <ScheduleAppointment>();
                foreach (ScheduleDisplayModel sdm in RM)
                {
                    ScheduleAppointment sa = new ScheduleAppointment();
                    sa.End           = sdm.EndTime;
                    sa.ScheduleId    = sdm.Id;
                    sa.Start         = sdm.StartTime;
                    sa.TeacherName   = sdm.TeacherName;
                    sa.AssistantName = sdm.AssistantName;
                    sa.ClassroomName = sdm.ClassroomName;
                    sa.ClassId       = sdm.ClassId;
                    sa.Subject       = sdm.ClassName + "\r\n" + sdm.SchemasText;

                    if (sdm.Status == "Normal")
                    {
                        //正常上课状态
                        if (sdm.ClassName.Contains(sdm.TeacherName))
                        {
                            //教师名字与原班级中所含教师名字一致,则显示任为绿色
                            sa.Category = new Category("Green Category", new SolidColorBrush(Colors.Green));
                        }
                        else
                        {
                            //教师名字与原班级名称中所含教师名字不一致
                            //说明代替上课,则显示蓝色
                            sa.Category = new Category("Blue Category", new SolidColorBrush(Colors.Blue));
                        }
                    }
                    else
                    {
                        sa.Category = new Category("Red Category", new SolidColorBrush(Colors.Red));
                    }
                    appointments.Add(sa);
                }

                this.classSchedule.AppointmentsSource = appointments;
            }
        }
コード例 #10
0
        private async void bindRightList()
        {
            rightAyncProxy = await Task.Run(() => ServiceHelper.GetRightService());

            roleAyncProxy = await Task.Run(() => ServiceHelper.GetRoleService());

            IList <RightDisplayModel> allRight = await rightAyncProxy.CallAsync(u => u.GetAllRights());

            RoleEditModel roleEditModel = await roleAyncProxy.CallAsync(c => c.GetRoleByCode(this._roleDisplayModel.Code));

            for (int i = allRight.Count - 1; i >= 0; i--)
            {
                bool flag = true;
                RightDisplayModel rightDisplayModel = allRight[i];
                ListViewItem      listViewItem      = new ListViewItem();
                listViewItem.Content = rightDisplayModel.Name;
                listViewItem.Tag     = rightDisplayModel;
                foreach (RightEditModel sysRight in roleEditModel.SysRights)
                {
                    if (rightDisplayModel.Code == sysRight.RightCode)
                    {
                        this.backRight.Items.Add(listViewItem);
                        flag = false;
                        break;
                    }
                }
                if (flag)
                {
                    this.forceRight.Items.Add(listViewItem);
                }
            }
        }
コード例 #11
0
        private async Task bindConsultantList()
        {
            IAsyncProxy <IConsultantService> ConsultantAsyncProxy = await Task.Run(() => ServiceHelper.GetConsultantService());;
            IList <ConsultantModel>          RM = await ConsultantAsyncProxy.CallAsync(c => c.GetAllConsultant());

            this.cmbConsultant.ItemsSource = RM;
        }
コード例 #12
0
        private async Task bindTeacherList()
        {
            IAsyncProxy <ITeacherService> teacherAsyncProxy = await Task.Run(() => ServiceHelper.GetTeacherService());;
            IList <TeacherModel>          RM = await teacherAsyncProxy.CallAsync(c => c.GetAllTeacher());

            this.cmbTeacher.ItemsSource = RM;
        }
コード例 #13
0
        private async Task bindClassTypeList()
        {
            IAsyncProxy <IClassesService> _classAyncProxy = await Task.Run(() => ServiceHelper.GetClassService());

            IList <ClassDisplayModel> RM = await _classAyncProxy.CallAsync(c => c.GetAllActiveClasses());

            this.gvClasses.ItemsSource = RM.ToList();
        }
コード例 #14
0
ファイル: RoleManagerPage.xaml.cs プロジェクト: wpmyj/LC
        private async void bindRoleList()
        {
            roleAyncProxy = await Task.Run(() => ServiceHelper.GetRoleService());

            IList <RoleDisplayModel> listRoles = await roleAyncProxy.CallAsync(c => c.GetAllRoles());

            this.listRole.ItemsSource = listRoles;
        }
コード例 #15
0
ファイル: CheckMoneyWindow.xaml.cs プロジェクト: wpmyj/LC
        private async Task GetMoney()
        {
            IAsyncProxy <ITeacherService> teacherServiceProxy = await Task.Run(() => ServiceHelper.GetTeacherService());

            IList <TeacherCheckModel> tcmList = await teacherServiceProxy.CallAsync(t => t.GetCheckMonthMoney(this.teacherId));

            this.gvMoney.ItemsSource = tcmList;
        }
コード例 #16
0
        private async void bindCenterList()
        {
            IAsyncProxy <ICenterService> _centerAyncProxy = await Task.Run(() => ServiceHelper.GetCenterService());

            IList <CenterModel> RM = await _centerAyncProxy.CallAsync(c => c.GetAllCenter());

            this.centerList.ItemsSource = RM;
        }
コード例 #17
0
ファイル: TeacherClassRecordDetails.cs プロジェクト: wpmyj/LC
        public async Task <List <TeacherClassRecordDetailModel> > ServiceGetTeacherClassRecordDetails(DateTime startDate, DateTime endDate, int teacherId)
        {
            IAsyncProxy <ITeacherService> _teacherAyncProxy = await Task.Run(() => ServiceHelper.GetTeacherService());

            IList <TeacherClassRecordDetailModel> tcrdml = await _teacherAyncProxy.CallAsync(c => c.FindTeacherClassRecordDetailByDate(new DateTime(2016, 11, 1), new DateTime(2016, 11, 30), 1006));

            return(tcrdml.ToList());
        }
コード例 #18
0
ファイル: EditTeacherWindow.xaml.cs プロジェクト: wpmyj/LC
        private async Task bindStatusList()
        {
            IAsyncProxy <IStatusService> _statusAyncProxy = await Task.Run(() => ServiceHelper.GetStatusService());

            IList <StatusModel> RM = await _statusAyncProxy.CallAsync(c => c.FindStatusByCat(GlobalObjects.TeacherStatus));

            this.cmbStatus.ItemsSource = RM;
        }
コード例 #19
0
        private async void subSystemModelBind()
        {
            this._SubSystemAyncProxy = await Task.Run(() => ServiceHelper.GetSubSystemService());

            IList <SubSystemDisplayModel> subSystemDisplayModelList = await this._SubSystemAyncProxy.CallAsync(g => g.GetAllSubMenu());

            this.ltSubSystem.ItemsSource = subSystemDisplayModelList;
        }
コード例 #20
0
ファイル: EditTeacherWindow.xaml.cs プロジェクト: wpmyj/LC
        private async Task bindSysUserList()
        {
            IAsyncProxy <IUserModelService> sysuserAsyncProxy = await Task.Run(() => ServiceHelper.GetUserService());

            IList <UserDisplayModel> RM = await sysuserAsyncProxy.CallAsync(c => c.GetAllUser());

            this.cmbUser.ItemsSource = RM;
        }
コード例 #21
0
        private async Task GetMoney()
        {
            IAsyncProxy <IConsultantService> consultantServiceProxy = await Task.Run(() => ServiceHelper.GetConsultantService());

            IList <ConsultantCheckModel> tcmList = await consultantServiceProxy.CallAsync(t => t.GetCheckMonthMoney(this.consultantId));

            this.gvMoney.ItemsSource = tcmList;
        }
コード例 #22
0
ファイル: ModuleManagerPage.xaml.cs プロジェクト: wpmyj/LC
        private async void bindModuleList()
        {
            _moduleAyncProxy = await Task.Run(() => ServiceHelper.GetModuleService());

            IList <ModuleDisplayModel> RM = await _moduleAyncProxy.CallAsync(c => c.GetAllModules());

            this.moduleList.ItemsSource = RM;
        }
コード例 #23
0
        private async Task bindSchemasList()
        {
            IAsyncProxy <IClassTypeService> _classtypeAyncProxy = await Task.Run(() => ServiceHelper.GetClassTypeService());

            IList <SchemasEditModel> RM = await _classtypeAyncProxy.CallAsync(c => c.FindSchemasByClassType(selectClassType.Id));

            this.gvSchemas.ItemsSource = RM;
        }
コード例 #24
0
        public async Task <List <ConsultantRecordDetailModel> > ServiceGetConsultantRecordDetails(DateTime startDate, DateTime endDate, int consultantId)
        {
            IAsyncProxy <IConsultantService> _consultantAyncProxy = await Task.Run(() => ServiceHelper.GetConsultantService());

            IList <ConsultantRecordDetailModel> tcrdml = await _consultantAyncProxy.CallAsync(c => c.FindConsultantRecordDetailByDate(new DateTime(2016, 11, 1), new DateTime(2016, 11, 30), 1006));

            return(tcrdml.ToList());
        }
コード例 #25
0
        private async Task bindClassList()
        {
            IAsyncProxy <IClassesService> classesAsyncProxy = await Task.Run(() => ServiceHelper.GetClassService());

            IList <ClassDisplayModel> RM = await classesAsyncProxy.CallAsync(c => c.FindClassByClassType(selectClassType.Id));

            this.gvClasses.ItemsSource = RM;
        }
コード例 #26
0
        private async Task bindClassTypeList()
        {
            IAsyncProxy <IClassTypeService> _classtypeAyncProxy = await Task.Run(() => ServiceHelper.GetClassTypeService());

            IList <ClassTypeModel> RM = await _classtypeAyncProxy.CallAsync(c => c.GetAllClassType());

            this.gvClassTypes.ItemsSource = RM;
        }
コード例 #27
0
        private async Task bindStudentList()
        {
            IAsyncProxy <IStudentService> studentAyncProxy = await Task.Run(() => ServiceHelper.GetStudentService());

            IList <StudentDisplayModel> RM = await studentAyncProxy.CallAsync(c => c.GetAll());

            this.gvStudent.ItemsSource = RM;
        }
コード例 #28
0
ファイル: CheckStudentWindow.xaml.cs プロジェクト: wpmyj/LC
        private async Task bindStudentList()
        {
            IEqualityComparer <StudentDisplayModel> ec = new EntityComparer();
            IAsyncProxy <IScheduleService>          scheduleAsyncProxy = await Task.Run(() => ServiceHelper.GetScheduleService());

            IAsyncProxy <IStudentService> studentAyncProxy = await Task.Run(() => ServiceHelper.GetStudentService());

            ScheduleEditModel sem = await scheduleAsyncProxy.CallAsync(c => c.GetScheduleById(ScheduleId));

            lbClassName.Content   = "ClassName:" + sem.ClassName + "  LessonName:" + sem.LessonName;
            lbClassTime.Content   = "StartTime:" + sem.StartTime.ToString("yyyy-MM-dd HH:mm");
            lbTeacherName.Content = "Teacher:" + sem.TeacherName;

            IList <StudentDisplayModel> RM;

            if (sem.RealDate < DateTime.Now)
            {
                //如果选择的为历史,先获取列表
                RM = studentAyncProxy.Client.FindStudentsByScheduleId(ScheduleId);
                if (RM == null || RM.Count == 0)
                {
                    //说明该课程还没有历史记录,说明没有签到过,则需要根据班级查找
                    RM = studentAyncProxy.Client.FindStudentsByClassId(ClassId);
                }
                else
                {
                    //考虑可能后期维护的时候增加漏掉的新增学员,需要合并列表
                    RM = RM.Union(studentAyncProxy.Client.FindStudentsByClassId(ClassId), ec).ToList();
                }
            }
            else
            {
                //绑定该课程所关联班级所有学生列表
                RM = studentAyncProxy.Client.FindStudentsByClassId(ClassId);
            }
            this.StudentTree.ItemsSource = RM;
            this.StudentTree.ExpandAll();
            //选择当前已经点到学生

            if (sem.AttendedStudentIds != null && sem.AttendedStudentIds.Count > 0)
            {
                foreach (StudentDisplayModel sdm in StudentTree.Items)
                {
                    RadTreeViewItem targetItem = StudentTree.GetItemByPath(sdm.Name);
                    if (sem.AttendedStudentIds.Contains(sdm.Id))
                    {
                        targetItem.IsChecked = true;
                    }
                }
            }

            foreach (StudentDisplayModel sdm in StudentTree.Items)
            {
                RadTreeViewItem targetItem = StudentTree.GetItemByPath(sdm.Name);
                targetItem.ToolTip = sdm.Name + "\r\n" + sdm.Nickname + "\r\n" + sdm.Momsname + "\r\n" +
                                     sdm.Momsphone + "\r\n" + sdm.School + "\r\n" + sdm.Grade + "\r\n" + sdm.ExtraInfo;
            }
        }
コード例 #29
0
        private async void BaseWindow_Loaded(object sender, RoutedEventArgs e)
        {
            string strErrorMsg = string.Empty;

            try
            {
                studentAsyncProxy = await Task.Run(() => ServiceHelper.GetStudentService());

                await bindConsultantList();
                await bindStatusList();
                await bindClassTypeList();
            }
            catch (TimeoutException timeProblem)
            {
                strErrorMsg = timeProblem.Message + UIResources.TimeOut + timeProblem.Message;
            }
            catch (FaultException <LCFault> af)
            {
                strErrorMsg = af.Detail.Message;
            }
            catch (FaultException unknownFault)
            {
                strErrorMsg = UIResources.UnKnowFault + unknownFault.Message;
            }
            catch (CommunicationException commProblem)
            {
                strErrorMsg = UIResources.ConProblem + commProblem.Message + commProblem.StackTrace;
            }
            catch (Exception ex)
            {
                strErrorMsg = ex.Message;
            }
            if (strErrorMsg != string.Empty)
            {
                await DialogManager.ShowMessageAsync(this, UIResources.MsgError, "初始化界面失败!原因:" + strErrorMsg, MessageDialogStyle.Affirmative, null);

                return;
            }

            if (Om == OperationMode.AddMode)
            {
                this.Title = "AddStudent";
                //txtName.IsEnabled = true;
                BindStudentInfo();
            }
            else
            {
                this.Title = "EditStudent";
                IAsyncProxy <IUserModelService> userAsyncProxy = await Task.Run(() => ServiceHelper.GetUserService());

                if (userAsyncProxy.CallAsync(u => u.CheckUserRole(GlobalObjects.currentLoginUser.UserCode, "consultant")).Result)
                {
                    numConsRate.IsEnabled = false;
                }
                BindStudentInfo();
            }
        }
コード例 #30
0
        /// <summary>
        /// 点击删除按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void DeleRight_Click(object sender, RoutedEventArgs e)
        {
            string strErrorMsg = string.Empty;

            try
            {
                if (this.mySelectedElement == null)
                {
                    await DialogManager.ShowMessageAsync(this.GetMainWindow(), UIResources.MsgInfo, "请选择需要删除的权限!", MessageDialogStyle.AffirmativeAndNegative, null);

                    //AisinoMessageBox.Show("请选择要删除的权限", "提示", MessageBoxButton.OK, MessageBoxImage.Warning, MessageBoxResult.OK);
                    return;
                }
                IAsyncProxy <IRightModelService> asyncProxyRight = await Task.Run(() => ServiceHelper.GetRightService());

                //删除提示
                MessageDialogResult result = await DialogManager.ShowMessageAsync(this.GetMainWindow(), UIResources.MsgInfo, "确认删除所选权限吗?", MessageDialogStyle.AffirmativeAndNegative, null);

                //MessageBoxResult result = AisinoMessageBox.Show("确定删除该权限吗", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Warning, MessageBoxResult.OK);
                if (result == MessageDialogResult.Affirmative)
                {
                    await asyncProxyRight.CallAsync(c => c.DeleteByCode(this.mySelectedElement.Code));

                    await this.addRightList();

                    this.mySelectedElement = null;
                    await DialogManager.ShowMessageAsync(this.GetMainWindow(), UIResources.MsgInfo, "删除权限成功!", MessageDialogStyle.Affirmative, null);
                }
            }
            catch (TimeoutException timeProblem)
            {
                strErrorMsg = timeProblem.Message + UIResources.TimeOut + timeProblem.Message;
            }
            catch (FaultException <LCFault> af)
            {
                strErrorMsg = af.Detail.Message;
            }
            catch (FaultException unknownFault)
            {
                strErrorMsg = UIResources.UnKnowFault + unknownFault.Message;
            }
            catch (CommunicationException commProblem)
            {
                strErrorMsg = UIResources.ConProblem + commProblem.Message + commProblem.StackTrace;
            }
            catch (Exception ex)
            {
                strErrorMsg = ex.Message;
                //AisinoMessageBox.Show(ex.Message, UIResources.MsgInfo, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
            }
            if (strErrorMsg != string.Empty)
            {
                await DialogManager.ShowMessageAsync(this.GetMainWindow(), UIResources.MsgError, "修改权限失败!原因:" + strErrorMsg, MessageDialogStyle.Affirmative, null);

                //AisinoMessageBox.Show(strErrorMsg);
            }
        }