Esempio n. 1
0
        private void SearchBtn_Click_1(object sender, RoutedEventArgs e)
        {
            this.SignPanel.Visibility = Visibility.Collapsed;
            this.SearchPanel.Visibility = Visibility.Visible;
            if (ChannelFactory == null)
            {
                try
                {
                    CreatProxy();
                    channelFlag = 1;
                }
                catch (Exception ex)
                {

                    System.Windows.MessageBox.Show("服务器链接错误,请稍后再试:\n"+ex.Message);
                    return ;
                }
            }
            //初始化查询信息
            searchRecordParam = new SearchRecordParam();
            //实验室列表
            Proxy = ChannelFactory.CreateChannel();
            this.SearchLab.ItemsSource = Proxy.GetLabList();
            //学期列表
            this.SearchTerm.ItemsSource = Proxy.GetTermList();
            Term ct = Proxy.GetCurrentTerm();
            this.SearchTerm.SelectedItem = ct;
            //获取周数列表
            SetSearchWeek(ct.TermID);
            //设置工作日列表
            SetSearchWeekday();
            //设置课节列表
            SetSearchCls();
        }
Esempio n. 2
0
        /// <summary>
        /// 提交查询按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SearchSubmitByn_Click_1(object sender, RoutedEventArgs e)
        {
            if (ChannelFactory == null)
            {
                CreatProxy();
            }
            //获取查询页数
            page = 0;
            SearchRecordParam pm = new SearchRecordParam();
            if (this.SearchTerm.SelectedValue==null)
            {
                pm.term = null;
            }
            else
            {
                pm.term = Convert.ToInt32(this.SearchTerm.SelectedValue);
            }
            if (this.SearchLab.SelectedValue == null)
            {
                pm.lab = null;
            }
            else
            {
                pm.lab = Convert.ToInt32(this.SearchLab.SelectedValue);
            }
            if (this.SearchWeek.Text == null || this.SearchWeek.Text == "")
            {
                pm.week = null;
            }
            else
            {
                pm.week = Convert.ToInt32(this.SearchWeek.Text);
            }
            if (this.SearchWeekday.Text == null || this.SearchWeekday.Text == "")
            {
                pm.weekday = null;
            }
            else
            {
                pm.weekday = Convert.ToInt32(this.SearchWeekday.Text);
            }
            if (Convert.ToInt32(this.SearchCls.SelectedValue) == 0 || (this.SearchCls.SelectedValue) == ""||(this.SearchCls.SelectedValue) == null)
            {
                pm.cls = null;
            }
            else
            {
                pm.cls = Convert.ToInt32(this.SearchCls.SelectedValue);
            }
            pm.page = page;
            pm.pageSize = pageSize;

            Proxy = ChannelFactory.CreateChannel();
            PageRecord pgRecord= Proxy.GetPageRecords(pm);
            this.SearchResultDG.ItemsSource = pgRecord.ExpRecordList;
        }
Esempio n. 3
0
        public PageRecord GetPageRecords(SearchRecordParam pm)
        {
            PageRecord pageRecord = new PageRecord();
            using (JszxDataManager jszxDataManager = new JszxDataManager())
            {
                PageExpRecord _pageRecord = jszxDataManager.GetPageExpRecords(pm.term,pm.lab,pm.week,pm.weekday,pm.cls,pm.teacherNum,pm.page,pm.pageSize);
                foreach(var red in _pageRecord.ExpRecordList){

                    Exprecord exprd = new Exprecord();
                    exprd.CourseName = red.CourseName;
                    exprd.ExpClasses = red.ExpClasses;
                    exprd.ExpCls = red.ExpCls;
                    exprd.ExpDate = red.ExpDate;
                    exprd.ExpLab = red.ExpLab;
                    exprd.ExpLabID = red.ExpLabID;
                    exprd.ExpName = red.ExpName;
                    exprd.ExpTerm = red.ExpTerm;
                    exprd.ExpWeek = red.ExpWeek;
                    exprd.ExpWeekDay = red.ExpWeekDay;
                    exprd.Groups = red.Groups;
                    exprd.InstrumentStatus = red.InstrumentStatus;
                    exprd.PerGroup = red.PerGroup;
                    exprd.PostTime = red.PostTime;
                    exprd.Problems = red.Problems;
                    exprd.Realizer = red.Realizer;
                    exprd.RecordID = red.RecordID;
                    exprd.Shoulder = red.Shoulder;
                    exprd.StudentName = red.StudentName;
                    exprd.StudentStatus = red.StudentStatus;
                    exprd.TeacherName = red.TeacherName;
                    exprd.TeacherNumber = red.TeacherNumber;

                    pageRecord.ExpRecordList.Add(exprd);
                }

                pageRecord.Page = _pageRecord.Page;
                pageRecord.Pages = _pageRecord.Pages;
                pageRecord.PageSize = _pageRecord.PageSize;
            }
            return pageRecord;
        }