SVN-Revision: r536
This commit is contained in:
wyf
2025-05-07 02:22:14 +00:00
parent 9aee4ad79d
commit 1c16cd0586
2 changed files with 61 additions and 2 deletions
+58 -1
View File
@@ -22,6 +22,7 @@ using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Web;
using System.Windows.Forms;
namespace Lskj.Control.Model
@@ -2787,6 +2788,24 @@ namespace Lskj.Control.Model
/// <returns>返回保存成功于否</returns>
public bool SaveBaseModuleData(string menuCode, string tableName, string primaryKey, ref string primaryValue, bool isAdd = true, string leftField = "", bool isTip = true, int newVer = 0)
{
//保存前执行某个右键
if (!string.IsNullOrEmpty(SystemModel.BeforeSaveExec))
{
DataRow menuRow = BaseModuleImpl.GetBaseGridRightMenuById(SystemModel.BeforeSaveExec);
if (menuRow != null)
{
CommonMenu menu = new CommonMenu(Model, this, MainGridEx);
//menu.ApplyBefore += new CommonToolApplyEventHandler(OnMenuApplyBefore);
//menu.DynamicLinkAfter += new CommonToolAfterDynamicLinkEventHandler(OnDynamicLinkAfter);
StaticControl.RightMenuGridView = MainGridEx.GridView;
StaticControl.RightMenuMyControl = this;
menu.Apply(menuRow);
if (!menu.issuccess)
{
return false;
}
}
}
string execSql = string.Empty;
if (string.IsNullOrWhiteSpace(tableName))
{
@@ -2957,6 +2976,44 @@ namespace Lskj.Control.Model
}
if (isTip) MessageUtil.Show(ResourceKeys.SaveSuccess);
#endregion
#region
string idValue = primaryValue;
if (!string.IsNullOrWhiteSpace(SystemModel.AttachmentAssociated))
{
idValue = GetControlValue(SystemModel.AttachmentAssociated);
}
List<ControlModel> uploadModels = ControlModels.Where(n => n.FileUploadControl).ToList();
foreach (ControlModel uploadModel in uploadModels)
{
BaseUserControl uploadControl = FindControl(uploadModel);
if (uploadControl != null && uploadControl is LabelRemarkEdit labelRemarkEdit && !string.IsNullOrEmpty(labelRemarkEdit.filepath) && File.Exists(labelRemarkEdit.filepath))
{
string filePath = labelRemarkEdit.filepath;
string token = UploadFileUtil.Login(SystemInfo.Instance.OAUrl);
if (!string.IsNullOrEmpty(token))
{
string speciesno = "010106";
byte[] fileBytes = UploadFileUtil.ConvertFileToBytes(filePath);
string fileStream = Convert.ToBase64String(fileBytes);
string postUrl = "{0}Api/FileUploadApi.ashx?moduleId={1}&idValue={2}&speciesno={8}&folder={3}&totsize={4}&position={5}&filename={6}&method={7}";
postUrl = string.Format(postUrl, SystemInfo.Instance.OAUrl, Model.ModuleCode, HttpUtility.UrlEncode(idValue), "file", fileBytes.Length, 0, HttpUtility.UrlEncode(Path.GetFileName(filePath)), "DoWebUpload", speciesno);
bool isUpload = UploadFileUtil.UploadFile(token, postUrl, fileStream, out string fileId, out string rtnMsg);
if (!isUpload)
{
MessageUtil.Show($"自动上传失败\r\n{rtnMsg}");
}
}
else
{
MessageUtil.Show($"登录失败,自动上传失败");
}
}
else
{
MessageUtil.Show($"未选择附件,自动上传失败");
}
}
#endregion
//if (Autogrowcolumn.Equals(primaryKey, StringComparison.CurrentCultureIgnoreCase))
//{
// primaryValue = "LskjIdebtity" + SqlHelper.ExecuteScalar(string.Format("SELECT {0} FROM P_EmployeePostTab WHERE {0} = @@IDENTITY", Autogrowcolumn)) + "";
@@ -3323,7 +3380,7 @@ namespace Lskj.Control.Model
SerSearchBoxDataSource(baseControl, controlValue + "");
}
}
if (baseControl is LabelImageEdit)
{
LabelImageEdit imageEdit = baseControl as LabelImageEdit;
@@ -27,4 +27,6 @@ namespace Lskj.Control.Model
/// </summary>
public static Dictionary<GridView, List<GridDragGrid>> GridViewDragGridDic = new Dictionary<GridView, List<GridDragGrid>>();
/// <summary>
/// 表格拖拽类,key值
/// 表格拖拽类,key值为目标表
/// </summary>
public static Dictionary<GridView, List<GridDragGrid>> TargetViewDragGridDic = new Dictionary<GridView, L