コード例 #1
0
ファイル: MergeView.cs プロジェクト: whuacn/CJia
 public void Match()
 {
     if (CheckState == "102")//审核未通过
     {
         string str_inHosTimes;
         if (txtTimes.Text.Length == 1)
         {
             str_inHosTimes = "0" + txtTimes.Text;
         }
         else
         {
             str_inHosTimes = txtTimes.Text;
         }
         //图片不清晰,某些图片重拍了
         foreach (DataRow dr in PictureInfo.Rows)
         {
             string page    = dr["Pic_Page"].ToString();
             string subPage = dr["Pic_SubPage"].ToString();
             imagesInputArgs.Page     = page;
             imagesInputArgs.SubPage  = subPage;
             imagesInputArgs.HealthID = LURecordNO.DisplayValue;
             OnNoAgree(null, imagesInputArgs);
             string fileName = LURecordNO.DisplayText + "_" + str_inHosTimes + "_" + page + "_" + subPage + CJia.Health.Tools.ConfigHelper.GetAppStrings("ImgExtension");
             string filepath = Path.GetDirectoryName(dr["Pic_Path"].ToString()) + "\\Copy" + "\\" + fileName;
             FtpHelp.DeleteFile(filepath.Replace('\\', '/').Insert(4, "/"), UserName, Password);
         }
         //新拍了些图片
     }
 }
コード例 #2
0
ファイル: PhotoNewView.cs プロジェクト: whuacn/CJia
        /// <summary>
        /// 根据病案审核状态,提示信息
        /// </summary>
        /// <param name="checkState"></param>
        /// <returns></returns>
        public bool isSuccessCheckStatus(string checkState, bool bol)
        {
            string storagePath = OutHosDate.Year.ToString() + "\\" + OutHosDate.Month.ToString() + "\\" + OutHosDate.Day.ToString() + "\\" + LURecordNO.DisplayText + "\\" + SetImagePage()[0];

            if (checkState == "103")//已提交
            {
                MessageBox.Show("此病案为已提交审核,不能进行图片拍照上传");
                BindNull();
                return(false);
            }
            if (checkState == "101")
            {
                MessageBox.Show("此病案为已审核通过,不能进行图片拍照上传");
                BindNull();
                return(false);
            }
            if (checkState == "104")
            {
                MessageBox.Show("此病案为已合并,不能进行图片拍照上传");
                BindNull();
                return(false);
            }
            if (checkState == "107" && bol == true)
            {
                if (Message.ShowQuery("此病案为合并失败,是否进行重新上传?", Message.Button.YesNo) == Message.Result.Yes)
                {
                    string   imgExtension = ConfigHelper.GetAppStrings("ImgExtension");//图片格式
                    string[] picName      = FtpHelp.GetFileList(storagePath.Replace('\\', '/'), HostName, UserName, Password, imgExtension);
                    if (picName != null && picName.Length > 0)
                    {
                        for (int i = 0; i < picName.Length; i++)
                        {
                            string picPath = "ftp://" + HostName + "/" + storagePath.Replace('\\', '/') + "/" + picName[i];
                            FtpHelp.DeleteFile(picPath, UserName, Password);
                        }
                    }
                    if (OnMerge != null)
                    {
                        imagesInputArgs.MergeState = "100";
                        imagesInputArgs.HealthID   = LURecordNO.DisplayValue;
                        OnMerge(null, imagesInputArgs);
                    }
                }
                else
                {
                    BindNull();
                    return(false);
                }
            }
            if (checkState == "102" && bol == true)//审核未通过
            {
                MessageBox.Show("此病案为审核未通过,请查看已入库图片的审核原因,然后进行重新拍照上传");
            }
            return(true);
        }
コード例 #3
0
ファイル: MergeView.cs プロジェクト: whuacn/CJia
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (pictureView.GetFocusedDataRow() != null)
     {
         if (Message.ShowQuery("确定删除?", Message.Button.OkCancel) == Message.Result.Ok)
         {
             DataRow focuseRow = pictureView.GetFocusedDataRow();
             string  fileName  = focuseRow["Pic_Path"].ToString();
             FtpHelp.DeleteFile(fileName, UserName, Password);
             pictureView.DeleteRow(pictureView.FocusedRowHandle);
             pictureView.RefreshData();
         }
     }
 }
