Пример #1
0
 //上传
 private void UploadBtn_Click(object sender, RoutedEventArgs e)
 {
     if (System.Windows.MessageBox.Show("是否上传检测记录?", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
     {
         string activityId = Uid;
         List <StudentCheckData> studentCheckDatas = dbUtill.GetUploadDatasByActivityId(activityId);
         if (studentCheckDatas.Count > 0)
         {
             MyCustomControlLibrary.MMessageBox.ShowLoading(MyCustomControlLibrary.MMessageBox.LoadType.Circle, "正在上传", new Point(0, 0), new Size(0, 0), "&#xe62e;", System.Windows.Controls.Orientation.Vertical, "#ffffff", 3);
             string   url       = dbUtill.GetImageUrl();
             string   uploadUrl = ConfigurationManager.AppSettings["UploadUrl"];
             string   schoolId  = ConfigurationManager.AppSettings["schoolId"];
             Activity activity  = dbUtill.GetActivitieInfoByID(ActivityId);
             foreach (StudentCheckData student in studentCheckDatas)
             {
                 string   res         = dbUtill.GetStudentInfoByStudentId(student.studentId);
                 string   studentName = dbUtill.GetStudentNameByID(student.studentId);
                 string[] resArray    = res.Split(',');
                 string   gradeName   = resArray[1];
                 string   className   = resArray[0];
                 string   path        = @url + "\\" + ActivityName + "\\" + gradeName + "\\" + className + "\\" + student.studentId + "_" + studentName + ".jpg";
                 if (!File.Exists(path))
                 {
                     ImageInfo imageInfo = CommonUtill.ImageFileInfo(path);
                     if (student.jsonContent.Trim().Length > 1)
                     {
                         string param = "{\"student_educode\":\"" + student.NID + "\",\"activity_code\":\"" + activityId + "\",\"student_number\":\"" + student.studentId + "\",\"image\":[{\"image_size\":" + imageInfo.image_size + ",\"image_code\":" + imageInfo.image_code + ",\"fileName\":" + imageInfo.fileName + ",\"image_time\":" + imageInfo.image_time + "}],\"target_code\":\"7\", \"school_code\": \"" + schoolId + "\",\"datas\": { \"age\": " + student.studentAge + ",\"height\": " + student.studentHeight + ",\"checkDate\": \"" + student.checkDate + "\",\"checkResult\":\"" + student.jsonContent + "\"}},\"activityName\": \"" + activity.ActivityName + "\",\"activityDate\": \"" + activity.activityDate + "\"}";
                         string Res   = requestUtill.PostRequestClient(uploadUrl, param);
                     }
                 }
                 else
                 {
                     rp.checkData = student;
                     rp.CreateMC780_boy();
                     ImageInfo imageInfo = CommonUtill.ImageFileInfo(path);
                     if (student.jsonContent.Trim().Length > 1)
                     {
                         string param = "{\"student_educode\":\"" + student.NID + "\",\"activity_code\":\"" + activityId + "\",\"student_number\":\"" + student.studentId + "\",\"image\":[{\"image_size\":" + imageInfo.image_size + ",\"image_code\":" + imageInfo.image_code + ",\"fileName\":" + imageInfo.fileName + ",\"image_time\":" + imageInfo.image_time + "}],\"target_code\":\"7\", \"school_code\": \"" + schoolId + "\",\"datas\": { \"age\": " + student.studentAge + ",\"height\": " + student.studentHeight + ",\"checkDate\": \"" + student.checkDate + "\",\"checkResult\":\"" + student.jsonContent + "\"}},\"activityName\": \"" + activity.ActivityName + "\",\"activityDate\": \"" + activity.activityDate + "\"}";
                         string Res   = requestUtill.PostRequestClient(uploadUrl, param);
                         Console.WriteLine(Res);
                     }
                 }
             }
             MyCustomControlLibrary.MMessageBox.MClosed();
             System.Windows.MessageBox.Show("上传完毕", "提示");
         }
         else
         {
             System.Windows.MessageBox.Show("该活动不存在已检测的数据,请检测后再试", "提示");
         }
     }
 }
Пример #2
0
    public CommonUtill.RESULT_CODE MakeBinOfCode()
    {
        if (CODE != "")
        {
            m_Code128 = Code128GlyphFactory.Instance.GetGlyphs(CODE);
            for (int i = 0; i < m_Code128.Length; i++)
            {
                Code128Glyph temp = (Code128Glyph)m_Code128[i];
                BinOfCodeList.Add(CommonUtill.DecToBin(temp.BitEncoding));
            }


            m_Code128Check = Code128Checksum.Instance.GetChecksum(CODE);
            for (int i = 0; i < m_Code128Check.Length; i++)
            {
                Code128Glyph tempCheck = (Code128Glyph)m_Code128Check[i];
                BinOfCodeList.Add(CommonUtill.DecToBin(tempCheck.BitEncoding));
            }


            BinOfCodeList.Add(CommonUtill.DecToBin(6379));



#if DEBUG
            string strLogOfBin = "BinList Is   ";
            for (int i = 0; i < BinOfCodeList.Count; i++)
            {
                strLogOfBin += BinOfCodeList[i].ToString();
                strLogOfBin += "  ";
            }

            UnityEngine.Debug.Log(strLogOfBin);
#endif



            return(CommonUtill.RESULT_CODE.Success);
        }



        return(CommonUtill.RESULT_CODE.Fail);
    }