1、优化考勤记录导入,优化出入记录写实名制推送记录表。2、优化考试答题,交卷接口方法。3、优化写入培训记录。

This commit is contained in:
2022-06-16 17:34:24 +08:00
parent b913f49cd8
commit 85a8b510ac
29 changed files with 488 additions and 534 deletions
+29 -35
View File
@@ -305,49 +305,43 @@ namespace BLL
/// <param name="toKeyId"></param>
public static void SaveAttachUrl(string source, string attachUrl,string menuId,string toKeyId)
{
string rootUrl = ConfigurationManager.AppSettings["localRoot"];
if (string.IsNullOrEmpty(rootUrl))
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
rootUrl = Funs.RootPath;
}
List<Model.AttachFile> sour = (from x in Funs.DB.AttachFile
where x.MenuId == menuId && x.ToKeyId == toKeyId
select x).ToList();
if (sour.Count() == 0)
{
Model.AttachFile att = new Model.AttachFile
string rootUrl = ConfigurationManager.AppSettings["localRoot"];
if (string.IsNullOrEmpty(rootUrl))
{
AttachFileId = SQLHelper.GetNewID(),
ToKeyId = toKeyId,
AttachSource = source.ToString(),
AttachUrl = attachUrl,
MenuId = menuId,
//ImageByte= imageByte,
//AttachPath= attachPath,
};
if (menuId == Const.PersonListMenuId)
{
att.ImageByte = AttachFileService.SetImageToByteArray(rootUrl + attachUrl.Split(',')[0]);
rootUrl = Funs.RootPath;
}
Funs.DB.AttachFile.InsertOnSubmit(att);
Funs.DB.SubmitChanges();
}
else
{
Model.AttachFile att = Funs.DB.AttachFile.FirstOrDefault(x => x.MenuId == menuId && x.AttachFileId == sour.First().AttachFileId);
if (att != null)
var sour = db.AttachFile.FirstOrDefault(x => x.MenuId == menuId && x.ToKeyId == toKeyId);
if (sour == null)
{
att.ToKeyId = toKeyId;
att.AttachSource = source.ToString();
att.AttachUrl = attachUrl;
att.MenuId = menuId;
Model.AttachFile att = new Model.AttachFile
{
AttachFileId = SQLHelper.GetNewID(),
ToKeyId = toKeyId,
AttachSource = source.ToString(),
AttachUrl = attachUrl,
MenuId = menuId,
//ImageByte= imageByte,
//AttachPath= attachPath,
};
if (menuId == Const.PersonListMenuId)
{
att.ImageByte = AttachFileService.SetImageToByteArray(rootUrl + attachUrl.Split(',')[0]);
}
Funs.DB.SubmitChanges();
db.AttachFile.InsertOnSubmit(att);
db.SubmitChanges();
}
else
{
sour.AttachSource = source.ToString();
sour.AttachUrl = attachUrl;
if (menuId == Const.PersonListMenuId)
{
sour.ImageByte = AttachFileService.SetImageToByteArray(rootUrl + attachUrl.Split(',')[0]);
}
db.SubmitChanges();
}
}
}