コード例 #4
0
ファイル: MergeView.cs プロジェクト: whuacn/CJia
 private void btnMerge_Click(object sender, EventArgs e)
 {
     if (pictureView.GetFocusedDataRow() != null && PictureInfo != null && PictureInfo.Rows.Count > 0)
     {
         bool isModify = false;
         CJia.Controls.UCForWaitingForm waitUC = new CJia.Controls.UCForWaitingForm("正在处理....", 0, PictureInfo.Rows.Count);
         this.Enabled = false;
         Image         img;
         List <string> SMpageList = new List <string>();
         List <string> PZpageList = new List <string>();
         try
         {
             foreach (DataRow dr in PictureInfo.Rows)
             {
                 int j = PictureInfo.Rows.IndexOf(dr);
                 waitUC.Do("执行进度(" + j + "/" + PictureInfo.Rows.Count + ")");
                 if (dr["Pic_Name"].ToString().Substring(0, 2) != "PZ")
                 {
                     img = Tools.Help.GetImageByUri(dr["Pic_Path"].ToString(), UserName, Password);
                     string isjjfb = CJia.Health.Tools.ConfigHelper.GetAppStrings("isJJCJBlank");
                     if (isjjfb == "0")//妇保
                     {
                         if (isBlankPage((Bitmap)img, 400))
                         {
                             SMpageList.Add(dr["Pic_Page"].ToString());//把空白图片的页码存起来
                         }
                     }
                     else //创佳
                     {
                         if (isBlankPage((Bitmap)img, 200))
                         {
                             SMpageList.Add(dr["Pic_Page"].ToString());//把空白图片的页码存起来
                         }
                     }
                 }
             }
             waitUC.ParentForm.Close();
             this.Enabled = true;
         }
         catch
         {
             MessageBox.Show("图片不存在或已删除,请与管理员联系。。。");
             waitUC.ParentForm.Close();
             this.Enabled = true;
         }
         if (SMpageList.Count > 0)//排除设置为非空白页的页码
         {
             if (NoBlankPage != null && NoBlankPage.Count > 0)
             {
                 foreach (string noBP in NoBlankPage)
                 {
                     try
                     {
                         SMpageList.Remove(noBP);
                     }
                     catch
                     {
                         continue;
                     }
                 }
             }
         }
         foreach (DataRow dr in PictureInfo.Rows)
         {
             if (dr["Pic_Name"].ToString().Substring(0, 2) == "PZ")
             {
                 if (!PZpageList.Contains(dr["Pic_Page"].ToString()))
                 {
                     PZpageList.Add(dr["Pic_Page"].ToString());
                 }
             }
         }
         if (SMpageList.Count == 0 && PZpageList.Count == 0)
         {
             if (Message.ShowQuery("只存在扫描的图片,是否继续合并?", Message.Button.YesNo) == Message.Result.Yes)
             {
                 Merge("104");
                 isModify = true;
             }
         }
         else if (SMpageList.Count == 0 && PZpageList.Count != 0)
         {
             if (Message.ShowQuery("只存在拍照的图片,是否继续合并?", Message.Button.YesNo) == Message.Result.Yes)
             {
                 foreach (DataRow dr in PictureInfo.Rows)
                 {
                     if (dr["Pic_Name"].ToString().Substring(0, 2) == "PZ")
                     {
                         RemovePZ(dr);
                     }
                 }
                 Merge("104");
                 isModify = true;
             }
         }
         else if (SMpageList.Count != 0 && SMpageList.Count == PZpageList.Count && PZpageList.Count != 0)
         {
             for (int i = 0; i < SMpageList.Count; i++)
             {
                 foreach (DataRow dr in PictureInfo.Rows)
                 {
                     if (dr["Pic_Name"].ToString().Substring(0, 2) != "PZ")
                     {
                         if (dr["Pic_Page"].ToString() == SMpageList[i])
                         {
                             //File.Delete(dr["Pic_Path"].ToString());//删除空白图片
                             FtpHelp.DeleteFile(dr["Pic_Path"].ToString(), UserName, Password);
                         }
                     }
                     if (dr["Pic_Name"].ToString().Substring(0, 2) == "PZ")
                     {
                         if (dr["Pic_Page"].ToString() == PZpageList[i])
                         {
                             try
                             {
                                 string SMPage = SMpageList[i];
                                 ModifyImageInfo(dr, SMPage);
                             }
                             catch
                             {
                             }
                         }
                     }
                 }
             }
             Merge("104");
             isModify = true;
         }
         else
         {
             string str = "";
             SMAllpageList = SMpageList;
             if (SMpageList.Count > 0)
             {
                 foreach (string s in SMpageList)
                 {
                     str = str + s + ",";
                 }
                 str = str.Remove(str.Length - 1, 1);
             }
             lblMesg.Text = str;
             if (Message.ShowQuery("空白图片张数与拍照图片页码张数不符,是否对此份病案重新录入?空白图片页码为" + str + "", Message.Button.YesNo) == Message.Result.Yes)
             {
                 Merge("107");
             }
             //MessageBox.Show("空白图片张数与拍照图片页码张数不符,合并失败,请对此份病案重新录入");
             //Merge("107");
             //DataTable data = CreatePictureDate();//重新加载图片
             pictureGrid.DataSource = PictureInfo;
             isModify = false;
         }
         if (isModify)
         {
             MessageBox.Show("合并成功");
             Match();//处理审核未通过的图片
             BindNull();
             //DataTable data = CreatePictureDate();
             //pictureGrid.DataSource = data;
         }
     }
 }