/// <summary>
        /// 上传学生作业。
        /// </summary>
        /// <param name="swp"></param>
        /// <param name="err"></param>
        /// <returns></returns>
        public bool UploadStudentWorks(WorkUploadToServer.StudentWorkUpload swp, out string err)
        {
            err = null;
            bool result = false;
            try
            {
                string msg = null;
                this.RaiseChanged(msg = "开始装载上传学生作业...");
                swp.Progress.UpdateProgressToolTipMessage(msg);

                #region 装载上传作业。

                Impl.StudentWorkTeaUpload upload = new Impl.StudentWorkTeaUpload();
                upload.Student = new Impl.Student();
                upload.Student.StudentID = swp.Student.StudentID;
                upload.Student.StudentCode = swp.Student.StudentCode;
                upload.Student.StudentName = swp.Student.StudentName;

                upload.WorkID = swp.Student.Work.WorkID;
                upload.WorkName = swp.Student.Work.WorkName;

                upload.Type = (Impl.EnumWorkType)((int)swp.Student.Work.Type);
                upload.Time = DateTime.Now;
                upload.Status = (Impl.EnumWorkStatus)((int)swp.Student.Work.Status);

                if (swp.Student.Work.Review != null)
                {
                    upload.Review = new Impl.TeacherReview();
                    upload.Review.TeacherID = swp.Student.Work.Review.TeacherID;
                    upload.Review.TeacherName = swp.Student.Work.Review.TeacherName;
                    upload.Review.EvaluateType = (Impl.EnumEvaluateType)((int)swp.Store.Evaluate.Type);
                    upload.Review.ReviewValue = swp.Student.Work.Review.ReviewValue;
                    upload.Review.SubjectiveReviews = swp.Student.Work.Review.SubjectiveReviews;

                    if ((upload.Status & Impl.EnumWorkStatus.Review) != Impl.EnumWorkStatus.Review)
                    {
                        upload.Status |= Impl.EnumWorkStatus.Review;
                        this.RaiseChanged(msg = "标记作业已批阅");
                        swp.Progress.UpdateProgressToolTipMessage(msg);
                    }
                }

                upload.GradeID = swp.Store.GradeID;
                upload.ClassID = swp.Store.ClassID;

                upload.CatalogID = swp.Store.CatalogID;
                upload.CatalogName = swp.Store.CatalogName;

                upload.Files = new Impl.StudentWorkFile();
                upload.Files.ContentType = "application/x-zip-compressed";
                upload.Files.FileID = upload.WorkID;
                upload.Files.FileName = upload.WorkName + ".zip";
                upload.Files.FileExt = ".zip";

                byte[] data = swp.LoadZipFiles(out err);
                if (data == null || data.Length == 0)
                {
                    if (string.IsNullOrEmpty(err)) err = "获取作业数据时发生未知异常!";
                    this.RaiseChanged(err);
                    return result;
                }

                upload.CheckCode = UtilTools.SummaryEncry(data);
                this.RaiseChanged(msg = "完成上传作业装载.");
                swp.Progress.UpdateProgressToolTipMessage(msg);
                #endregion

                swp.Progress.ProgressMaximum = data.Length;
                upload.Files.OffSet = 0;
                string info = string.Format("[{0},{1}]", upload.Student.StudentName, upload.WorkName);
                this.RaiseChanged(msg = info + "开始分段上传作业,请稍后...");
                swp.Progress.UpdateProgressToolTipMessage(msg);
                using (MemoryStream ms = new MemoryStream(data))
                {
                    result = true;
                    byte[] buf = new byte[1024];
                    int count = 0;
                    while ((count = ms.Read(buf, 0, buf.Length)) > 0)
                    {
                        if (count < buf.Length)
                        {
                            byte[] array = new byte[count];
                            Array.Copy(buf, array, count);
                            upload.Files.Data = array;
                        }
                        else
                        {
                            upload.Files.Data = buf;
                        }
                        Impl.CallResult callback = this.poxy.UploadStudentWorks(upload);
                        if (callback == null || callback.ResultCode < 0)
                        {
                            err = callback == null ? "服务无响应!" : callback.ResultMessage;
                            result = false;
                            swp.Progress.UploadFailure(err);
                            break;
                        }
                        swp.Progress.UpdateProgress(count);
                        upload.Files.OffSet += count;
                        System.Threading.Thread.Sleep(20);
                        ms.Seek(upload.Files.OffSet, SeekOrigin.Begin);
                    }
                }
                this.RaiseChanged(msg = info + "分段上传完成[" + (result ? "成功" : "失败[" + err + "]") + "]");
                swp.Progress.UpdateProgressToolTipMessage(msg);
            }
            catch (Exception e)
            {
                result = false;
                swp.Progress.UploadFailure(err = e.Message);
            }
            return result;
        }
 /// <remarks/>
 public void UploadStudentWorksAsync(StudentWorkTeaUpload data, object userState)
 {
     if ((this.UploadStudentWorksOperationCompleted == null))
     {
         this.UploadStudentWorksOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUploadStudentWorksOperationCompleted);
     }
     this.InvokeAsync("UploadStudentWorks", new object[] {
             data}, this.UploadStudentWorksOperationCompleted, userState);
 }
 public CallResult UploadStudentWorks(StudentWorkTeaUpload data)
 {
     object[] results = this.Invoke("UploadStudentWorks", new object[] {
             data});
     return ((CallResult)(results[0]));
 }
 /// <remarks/>
 public void UploadStudentWorksAsync(StudentWorkTeaUpload data)
 {
     this.UploadStudentWorksAsync(data, null);
 }
 /// <remarks/>
 public System.IAsyncResult BeginUploadStudentWorks(StudentWorkTeaUpload data, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("UploadStudentWorks", new object[] {
             data}, callback, asyncState);
 }