SVN r774
SVN-Revision: r774
This commit is contained in:
@@ -2970,13 +2970,15 @@ namespace Lskj.Control.Model
|
|||||||
if (isTip) MessageUtil.Show(ResourceKeys.SaveSuccess);
|
if (isTip) MessageUtil.Show(ResourceKeys.SaveSuccess);
|
||||||
#endregion
|
#endregion
|
||||||
#region 保存成功后上传附件
|
#region 保存成功后上传附件
|
||||||
|
try
|
||||||
|
{
|
||||||
string idValue = primaryValue;
|
string idValue = primaryValue;
|
||||||
if (SystemModel != null && !string.IsNullOrWhiteSpace(SystemModel.AttachmentAssociated))
|
if (SystemModel != null && !string.IsNullOrWhiteSpace(SystemModel.AttachmentAssociated))
|
||||||
{
|
{
|
||||||
idValue = GetControlValue(SystemModel.AttachmentAssociated);
|
idValue = GetControlValue(SystemModel.AttachmentAssociated);
|
||||||
}
|
}
|
||||||
List<ControlModel> uploadModels = ControlModels.Where(n => n.FileUploadControl).ToList();
|
ControlModel uploadModel = ControlModels.Where(n => n.FileUploadControl).FirstOrDefault();
|
||||||
foreach (ControlModel uploadModel in uploadModels)
|
if (uploadModel != null)
|
||||||
{
|
{
|
||||||
BaseUserControl uploadControl = FindControl(uploadModel);
|
BaseUserControl uploadControl = FindControl(uploadModel);
|
||||||
if (uploadControl != null && uploadControl is LabelRemarkEdit labelRemarkEdit && !string.IsNullOrEmpty(labelRemarkEdit.filepath) && File.Exists(labelRemarkEdit.filepath))
|
if (uploadControl != null && uploadControl is LabelRemarkEdit labelRemarkEdit && !string.IsNullOrEmpty(labelRemarkEdit.filepath) && File.Exists(labelRemarkEdit.filepath))
|
||||||
@@ -3011,22 +3013,30 @@ namespace Lskj.Control.Model
|
|||||||
bool isUpload = UploadFileUtil.UploadFile(token, postUrl, fileStream, out string fileId, out string rtnMsg);
|
bool isUpload = UploadFileUtil.UploadFile(token, postUrl, fileStream, out string fileId, out string rtnMsg);
|
||||||
if (!isUpload)
|
if (!isUpload)
|
||||||
{
|
{
|
||||||
MessageUtil.Show($"自动上传失败\r\n{rtnMsg}");
|
throw new Exception($"自动上传失败\r\n{rtnMsg}");
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string updateSql = $"update {SystemModel.MenuTable} set fileId = '{fileId}' where {SystemModel.ParmaryKey} = '{primaryValue}'";
|
string updateSql = $"update QMS_wenjiangenggaitab set fileId = '{fileId}' where qms_wjgg_billdocument_id = '{primaryValue}'";
|
||||||
BaseImpl.ExecSqlValue(updateSql);
|
SqlHelper.ExecuteNonQuery(updateSql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageUtil.Show($"登录失败,自动上传失败");
|
throw new Exception($"登录失败,自动上传失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageUtil.Show(ex.Message);
|
||||||
|
if (isAdd)
|
||||||
|
{
|
||||||
|
BaseImpl.ExecSqlValue($"delete QMS_wenjiangenggaitab where qms_wjgg_billdocument_Id = '{primaryValue}'");
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region 保存后执行某个右键
|
#region 保存后执行某个右键
|
||||||
if (SystemModel != null && !string.IsNullOrEmpty(SystemModel.AfterSaveExec))
|
if (SystemModel != null && !string.IsNullOrEmpty(SystemModel.AfterSaveExec))
|
||||||
@@ -5957,30 +5967,4 @@ namespace Lskj.Control.Model
|
|||||||
LabelDateEdit dateEdit = controlObj as LabelDateEdit;
|
LabelDateEdit dateEdit = controlObj as LabelDateEdit;
|
||||||
value = dateEdit.TextEdit.EditValue == null ? dateEdit.EditText : dateEdit.TextEdit.DateTime.ToString("yyyy-MM-dd");
|
value = dateEdit.TextEdit.EditValue == null ? dateEdit.EditText : dateEdit.TextEdit.DateTime.ToString("yyyy-MM-dd");
|
||||||
}
|
}
|
||||||
else if (controlObj is LabelCheckEdit)
|
else if
|
||||||
{
|
|
||||||
LabelCheckEdit checkEdit = controlObj as LabelCheckEdit;
|
|
||||||
value = checkEdit.EditText;
|
|
||||||
}
|
|
||||||
else if (controlObj is LabelComboxEdit)
|
|
||||||
{
|
|
||||||
LabelComboxEdit autoEdit = controlObj as LabelComboxEdit;
|
|
||||||
value = autoEdit.EditValue;
|
|
||||||
}
|
|
||||||
else if (controlObj is LabelTextEdit)
|
|
||||||
{
|
|
||||||
LabelTextEdit textIntEdit = controlObj as LabelTextEdit;
|
|
||||||
if (textIntEdit != null) value = string.IsNullOrEmpty(textIntEdit.EditText) ? "0" : textIntEdit.EditText;
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultValue = defaultValue.Replace(item, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return defaultValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user