This commit is contained in:
2026-03-11 15:37:05 +08:00
parent b66976b7c4
commit 5baac4fdb7
3 changed files with 176 additions and 23 deletions

View File

@@ -32,7 +32,7 @@ public class StyleDataAccess
{
StringBuilder sb = new StringBuilder();
var sp = new List<SqlParameter>();
sb.Append("insert into TabletPaperSize (PaperID,PaperName,Width,Height,CUser,CDate,CTime,UUser,UDate,UTime )");
sb.Append("insert into TabletPaperSize (PaperID,PaperName,Width,Height,CUser,CDate,CTime,UUser,UDate,UTime ) ");
sb.Append("values (@PaperID,@PaperName,@Width,@Height,@CUser,@CDate,@CTime,@UUser,@UDate,@UTime )");
sp.Add(new SqlParameter("@PaperID",tps.PaperID));
sp.Add(new SqlParameter("@PaperName", tps.PaperName));
@@ -44,7 +44,7 @@ public class StyleDataAccess
sp.Add(new SqlParameter("@UUser", tps.UUser));
sp.Add(new SqlParameter("@UDate", tps.UDate));
sp.Add(new SqlParameter("@UTime", tps.UTime));
context.Database.ExecuteSqlCommand(sb.ToString(),sp);
context.Database.ExecuteSqlCommand(sb.ToString(),sp.ToArray());
}
}
catch (Exception ex)
@@ -253,7 +253,7 @@ public class StyleDataAccess
new SqlParameter("@UDate",""),
new SqlParameter("@UTime",""),
};
context.Database.ExecuteSqlCommand(sb.ToString(), sp1);
context.Database.ExecuteSqlCommand(sb.ToString(), sp1.ToArray());
}
}
}

View File

@@ -118,6 +118,9 @@ public class designerController : ApiController
tsd.FontFamily = item.fontFamily == null ? "" : (string)item.fontFamily;
tsd.BreakLen = item.breakLen == null ? "" : (string)item.breakLen;
tsd.Width = item.width == null ? "" : (string)item.width;
tsd.Height = item.height == null ? "" : (string)item.height;
tsd.TextWidth = item.textWidth == null ? "" : (string)item.textWidth;
tsd.TextHeight = item.textHeight == null ? "" : (string)item.textHeight;
tsd.TwoOffset = item.twoOffset == null ? "" : (string)item.twoOffset;
tsd.ThreeOffset = item.threeOffset == null ? "" : (string)item.threeOffset;
tsd.FourOffset = item.fourOffset == null ? "" : (string)item.fourOffset;
@@ -217,16 +220,20 @@ public class designerController : ApiController
//json.detail.Children<JObject>()
log.writeLogPath((string)json.styleName);
TabletPaperSize tps = new TabletPaperSize();
tps.PaperID = (json == null || json.PaperID == null) ? "" : (string)json.PaperID;
tps.PaperID = (json == null || json.paperID == null) ? "" : (string)json.paperID;
if (string.IsNullOrEmpty(tps.PaperID))
{
tps.PaperID = DateTime.Now.ToString("yyyyMMddHHmmss");
}
tps.PaperName = (json == null || json.PaperName == null) ? "" : (string)json.PaperName;
tps.Width = (json == null || json.Width == null) ? "" : (string)json.Width;
tps.Height = (json == null || json.Height == null) ? "" : (string)json.Height;
tps.PaperName = (json == null || json.paperName == null) ? "" : (string)json.paperName;
tps.Width = (json == null || json.width == null) ? "" : (string)json.width;
tps.Height = (json == null || json.height == null) ? "" : (string)json.height;
tps.CUser = "";
tps.CDate = DateTime.Now.ToString("yyyyMMdd");
tps.CTime = DateTime.Now.ToString("HHmmss");
tps.UUser = "";
tps.UDate = DateTime.Now.ToString("yyyyMMdd");
tps.UTime = DateTime.Now.ToString("HHmmss");
object[] obj = new StyleDataAccess().AddTabletPaper(tps);