Esempio n. 1
0
        /// <summary>
        /// 加载学生历史笔记
        /// </summary>
        /// <param name="practiceRecordId"></param>
        /// <param name="studentId"></param>
        internal void LoadHistoryHandwriting(string practiceRecordId)
        {
            Loaded += (a, b) =>
            {
                mUCPage.PenLoaded += (s, e) =>
                {
                    this.UIAsync(() =>
                    {
                        mQuestionRecordList = APP.IDatas.ErPaperPracticeRecordQuestionSealUp.Where(m => m.paper_practice_record_id == practiceRecordId).Select(m => new QuestionRecordItem()
                        {
                            QuestionRecordID = m.id,
                            QuestionID       = m.source_question_id,
                            PracticeRecordID = m.paper_practice_record_id
                        }).ToList();

                        mPageData.IsShowPager = mQuestionRecordList.Count > 0;
                        if (mPageData.IsShowPager)
                        {
                            mPageData.Pager.PageIndex = 0;
                            mPageData.Pager.PageCount = MSUtils.GetPageCount(mQuestionRecordList.Count, 1);
                            this.UICall(RefreshPagerButton);
                        }
                        else
                        {
                            this.UICall(() =>
                            {
                                this.ShowMessageError("没有练习记录.");
                                this.Close();
                            });
                        }
                    });
                };
            };
            this.Show();
        }
Esempio n. 2
0
        static MSConfig()
        {
            var path = MSUtils.GetMapPath(filename);

            ini       = Helpers.IniHelper.Open(path);
            db_server = read("DB", "SERVER", "localhost");
            db_port   = read("DB", "PORT", 3306);
            db_name   = read("DB", "NAME", "lw_mlpen");
            db_user   = read("DB", "USER", "root");
            db_pwd    = read("DB", "PWD", string.Empty);

            port        = read("PEN", "PORT", 3389);
            server_port = read("PEN", "SERVER_PORT", 8486);
            client_port = read("PEN", "CLIENT_PORT", 1234);

            mq_host     = read("MQSERVER", "HOST", "127.0.0.1");
            mq_username = read("MQSERVER", "USERNAME", "admin");
            mq_password = read("MQSERVER", "PASSWORD", "admin");

            host_lw_tpk_server = read("HOST", "LW_TPK_SERVER", string.Empty);
            host_lw_class_interaction_server = read("HOST", "LW_CLASS_INTERACTION_SERVER", string.Empty);
            host_lw_authz_server             = read("HOST", "LW_AUTHZ_SERVER", string.Empty);
            host_lw_garden_server            = read("HOST", "LW_GARDEN_SERVER", string.Empty);
            host_lw_face_server          = read("HOST", "LW_FACE_SERVER", string.Empty);
            host_lw_file_server_download = read("HOST", "LW_FILE_SERVER_DOWNLOAD", string.Empty);

            link_address_lw_practice_record     = read("LINKADDRESS", "LW_PRACTICE_RECORD", string.Empty);
            link_address_lw_paper_manager       = read("LINKADDRESS", "LW_PAPER_MANAGER", string.Empty);
            link_address_lw_select_paper        = read("LINKADDRESS", "LW_SELECT_PAPER", string.Empty);
            link_address_lw_record_single       = read("LINKADDRESS", "LW_RECORD_SINGLE", string.Empty);
            link_address_lw_record_all          = read("LINKADDRESS", "LW_RECORD_ALL", string.Empty);
            link_address_lw_record_small_single = read("LINKADDRESS", "LW_RECORD_SMALL_SINGLE", string.Empty);
            link_address_lw_record_small_all    = read("LINKADDRESS", "LW_RECORD_SMALL_ALL", string.Empty);
        }
Esempio n. 3
0
 /// <summary>
 /// 获取学生头像(自动转换)
 /// </summary>
 /// <param name="imgUrl"></param>
 /// <returns></returns>
 public static string GetStudentFace(string imgUrl, bool gender)
 {
     if (imgUrl.IsEmpty())
     {
         if (gender == false)
         {
             return(MSUtils.GetPack("/assets/images/ic-face-girl.png"));
         }
         else if (gender == true)
         {
             return(MSUtils.GetPack("/assets/images/ic-face-boy.png"));
         }
         else
         {
             return(MSUtils.GetPack("/assets/images/ic-face-none.png"));
         }
     }
     else
     {
         var md5      = Helpers.EncryptHelper.md5(imgUrl);
         var filename = $"/caches/face/{md5}.{(imgUrl.Contains("png") ? "png" : "jpg")}";
         var fullpath = MSUtils.GetMapPath(filename);
         if (Helpers.FileHelper.IsFileExists(fullpath))
         {
             return(fullpath);
         }
         else
         {
             Helpers.FileHelper.CreateFolder(Helpers.FileHelper.GetFolderName(fullpath));
             var url = MSConfig.host_lw_face_server + imgUrl.Replace("\r", "").Replace("\n", "").Trim();
             using (var client = new WebClient())
             {
                 client.DownloadFileAsync(new Uri(url), fullpath);
             }
             return(url);
         }
     }
 }