/// <summary>
 /// 加载数据。
 /// </summary>
 /// <param name="teacherID"></param>
 /// <param name="catalogID"></param>
 /// <param name="classID"></param>
 private void LoadData(string teacherID,string catalogID, string classID)
 {
     if (!string.IsNullOrEmpty(teacherID) && !string.IsNullOrEmpty(catalogID) && !string.IsNullOrEmpty(classID))
     {
         this.store = LocalStudentWorkStore.DeSerializer(teacherID, catalogID, classID);
         if ((this.btnSave.Enabled = (this.store != null)))
         {
             Tools.SetEvaluateToWin(this.cbbReviewValue, this.store.Evaluate, new ToolTipHandler(delegate(Control ctrl, string tooltip)
             {
                 this.OnToolTipEvent(ctrl, tooltip);
             }));
             this.thumbnailsControls = BuildThumbnails(this.store, new EventHandler(delegate(object sender, EventArgs e)
             {
                 ThumbnailsControl tc = sender as ThumbnailsControl;
                 if (tc != null && this.store != null)
                 {
                     ModifyWorkDetailsWindow mw = new ModifyWorkDetailsWindow(this.CoreService, this.store, tc.StudentID);
                     mw.StartPosition = FormStartPosition.CenterParent;
                     UserInfo info = this.UserInfo;
                     if (mw.ShowDialog(this) == DialogResult.OK && info != null)
                     {
                         this.LoadData(info.UserID, this.catalogID, this.classID);
                     }
                 }
             }));
             if (this.thumbnailsControls != null) ThumbnailsDrawToPanel(this.thumbnailsControls, this.panelWork);
         }
     }
 }
Пример #2
0
 /// <summary>
 /// 触发列表数据。
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void listView_ItemActivate(object sender, EventArgs e)
 {
     try
     {
         ListView lv = sender as ListView;
         if (lv != null && lv.SelectedItems != null && lv.SelectedItems.Count > 0 && this.store != null && this.students != null)
         {
             ModifyWorkDetailsWindow win = new ModifyWorkDetailsWindow(this.CoreService, this.store, string.Format("{0}", lv.SelectedItems[0].Tag));
             win.StartPosition = FormStartPosition.CenterScreen;
             if (win.ShowDialog(this) == DialogResult.OK)
             {
                 this.btnQuery_Click(this.btnQuery, e);
             }
         }
     }
     catch (Exception x)
     {
         Program.GlobalExceptionHandler(x);
     }
 }