修复批次模板和单张模板bug

This commit is contained in:
强 杨 2023-12-27 09:42:52 +08:00
parent 7edede3395
commit 0ca9debfeb
1 changed files with 31 additions and 20 deletions

View File

@ -23,6 +23,7 @@ using Emgu.CV.Flann;
using System.Data.SqlTypes;
using System.Security.AccessControl;
using System.Security.Cryptography;
using Microsoft.SqlServer.Server;
public partial class Temp_UserNoPostionTemp : System.Web.UI.Page
{
@ -57,7 +58,7 @@ public partial class Temp_UserNoPostionTemp : System.Web.UI.Page
pager = Globals.Request("pager").ToLower();
GroupNo = Globals.Request("GroupNo");
ishaspostion = Globals.Request("ishaspostion");
if (action != 0)
{
Response.Clear();
@ -392,39 +393,49 @@ public partial class Temp_UserNoPostionTemp : System.Web.UI.Page
try
{
CommonUse commonUse = new CommonUse();
string BatchID = Globals.Request("BatchID");
string GroupNo = Globals.Request("GroupNo");
long TempID = Convert.ToInt64(Globals.Request("TempID"));
string sql = "select * from MK_TempleteDataUser where DetaID_bigint=" + TempID + " AND UserID_bigint=" + UserID;
if (BatchID != "")
{
sql = @"select * from MK_TempleteDataUserBatch where DetaID_bigint=" + TempID + " AND UserID_bigint=" + UserID;
}
else if (GroupNo != "")
{
sql = @"select * from MK_TempleteDataUserOnePaper where DetaID_bigint=" + TempID + " AND UserID_bigint=" + UserID;
}
DataTable dt = new MysqlDBHelper(tenant).ExecuteQuery(sql);
if (dt.Rows.Count <= 0)
{
Response.Write("NO DATA");
return false;
}
Bitmap PictureBoxBitMap = ImgGet(dt.Rows[0]["TempPicture64_nvarchar"].ToString());
//Bitmap PictureBoxBitMap = ImgGet(dt.Rows[0]["TempPicture64_nvarchar"].ToString());
//var PictureBoxBitMap = commonUse.RotateByOrientation(tempPictureBoxBitMap);
if (PictureBoxBitMap == null)
{
Response.Write("NO PICTURE");
}
string[] GetData = totalHtml.Split('$');
string PYPostionList = "";
////var PictureBoxBitMap = commonUse.RotateByOrientation(tempPictureBoxBitMap);
//if (PictureBoxBitMap == null)
//{
// Response.Write("NO PICTURE");
//}
//string[] GetData = totalHtml.Split('$');
//string PYPostionList = "";
int width = Convert.ToInt32(GetData[6].Split(',')[0]);
int height = Convert.ToInt32(GetData[6].Split(',')[1]);
PictureBoxBitMap = ScaleToSize(PictureBoxBitMap, width, height);
Image<Gray, byte> imagex = new Image<Gray, byte>(PictureBoxBitMap);
Mat mat_threshold1 = new Mat();
CvInvoke.Threshold(imagex, mat_threshold1, 160, 255, Emgu.CV.CvEnum.ThresholdType.BinaryInv);
Mat mat_dilate1 = commonUse.MyDilate(mat_threshold1);
VectorOfVectorOfPoint selected_contours1;
selected_contours1 = commonUse.GetUsefulContoursDingWei(mat_dilate1, 1);
Image<Gray, byte> currentFramext = new Image<Gray, byte>(PictureBoxBitMap);
//int width = Convert.ToInt32(GetData[6].Split(',')[0]);
//int height = Convert.ToInt32(GetData[6].Split(',')[1]);
//PictureBoxBitMap = ScaleToSize(PictureBoxBitMap, width, height);
//Image<Gray, byte> imagex = new Image<Gray, byte>(PictureBoxBitMap);
//Mat mat_threshold1 = new Mat();
//CvInvoke.Threshold(imagex, mat_threshold1, 160, 255, Emgu.CV.CvEnum.ThresholdType.BinaryInv);
//Mat mat_dilate1 = commonUse.MyDilate(mat_threshold1);
//VectorOfVectorOfPoint selected_contours1;
//selected_contours1 = commonUse.GetUsefulContoursDingWei(mat_dilate1, 1);
//Image<Gray, byte> currentFramext = new Image<Gray, byte>(PictureBoxBitMap);
int PageIndex = Convert.ToInt32(Globals.Request("PageIndex"));
//int PageIndex = Convert.ToInt32(Globals.Request("PageIndex"));
//if (PageIndex == 1)
//{
// int mx = GetOtherBitmaplist(currentFramext.Mat, 160, PYPostionList.Split(','), GetData[9]);