SVN-Revision: r309
This commit is contained in:
cyf
2025-03-10 01:32:10 +00:00
parent 9abdc1c710
commit 2b01c78a5a
2 changed files with 37 additions and 23 deletions
+30 -22
View File
@@ -356,10 +356,11 @@ namespace Lskj.Control.Model
System.Threading.SynchronizationContext.Current.Post(SetProperty, null);
void SetProperty(object state)
{
baseControl.LabelText = model.LabelText;//放到外面避免线程问题
//放到外面避免线程问题
baseControl.Model = model;
baseControl.FontSize = model.FontSize;
baseControl.Name = "txt_" + model.FieldName;
baseControl.LabelText = model.LabelText;
baseControl.NullText = model.NullText;
//baseControl.EditText = model.DefaultValue;
baseControl.Location = model.Location;
@@ -451,12 +452,12 @@ namespace Lskj.Control.Model
System.Windows.Forms.Control control = InitControl(model, isSweepCode);
if (control != null)
{
//放到外面避免线程问题
BaseUserControl baseControl = control as BaseUserControl;
baseControl.LabelText = model.LabelText;//放到外面避免线程问题
baseControl.Model = model;
baseControl.FontSize = model.FontSize;
baseControl.Name = "txt_" + model.FieldName;
baseControl.LabelText = model.LabelText;
baseControl.NullText = model.NullText;
//baseControl.EditText = model.DefaultValue;
@@ -586,11 +587,12 @@ namespace Lskj.Control.Model
System.Windows.Forms.Control control = InitControl(model, isSweepCode);
if (control != null)
{
//放到外面避免线程问题
BaseUserControl baseControl = control as BaseUserControl;
baseControl.LabelText = model.LabelText;//放到外面避免线程问题
baseControl.Model = model;
baseControl.FontSize = model.FontSize;
baseControl.Name = "txt_" + model.FieldName;
baseControl.LabelText = model.LabelText;
baseControl.NullText = model.NullText;
//baseControl.EditText = model.DefaultValue;
baseControl.Location = model.Location;
@@ -709,12 +711,12 @@ namespace Lskj.Control.Model
System.Windows.Forms.Control control = InitControl(model, isSweepCode);
if (control != null)
{
//放到外面避免线程问题
BaseUserControl baseControl = control as BaseUserControl;
baseControl.LabelText = model.LabelText;//放到外面避免线程问题
baseControl.Model = model;
baseControl.FontSize = model.FontSize;
baseControl.Name = "txt_" + model.FieldName;
baseControl.LabelText = model.LabelText;
baseControl.NullText = model.NullText;
//baseControl.EditText = model.DefaultValue;
@@ -860,11 +862,13 @@ namespace Lskj.Control.Model
System.Windows.Forms.Control control = InitControl(model);//创建控件
if (control != null)
{
//放到外面避免线程问题
BaseUserControl baseControl = control as BaseUserControl;
baseControl.LabelText = model.LabelText;//放到外面避免线程问题
baseControl.Model = model;
baseControl.FontSize = model.FontSize;
baseControl.Name = "txt_" + model.FieldName;
baseControl.LabelText = model.LabelText;
baseControl.NullText = model.NullText;
//baseControl.EditText = model.DefaultValue;
baseControl.Location = model.Location;
@@ -1053,12 +1057,12 @@ namespace Lskj.Control.Model
System.Windows.Forms.Control control = InitControl(model);//创建控件
if (control != null)
{
//放到外面避免线程问题
BaseUserControl baseControl = control as BaseUserControl;
baseControl.LabelText = model.LabelText;//放到外面避免线程问题
baseControl.Model = model;
baseControl.FontSize = model.FontSize;
baseControl.Name = "txt_" + model.FieldName;
baseControl.LabelText = model.LabelText;
baseControl.NullText = model.NullText;
//baseControl.EditText = model.DefaultValue;
@@ -5239,25 +5243,29 @@ namespace Lskj.Control.Model
{
try
{
bool allowBefore = ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.BeforeSearchBtnClick, Model.ModuleCode, 0);
//查询前调用Api接口
if (allowBefore)
if (Model != null)
{
DataRow dataRow = this.GetAllControlValueRow();
ApiHelper apiHelper = new ApiHelper(Model.ModuleCode, 0, dataRow);
apiHelper.OnEvent(Interface.Api.OperateEvent.BeforeSearchBtnClick, Interface.Api.ActionType.None);
if (apiHelper.apiHandlerModels.Count > 0)
bool allowBefore = ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.BeforeSearchBtnClick, Model.ModuleCode, 0);
//查询前调用Api接口
if (allowBefore)
{
Hashtable hashtable = apiHelper.apiHandlerModels[apiHelper.apiHandlerModels.Count - 1].resultPmsHashtables[0];
if (hashtable.ContainsKey("result"))
DataRow dataRow = this.GetAllControlValueRow();
ApiHelper apiHelper = new ApiHelper(Model.ModuleCode, 0, dataRow);
apiHelper.OnEvent(Interface.Api.OperateEvent.BeforeSearchBtnClick, Interface.Api.ActionType.None);
if (apiHelper.apiHandlerModels.Count > 0)
{
string jsonResult = hashtable["result"] + "";
DataTable dataTable = JsonConvert.DeserializeObject<DataTable>(jsonResult);
this._mainGridEx.SetGridViewDataSource(dataTable);
return;
Hashtable hashtable = apiHelper.apiHandlerModels[apiHelper.apiHandlerModels.Count - 1].resultPmsHashtables[0];
if (hashtable.ContainsKey("result"))
{
string jsonResult = hashtable["result"] + "";
DataTable dataTable = JsonConvert.DeserializeObject<DataTable>(jsonResult);
this._mainGridEx.SetGridViewDataSource(dataTable);
return;
}
}
}
}
}
catch (Exception ex)
{
+7 -1
View File
@@ -2332,13 +2332,19 @@ namespace Lskj.Control
{
try
{
string idValue = this.PrimaryValue;
if (!string.IsNullOrWhiteSpace(this.SysModel.AttachmentAssociated))
{
idValue = this.ControlObj.GetControlValue(this.SysModel.AttachmentAssociated);
}
if (string.IsNullOrWhiteSpace(this.PrimaryValue))
{
MessageUtil.Show(ResourceKeys.UnSaveData);
}
else
{
string url = string.Format("pages/PhotoView.html?left=1&username={0}&password={1}&id={2}&isview={3}&dllcoid=", ERPInfo.Instance.UserName, ERPInfo.Instance.Password, this.PrimaryValue, this.btnUpdate.Enabled ? "0" : "1");
string url = string.Format("pages/PhotoView.html?left=1&username={0}&password={1}&id={2}&isview={3}&dllcoid=", ERPInfo.Instance.UserName, ERPInfo.Instance.Password, idValue, this.btnUpdate.Enabled ? "0" : "1");
// 固定传入参数(窗口标题、操作员ID、操作员名称、权限、模版编号)
string[] defaultArgs = string.Format(ModuleArgs.DefaultArgs, this.Model.FormText, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, this.Model.Privilege, this.Model.ModuleCode).Split('~');
string[] menuArgs = SystemInfo.Instance.BsAttachFlag.Equals("1") ? new string[] { "", "", url } : new string[] { string.Format(ModuleArgs.PubPhotoViewArgs, this.PrimaryValue), "0", this.SysModel.MenuDirId + "", "" };