diff --git a/引用DLL/Lskj.Data.ADO.dll b/引用DLL/Lskj.Data.ADO.dll
index 08f2ab0..6abd848 100644
Binary files a/引用DLL/Lskj.Data.ADO.dll and b/引用DLL/Lskj.Data.ADO.dll differ
diff --git a/引用DLL/Lskj.Data.Api.dll b/引用DLL/Lskj.Data.Api.dll
index e4a252a..6d3fcd7 100644
Binary files a/引用DLL/Lskj.Data.Api.dll and b/引用DLL/Lskj.Data.Api.dll differ
diff --git a/引用DLL/Lskj.Web.Core.dll b/引用DLL/Lskj.Web.Core.dll
index eac31d7..7248d6e 100644
Binary files a/引用DLL/Lskj.Web.Core.dll and b/引用DLL/Lskj.Web.Core.dll differ
diff --git a/引用DLL/Lskj.WebErp.Core.dll b/引用DLL/Lskj.WebErp.Core.dll
index e03e67a..88181c6 100644
Binary files a/引用DLL/Lskj.WebErp.Core.dll and b/引用DLL/Lskj.WebErp.Core.dll differ
diff --git a/插件库/Lskj.PubAdd/FrmMain.cs b/插件库/Lskj.PubAdd/FrmMain.cs
index b483729..660ffa5 100644
--- a/插件库/Lskj.PubAdd/FrmMain.cs
+++ b/插件库/Lskj.PubAdd/FrmMain.cs
@@ -1,194 +1,194 @@
-/******************************
-* 说明:基础档案添加界面
-* 创建人:龚宇超
-* 创建日期:2017-11-02
-* 修改人:
-* 修改日期:
-* 修改备注:
-* 版本:1.0.0.0
-******************************/
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Windows.Forms;
-using Lskj.Control;
-using Lskj.Control.Model;
-using Lskj.Util;
-using Lskj.Business.Impl;
-using Lskj.Model;
-using DevExpress.XtraTab;
-using DevExpress.Utils;
-using Lskj.Data;
-using Lskj.Business;
-using System.Threading;
-using DevExpress.XtraEditors;
-using Lskj.Core;
-
-namespace Lskj.PubAdd
-{
- ///
- /// 基础档案添加界面
- ///
- public partial class FrmMain : BaseForm
- {
- ///
- /// 主表选中行
- ///
- public DataRow MaintabFocusedRow { get; private set; }
- ///
- /// 系统模块实体对象
- ///
- /// The system model.
- public ModuleModel SysModel { get; private set; }
- ///
- /// 里面是否使用滚动条
- ///
- public bool isAutoScroll = false;
- ///
- /// 调用动态链接库默认传递参数
- ///
- public DynamicAddModel Model;
- double H_Scaling;
- double W_Scaling;
-
- public DataTable details = new DataTable();
-
+/******************************
+* 说明:基础档案添加界面
+* 创建人:龚宇超
+* 创建日期:2017-11-02
+* 修改人:
+* 修改日期:
+* 修改备注:
+* 版本:1.0.0.0
+******************************/
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using Lskj.Control;
+using Lskj.Control.Model;
+using Lskj.Util;
+using Lskj.Business.Impl;
+using Lskj.Model;
+using DevExpress.XtraTab;
+using DevExpress.Utils;
+using Lskj.Data;
+using Lskj.Business;
+using System.Threading;
+using DevExpress.XtraEditors;
+using Lskj.Core;
+
+namespace Lskj.PubAdd
+{
+ ///
+ /// 基础档案添加界面
+ ///
+ public partial class FrmMain : BaseForm
+ {
+ ///
+ /// 主表选中行
+ ///
+ public DataRow MaintabFocusedRow { get; private set; }
+ ///
+ /// 系统模块实体对象
+ ///
+ /// The system model.
+ public ModuleModel SysModel { get; private set; }
+ ///
+ /// 里面是否使用滚动条
+ ///
+ public bool isAutoScroll = false;
+ ///
+ /// 调用动态链接库默认传递参数
+ ///
+ public DynamicAddModel Model;
+ double H_Scaling;
+ double W_Scaling;
+
+ public DataTable details = new DataTable();
+
public FrmMain()
{
SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.Selectable | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true);
InitializeComponent();
this.Activated += OnFrmMainActivated;
}
- ///
- /// 窗体激活时
- ///
- ///
- ///
- private void OnFrmMainActivated(object sender, EventArgs e)
- {
- //新增时输入焦点
- if (string.IsNullOrEmpty(this.ModuleAddControl.PrimaryValue)&& ModuleAddControl.ControlObj!=null)
- {
- ControlModel controlModel = ModuleAddControl.ControlObj.ControlModels.Where(n => n.Location.X != 0 || n.Location.Y != 0).OrderBy(n => n.TabOrder).FirstOrDefault();
- if (controlModel != null)
- {
- BaseUserControl baseControl = ModuleAddControl.ControlObj.FindControl(controlModel);
- if (baseControl != null)
- {
- baseControl.Focus();
- }
- }
- }
- }
- ///
- /// 窗体加载时
- ///
- ///
- protected override void OnLoad(EventArgs e)
- {
- WaitForm.ShowForm();
-
- try
- {
- Console.WriteLine("初始化开始:" + DateTime.Now);
- //this.SuspendLayout();
- this.SysModel = new ModuleModel(MainImpl.GetSystemdllTab(this.Model.ModuleCode));
- this.SysModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(this.Model.ModuleCode);
- this.SysModel.maintabFocusedRow = Model.GetMaintabFocusedRow();
- this.ModuleAddControl.OnAddRecordCallBack += OnAddRecordCallBack;
- this.ModuleAddControl.OnClearCallBack += OnClearCallBack;
+ ///
+ /// 窗体激活时
+ ///
+ ///
+ ///
+ private void OnFrmMainActivated(object sender, EventArgs e)
+ {
+ //新增时输入焦点
+ if (string.IsNullOrEmpty(this.ModuleAddControl.PrimaryValue)&& ModuleAddControl.ControlObj!=null)
+ {
+ ControlModel controlModel = ModuleAddControl.ControlObj.ControlModels.Where(n => n.Location.X != 0 || n.Location.Y != 0).OrderBy(n => n.TabOrder).FirstOrDefault();
+ if (controlModel != null)
+ {
+ BaseUserControl baseControl = ModuleAddControl.ControlObj.FindControl(controlModel);
+ if (baseControl != null)
+ {
+ baseControl.Focus();
+ }
+ }
+ }
+ }
+ ///
+ /// 窗体加载时
+ ///
+ ///
+ protected override void OnLoad(EventArgs e)
+ {
+ WaitForm.ShowForm();
+
+ try
+ {
+ Console.WriteLine("初始化开始:" + DateTime.Now);
+ //this.SuspendLayout();
+ this.SysModel = new ModuleModel(MainImpl.GetSystemdllTab(this.Model.ModuleCode));
+ this.SysModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(this.Model.ModuleCode);
+ this.SysModel.maintabFocusedRow = Model.GetMaintabFocusedRow();
+ this.ModuleAddControl.OnAddRecordCallBack += OnAddRecordCallBack;
+ this.ModuleAddControl.OnClearCallBack += OnClearCallBack;
this.details = BaseModuleImpl.GetBaseAddTabDetail(Model.ModuleCode);
this.CreateControlLocation();
this.SetControlPanelSize();
-
- this.CreateTabDetail();
-
- if (Business.Impl.LanguageTranslation.Translatable) xtcControl.TabPages[0].Text= Business.Impl.LanguageTranslation.GetTranslatedText(xtcControl.TabPages[0].Text);
-
- Console.WriteLine("初始化完成:" + DateTime.Now);
- }
- catch (Exception ex)
- {
- LogHelper.Instance.WriteError(ex);
- string Message = ErrorMessage.PromptErrorMessage(ex);
- MessageUtil.Show(Message, ex.Message);
- }
- finally
- {
- Lskj.Control.Model.AutoSizeChange.ControllInitializeSize(this);
- //this.ResumeLayout(false);
- }
- this.Text = Model.FormText + (string.IsNullOrWhiteSpace(Model.ObjectId) ? "" : "[" + Model.ObjectId + "]");
- LogUtil.WriteDebug(Model.ModuleCode, "打开操作", ERPInfo.Instance.UserName, "打开[" + Model.FormText + "] 查看" + Model.ObjectId, Model.ModuleId + "");
- WaitForm.HideForm();
- }
- ///
- /// 说明:设置窗口大小
- /// 创建人:龚宇超
- /// 创建日期:2017-11-03
- /// 修改人:
- /// 修改日期:
- /// 修改备注:
- /// 版本:1.0
- ///
- /// The menu code.
+
+ this.CreateTabDetail();
+
+ if (Business.Impl.LanguageTranslation.Translatable) xtcControl.TabPages[0].Text= Business.Impl.LanguageTranslation.GetTranslatedText(xtcControl.TabPages[0].Text);
+
+ Console.WriteLine("初始化完成:" + DateTime.Now);
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Instance.WriteError(ex);
+ string Message = ErrorMessage.PromptErrorMessage(ex);
+ MessageUtil.Show(Message, ex.Message);
+ }
+ finally
+ {
+ Lskj.Control.Model.AutoSizeChange.ControllInitializeSize(this);
+ //this.ResumeLayout(false);
+ }
+ this.Text = Model.FormText + (string.IsNullOrWhiteSpace(Model.ObjectId) ? "" : "[" + Model.ObjectId + "]");
+ LogUtil.WriteDebug(Model.ModuleCode, "打开操作", ERPInfo.Instance.UserName, "打开[" + Model.FormText + "] 查看" + Model.ObjectId, Model.ModuleId + "");
+ WaitForm.HideForm();
+ }
+ ///
+ /// 说明:设置窗口大小
+ /// 创建人:龚宇超
+ /// 创建日期:2017-11-03
+ /// 修改人:
+ /// 修改日期:
+ /// 修改备注:
+ /// 版本:1.0
+ ///
+ /// The menu code.
private void SetControlPanelSize()
{
DataRow item = BaseModuleImpl.GetControlParentSize(this.SysModel.FormKey);
if (item != null)
- {
- int otherHeight = 80;
- bool topVisible = false;
-
- if ("lskj.pubadd.dll".Equals((this.SysModel.MenuAddName).ToLower()) ||
- "lskj.pubadd2.dll".Equals((this.SysModel.MenuAddName).ToLower()))
- {
- otherHeight = 130;
- topVisible = true;
- }
- //this.ModuleAddControl.SetTopPanelVisible(topVisible);//2023-9-1 把这个判断放入modulePanelEx初始化中
-
- this.Width = Convert.ToInt32(item["width"] + "");
-
- int height = this.ModuleAddControl.ControlHeight + this.ModuleAddControl.OperatePanelControlObj.Height + this.ModuleAddControl.SpeciesPanelControlObj.Height;
- height = Convert.ToInt32(item["height"] + "") > height ? height : Convert.ToInt32(item["height"] + "");//如果控件高度小于设置高度,以实际高度为准
- if (ModuleAddControl.SplitContainerControl.PanelVisibility == SplitPanelVisibility.Both)
- {
- height += 400;
- }
- this.Height = height + otherHeight;
-
- //this.Height = Convert.ToInt32(item["height"] + "") + otherHeight;
- if (this.Left < 0) this.Left = 0;
- if (this.Top < 0) this.Top = 0;
- this.Left = (Screen.PrimaryScreen.WorkingArea.Width - this.Width) / 2;
- this.Top = (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2;
- if ((this.Width > Screen.PrimaryScreen.WorkingArea.Width || (this.Height > Screen.PrimaryScreen.WorkingArea.Height)))
- {
- int screenHeight = Screen.PrimaryScreen.WorkingArea.Height;
- screenHeight = screenHeight - 40;
- this.Height = screenHeight;
- this.Top = (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2;
- isAutoScroll = true;
- ModuleAddControl.plMainControlObj.AutoScroll = isAutoScroll;
- if (ModuleAddControl.SplitContainerControl.PanelVisibility == SplitPanelVisibility.Both)
- {
- this.ModuleAddControl.SplitContainerControl.SplitterPosition = (this.Height * 2) / 3;
- }
- }
- else
- {
- this.ModuleAddControl.plMainControlObj.AutoScroll = true;
- this.ModuleAddControl.plMainControlObj.HorizontalScroll.Visible = false;
- if (ModuleAddControl.SplitContainerControl.PanelVisibility == SplitPanelVisibility.Both)
- {
- this.ModuleAddControl.SplitContainerControl.SplitterPosition = this.ModuleAddControl.ControlHeight;
- }
- }
+ {
+ int otherHeight = 80;
+ bool topVisible = false;
+
+ if ("lskj.pubadd.dll".Equals((this.SysModel.MenuAddName).ToLower()) ||
+ "lskj.pubadd2.dll".Equals((this.SysModel.MenuAddName).ToLower()))
+ {
+ otherHeight = 130;
+ topVisible = true;
+ }
+ //this.ModuleAddControl.SetTopPanelVisible(topVisible);//2023-9-1 把这个判断放入modulePanelEx初始化中
+
+ this.Width = Convert.ToInt32(item["width"] + "");
+
+ int height = this.ModuleAddControl.ControlHeight + this.ModuleAddControl.OperatePanelControlObj.Height + this.ModuleAddControl.SpeciesPanelControlObj.Height;
+ height = Convert.ToInt32(item["height"] + "") > height ? height : Convert.ToInt32(item["height"] + "");//如果控件高度小于设置高度,以实际高度为准
+ if (ModuleAddControl.SplitContainerControl.PanelVisibility == SplitPanelVisibility.Both)
+ {
+ height += 400;
+ }
+ this.Height = height + otherHeight;
+
+ //this.Height = Convert.ToInt32(item["height"] + "") + otherHeight;
+ if (this.Left < 0) this.Left = 0;
+ if (this.Top < 0) this.Top = 0;
+ this.Left = (Screen.PrimaryScreen.WorkingArea.Width - this.Width) / 2;
+ this.Top = (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2;
+ if ((this.Width > Screen.PrimaryScreen.WorkingArea.Width || (this.Height > Screen.PrimaryScreen.WorkingArea.Height)))
+ {
+ int screenHeight = Screen.PrimaryScreen.WorkingArea.Height;
+ screenHeight = screenHeight - 40;
+ this.Height = screenHeight;
+ this.Top = (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2;
+ isAutoScroll = true;
+ ModuleAddControl.plMainControlObj.AutoScroll = isAutoScroll;
+ if (ModuleAddControl.SplitContainerControl.PanelVisibility == SplitPanelVisibility.Both)
+ {
+ this.ModuleAddControl.SplitContainerControl.SplitterPosition = (this.Height * 2) / 3;
+ }
+ }
+ else
+ {
+ this.ModuleAddControl.plMainControlObj.AutoScroll = true;
+ this.ModuleAddControl.plMainControlObj.HorizontalScroll.Visible = false;
+ if (ModuleAddControl.SplitContainerControl.PanelVisibility == SplitPanelVisibility.Both)
+ {
+ this.ModuleAddControl.SplitContainerControl.SplitterPosition = this.ModuleAddControl.ControlHeight;
+ }
+ }
string splitWidth = IniHelper.Read(string.Format("ModulePanelExAdd_Split_{0}", this.Model.ModuleCode));//通过Key获取Value值
if (!string.IsNullOrEmpty(splitWidth))
{
@@ -196,570 +196,570 @@ namespace Lskj.PubAdd
}
this.ModuleAddControl.SplitContainerControl.SplitterPositionChanged += OnSplitterPositionChanged;
}
- }
- ///
- /// 说明:初始化多标签
- /// 创建人:龚宇超
- /// 创建日期:2017-11-10
- /// 修改人:
- /// 修改日期:
- /// 修改备注:
- /// 版本:1.0
- ///
- private void CreateTabDetail()
- {
- this.Invoke((EventHandler)delegate
- {
- bool isInside = false;
-
- foreach (DataRow item in this.details.Rows)
- {
- if (this.details.Columns.Contains("orderId") && !string.IsNullOrWhiteSpace(item["orderId"] + "") && int.Parse(item["orderId"] + "") < 0)
- {
- continue;
- }
-
- XtraTabPage tabPage = new XtraTabPage();
- GridDetailModel detailModel = new GridDetailModel(item, null, GridCustomColumnStruct.BaseDetailGridView);
- if (!string.IsNullOrEmpty(detailModel.UnionModule))
- {
- ModuleModel moduleModel = new ModuleModel(MainImpl.GetSystemdllTab(detailModel.UnionModule));
- if (string.IsNullOrWhiteSpace(moduleModel.FormKey))
- {
- string text = Business.Impl.LanguageTranslation.Translatable ? Business.Impl.LanguageTranslation.GetTranslatedText("模块配置错误") : "模块配置错误";
- MessageUtil.Show(detailModel.DetailName + text);
- return;
- }
- detailModel.DetailSql = moduleModel.MenuSql;
- }
- detailModel.GridColumns = ReportImpl.GetReportDetailColumns(Model.ModuleCode, item["id"] + "");
- tabPage.Text = detailModel.DetailName;
- tabPage.Tag = detailModel;
- if (ModuleAddControl.plMainControlObj.Tag is XtraTabControl)
- {
- XtraTabControl xtr = ModuleAddControl.plMainControlObj.Tag as XtraTabControl;
- xtr.TabPages.Add(tabPage);
- isInside = true;
- xtr.SelectedPageChanged += new DevExpress.XtraTab.TabPageChangedEventHandler(this.OnSelectedPageChanged);
- xtr.SelectedPageChanging += new DevExpress.XtraTab.TabPageChangingEventHandler(this.OnSelectedPageChanging);
- }
- else
- {
- this.xtcControl.TabPages.Add(tabPage);
- }
- }
-
- this.xtcControl.ShowTabHeader = details.Rows.Count > 0 && !isInside ? DefaultBoolean.True : DefaultBoolean.False;
- });
- }
-
- ///
- /// 说明:创建控件
- /// 创建人:龚宇超
- /// 创建日期:2017-11-03
- /// 修改人:
- /// 修改日期:
- /// 修改备注:
- /// 版本:1.0
- ///
- private void CreateControlLocation()
- {
- this.ModuleAddControl.SavaState = Model.SaveState.Equals("1");
- this.ModuleAddControl.IsView = Model.IsView;
- this.ModuleAddControl.ParentKey = Model.ParentKey;
- this.ModuleAddControl.ParentValue = Model.ParentValue;
- this.ModuleAddControl.PrimaryKey = this.SysModel.ParmaryKey;// BaseImpl.GetBasePrimaryKey(Model.ModuleCode); 和上方获取主键执行方法相同,直接取上方的值
- this.ModuleAddControl.UnionKey = Model.UnionKey;
- this.ModuleAddControl.UnionValue = Model.UnionValue;
- this.ModuleAddControl.PrimaryValue = Model.ObjectId;
- this.ModuleAddControl.ControlSql = Model.ControlSql;
- this.ModuleAddControl.OnCloseCallback += new EventHandler(OnCloseCallback);
- this.ModuleAddControl.SearchObject = Model.SearchObject;
-
- if (this.details.Columns.Contains("orderId"))
- {
- DataRow[] dataRows = details.Select("orderId<0");
- this.ModuleAddControl.DetailsData = dataRows;
- }
-
- this.ModuleAddControl.InitializeControl(SysModel, Model, isAutoScroll);
-
- }
-
- ///
- /// 说明:关闭按钮回调
- /// 创建人:龚宇超
- /// 创建日期:2017-11-08
- /// 修改人:
- /// 修改日期:
- /// 修改备注:
- /// 版本:1.0
- ///
- /// The source of the event.
- /// The instance containing the event data.
- protected void OnCloseCallback(object sender, EventArgs e)
- {
- try
- {
- this.DialogResult = DialogResult.OK;
- this.Close();
- }
- catch (Exception ex)
- {
- string Message = ErrorMessage.PromptErrorMessage(ex);
- MessageUtil.Show(Message, ex.Message);
- }
- }
- ///
- /// 说明:查询条件执行前
- /// 创建人:龚宇超
- /// 创建日期:2017-11-10
- /// 修改人:
- /// 修改日期:
- /// 修改备注:
- /// 版本:1.0
- ///
- /// The sender.
- /// The e.
- protected void OnSearchBefore(object sender, SearchArgs e)
- {
- try
- {
- XtraTabPage tabPage = xtcControl.SelectedTabPage;
- if (ModuleAddControl.plMainControlObj.Tag is XtraTabControl)
- {
- XtraTabControl xtr = ModuleAddControl.plMainControlObj.Tag as XtraTabControl;
- tabPage = xtr.SelectedTabPage;
- }
- if (tabPage != null)
- {
- ModuleGridEx moduleGrid = tabPage.Tag as ModuleGridEx;
- GridDetailModel detailModel = moduleGrid.Tag as GridDetailModel;
-
- moduleGrid.SearchObj.SearchGrid(detailModel.DetailSql + string.Format(" and {0}='{1}'", moduleGrid.DetailKeyField, moduleGrid.UnionValue));
- }
- e.Continue = false;
- }
- catch (Exception ex)
- {
- string Message = ErrorMessage.PromptErrorMessage(ex);
- MessageUtil.Show(Message, ex.Message);
- }
- }
- ///
- /// 说明:查询条件执行后
- /// 创建人:龚宇超
- /// 创建日期:2017-11-10
- /// 修改人:
- /// 修改日期:
- /// 修改备注:
- /// 版本:1.0
- ///
- /// The source of the event.
- /// The instance containing the event data.
- protected void OnSearchAfter(object sender, EventArgs e)
- {
- try
- {
- XtraTabPage tabPage = xtcControl.SelectedTabPage;
- if (ModuleAddControl.plMainControlObj.Tag is XtraTabControl)
- {
- XtraTabControl xtr = ModuleAddControl.plMainControlObj.Tag as XtraTabControl;
- tabPage = xtr.SelectedTabPage;
- }
- if (tabPage != null)
- {
- if (tabPage.Tag is ModuleGridEx)
- {
- ModuleGridEx moduleGrid = tabPage.Tag as ModuleGridEx;
- GridDetailModel detailModel = moduleGrid.Tag as GridDetailModel;
- tabPage.Text = detailModel.DetailName + "(" + moduleGrid.SearchObj.GridRowCount + "条)";
- }
- else if (tabPage.Tag is GridControlEx)
- {
-
- GridControlEx moduleGrid = tabPage.Tag as GridControlEx;
- GridDetailModel detailModel = moduleGrid.Tag as GridDetailModel;
- tabPage.Text = detailModel.DetailName + "(" + moduleGrid.DataRowCount() + "条)";
- }
-
- }
- }
- catch (Exception ex)
- {
- string Message = ErrorMessage.PromptErrorMessage(ex);
- MessageUtil.Show(Message, ex.Message);
- }
- }
- ///
- /// 说明:切换选项卡
- /// 创建人:龚宇超
- /// 创建日期:2018-04-09
- /// 修改人:
- /// 修改日期:
- /// 修改备注:
- /// 版本:1.0
- ///
- /// The source of the event.
- /// The instance containing the event data.
- protected void OnSelectedPageChanging(object sender, TabPageChangingEventArgs e)
- {
- try
- {
- XtraTabPage page = e.Page;
- if (page != null)
- {
- if (e.PrevPage == xtcControl.TabPages[0] && string.IsNullOrEmpty(this.ModuleAddControl.PrimaryValue))
- {
- MessageUtil.Show(ResourceKeys.BeforeSaveData);
- e.Cancel = true;
- }
- }
- }
- catch (Exception ex)
- {
- string Message = ErrorMessage.PromptErrorMessage(ex);
- MessageUtil.Show(Message, ex.Message);
- }
- }
- ///
- /// 说明:切换标签刷新主键值
- /// 创建人:龚宇超
- /// 创建日期:2018-04-09
- /// 修改人:
- /// 修改日期:
- /// 修改备注:
- /// 版本:1.0
- ///
- /// The source of the event.
- /// The instance containing the event data.
- protected void OnSelectedPageChanged(object sender, TabPageChangedEventArgs e)
- {
- try
- {
-
- XtraTabPage tabPage = e.Page;
- ModuleAddControl.OperatePanelControlObj.Visible = true;
- //XtraTabPage tabPage = this.xtcControl.SelectedTabPage;
- if (tabPage.Tag is ModuleGridEx) ModuleAddControl.OperatePanelControlObj.Visible = false;
- if (!(tabPage.Tag is GridDetailModel)) return;
- ModuleAddControl.OperatePanelControlObj.Visible = false;
- if (tabPage.Controls.Count == 0)
- {
-
- GridDetailModel detailModel = tabPage.Tag as GridDetailModel;
- ModuleModel moduleModel = null;
- DynamicAddModel addModel = new DynamicAddModel(new string[] {
- detailModel.DetailName,
- ERPInfo.Instance.UserId,
- ERPInfo.Instance.UserName,
- "1",detailModel.UnionModule,"","",""
- });
- addModel.Params = Model.OtherParams();
- if (detailModel.IsWebView)
- {
- // 加载网页
- string url = detailModel.DetailSql.StartsWith("http") ? detailModel.DetailSql : SystemInfo.Instance.OAUrl + detailModel.DetailSql;
- if (!string.IsNullOrWhiteSpace(Model.ParentKey))
- {
- string codeSql = "select";
- codeSql += string.Format(" '{0}' as {1}", Model.ObjectId, this.SysModel.ParmaryKey);
- url = ReplaceHelper.ReplaceRowParam(BaseImpl.GetDataRowResult(codeSql), ReplaceHelper.ReplaceWhereCond(detailModel.DetailSql));
- }
- if (this.ModuleAddControl.ControlObj.CurrentData != null) url = ReplaceHelper.ReplaceRowParam(this.ModuleAddControl.ControlObj.CurrentData, url);
- //url= System.Web.HttpUtility.UrlEncode(url);
-
- if (SystemInfo.Instance.PrimitiveBrowser)
- {
- FrmMiniBlink webView = new FrmMiniBlink();
- webView.IsDownVerify = true;
- webView.Dock = DockStyle.Fill;
- webView.Tag = detailModel;
- tabPage.Tag = webView;
- tabPage.Controls.Add(webView);
- webView.LoadUrl(ReplaceHelper.ReplaceUserInfo(url));
- }
- else
- {
- FrmWebBrowser webView = new FrmWebBrowser();
- webView.Dock = DockStyle.Fill;
- webView.Tag = detailModel;
- tabPage.Tag = webView;
- tabPage.Controls.Add(webView);
- webView.FrmLoad(ReplaceHelper.ReplaceUserInfo(url));
- }
- }
- else if (detailModel.IsWebView2)
- {
- // 加载网页
- string url = detailModel.DetailSql.StartsWith("http") ? detailModel.DetailSql : SystemInfo.Instance.OAUrl + detailModel.DetailSql;
- //url= System.Web.HttpUtility.UrlEncode(url);
- if (this.ModuleAddControl.ControlObj.CurrentData != null) url = ReplaceHelper.ReplaceRowParam(this.ModuleAddControl.ControlObj.CurrentData, url);
- if (SystemInfo.Instance.PrimitiveBrowser)
- {
- FrmMiniBlink webView = new FrmMiniBlink();
- webView.Dock = DockStyle.Fill;
- webView.Tag = detailModel;
- tabPage.Tag = webView;
- tabPage.Controls.Add(webView);
- webView.LoadUrl(ReplaceHelper.ReplaceUserInfo(url));
- }
- else
- {
- FrmWebBrowser2 webView = new FrmWebBrowser2();
- webView.Dock = DockStyle.Fill;
- webView.Tag = detailModel;
- tabPage.Tag = webView;
- tabPage.Controls.Add(webView);
- webView.FrmLoad(ReplaceHelper.ReplaceUserInfo(url));
- }
- }
- else if (detailModel.IsWebView3)
- {
- // 加载网页
- string url = detailModel.DetailSql.StartsWith("http") ? detailModel.DetailSql : SystemInfo.Instance.OAUrl + detailModel.DetailSql;
- //url= System.Web.HttpUtility.UrlEncode(url);
- if (this.ModuleAddControl.ControlObj.CurrentData != null) url = ReplaceHelper.ReplaceRowParam(this.ModuleAddControl.ControlObj.CurrentData, url);
- if (SystemInfo.Instance.PrimitiveBrowser)
- {
- FrmMiniBlink webView = new FrmMiniBlink();
- webView.AllowDownload = false;
- webView.Dock = DockStyle.Fill;
- webView.Tag = detailModel;
- tabPage.Tag = webView;
- tabPage.Controls.Add(webView);
- webView.LoadUrl(ReplaceHelper.ReplaceUserInfo(url));
- }
- else
- {
- FrmWebBrowser2 webView = new FrmWebBrowser2();
- webView.Dock = DockStyle.Fill;
- webView.Tag = detailModel;
- webView.AllowDownload = false;
- tabPage.Tag = webView;
- tabPage.Controls.Add(webView);
- webView.FrmLoad(ReplaceHelper.ReplaceUserInfo(url));
- }
- }
- else if (string.IsNullOrEmpty(detailModel.UnionModule))
- {
- PanelControl plBottom = new PanelControl();
- plBottom.Dock = DockStyle.Bottom;
- plBottom.Visible = false;
- PanelControl plMain = new PanelControl();
- plMain.Dock = DockStyle.Fill;
- GridControlEx gridEx = detailModel.AutoMultiHeader == 1 ? new BandedGridControlEx() : new GridControlEx();
- gridEx.Dock = DockStyle.Fill;
- gridEx.Tag = detailModel;
- gridEx.Parent = plMain;
- gridEx.Model = this.Model;
- gridEx.SetReadOnlyColumns(detailModel.GridColumns, detailModel.GridCustomColumnKey);
- //gridEx.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(model.FormKey), this.Model, OnGridViewRightCallBack);
- //gridEx.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(model.FormKey));
-
- gridEx.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(detailModel.FormKey), this.Model);
- gridEx.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(detailModel.FormKey));
- if (detailModel.IsCheck == 1)//加载复选框
- {
- GridDragGrid.GridAddCheckBox(gridEx.GridView);
- }
- // 加载配置查询条件
- if (Model != null && Model.IsDetailSearch)
- {
- plBottom.Visible = true;
- MyControl searchObj = new MyControl(detailModel.DetailSql, gridEx);
- plBottom.Height = searchObj.InitSearchControl(BaseModuleImpl.GetCustomQueryFields(detailModel.FormKey), plBottom);
- }
- tabPage.Tag = gridEx;
- tabPage.Controls.AddRange(new PanelControl[] { plBottom, plMain });
- if (detailModel.AutoRefresh)
- {
- if (!string.IsNullOrWhiteSpace(this.ModuleAddControl.ParentKey))
- {
- string codeSql = "select";
- codeSql += string.Format(" '{0}' as {1}", this.ModuleAddControl.PrimaryValue, this.ModuleAddControl.PrimaryKey);
- gridEx.SetGridViewDataSource(SqlHelper.ExecuteDataTable(ReplaceHelper.ReplaceRowParam(BaseImpl.GetDataRowResult(codeSql), ReplaceHelper.ReplaceWhereCond(detailModel.DetailSql))));
- }
- else if (this.ModuleAddControl.ControlObj.CurrentData != null)
- {
- gridEx.SetGridViewDataSource(SqlHelper.ExecuteDataTable(ReplaceHelper.ReplaceRowParam(this.ModuleAddControl.ControlObj.CurrentData, ReplaceHelper.ReplaceWhereCond(detailModel.DetailSql))));
- }
- // 自动刷新
- }
- }
- else
- {
-
- moduleModel = new ModuleModel(MainImpl.GetSystemdllTab(detailModel.UnionModule));
- moduleModel.maintabFocusedRow = SysModel.maintabFocusedRow;
- ModuleGridEx moduleGrid = new ModuleGridEx();
- moduleGrid.IsDetail = true;
- moduleGrid.Dock = DockStyle.Fill;
- moduleGrid.Tag = detailModel;
- moduleGrid.ParentKeyField = string.IsNullOrEmpty(detailModel.UnionParentField) ? SysModel.ParmaryKey : detailModel.UnionParentField;
-
- //直接在控件数据源中取值,控件可能是禁显状态(没用控件获取不到值)
- if (!string.IsNullOrWhiteSpace(moduleGrid.ParentKeyField) && this.ModuleAddControl.ControlObj.CurrentData.Table.Columns.Contains(moduleGrid.ParentKeyField))
- {
- moduleGrid.ParentKeyValue = moduleGrid.UnionValue = this.ModuleAddControl.ControlObj.CurrentData[moduleGrid.ParentKeyField] + "";
- }
-
- if (detailModel.AddHideBottomPanel || detailModel.HideBottomPanel || detailModel.Library.Equals("Lskj.Report.dll", StringComparison.OrdinalIgnoreCase))
- {
- moduleGrid.VisibleOperPanel = false;
- }
-
- //moduleGrid.ParentKeyValue = this.ModuleAddControl.ControlObj.GetControlValue(moduleGrid.ParentKeyField);
- moduleGrid.DetailKeyField = detailModel.UnionValue;
- moduleGrid.UnionKey = detailModel.UnionValue;
- //moduleGrid.UnionValue = this.ModuleAddControl.ControlObj.GetControlValue(moduleGrid.ParentKeyField); //Model.ObjectId;
- moduleGrid.SearchControlSql = Model.ControlSql;
- moduleGrid.InitializeControl(moduleModel, addModel);
- moduleGrid.SearchObj.OnSearchBeforeCallBack += new SearchEventHandler(OnSearchBefore);
- moduleGrid.SearchObj.OnSearchAfterCallBack += new EventHandler(OnSearchAfter);
- Lskj.Control.Model.AutoSizeChange.ControllInitializeSize(moduleGrid);
- tabPage.Controls.Add(moduleGrid);
- tabPage.Tag = moduleGrid;
- if (detailModel.AutoRefresh)
- {
- moduleGrid.SearchObj.OnDataSourceBindCallBack += new EventHandler(OnMainSearchDataSourceBindCallBack);
- // 自动刷新
- //moduleGrid.SearchObj.SearchGrid(ReplaceHelper.ReplaceWhereCond(moduleModel.MenuSql) + string.Format(" and {0}='{1}'", moduleGrid.DetailKeyField, moduleGrid.UnionValue));
- }
- }
- }
- }
- catch (Exception ex)
- {
- string Message = ErrorMessage.PromptErrorMessage(ex);
- MessageUtil.Show(Message, ex.Message);
- }
- }
- ///
- /// 说明:查询条件绑定完成查询数据
- /// 创建人:龚宇超
- /// 创建日期:
- /// 修改人:
- /// 修改日期:
- /// 修改备注:
- /// 版本:1.0
- ///
- /// The sender.
- /// The instance containing the event data.
- protected void OnMainSearchDataSourceBindCallBack(object sender, EventArgs e)
- {
- try
- {
- MyControl searchobj = sender as MyControl;
- //if (!string.IsNullOrEmpty(this.SysModel.CustomColumnSQL))
- //{
- // BaseImpl.ExecSqlValue(searchobj.ReplaceControlValue(this.SysModel.CustomColumnSQL));
- //}
- searchobj.SearchGrid();
- OnSearchAfter(null, null);
- }
- catch (Exception ex)
- {
- string Message = ErrorMessage.PromptErrorMessage(ex);
- MessageUtil.Show(Message, ex.Message);
- }
-
- }
- ///
- /// 清理后回调
- ///
- ///
- ///
- private void OnClearCallBack(object sender, EventArgs e)
- {
- //新增时输入焦点
- ControlModel controlModel = ModuleAddControl.ControlObj.ControlModels.Where(n => n.Location.X != 0 || n.Location.Y != 0).OrderBy(n => n.TabOrder).FirstOrDefault();
- if (controlModel != null)
- {
- BaseUserControl baseControl = ModuleAddControl.ControlObj.FindControl(controlModel);
- if (baseControl != null)
- {
- baseControl.Focus();
- }
- }
- }
- ///
- /// 添加保存成功后执行
- ///
- ///
- ///
- private void OnAddRecordCallBack(object sender, EventArgs e)
- {
- FormDialogModel dialogModel = new FormDialogModel()
- {
- DialogDllName = "Lskj.PubAdd.dll",
- PubDialogType = DialogType.PubAddRecord,
- ReturnTag = ModuleAddControl.ControlObj
- };
- this.Tag = dialogModel;
- }
- ///
- /// 分割条位置改变时
- ///
- ///
- ///
+ }
+ ///
+ /// 说明:初始化多标签
+ /// 创建人:龚宇超
+ /// 创建日期:2017-11-10
+ /// 修改人:
+ /// 修改日期:
+ /// 修改备注:
+ /// 版本:1.0
+ ///
+ private void CreateTabDetail()
+ {
+ this.Invoke((EventHandler)delegate
+ {
+ bool isInside = false;
+
+ foreach (DataRow item in this.details.Rows)
+ {
+ if (this.details.Columns.Contains("orderId") && !string.IsNullOrWhiteSpace(item["orderId"] + "") && int.Parse(item["orderId"] + "") < 0)
+ {
+ continue;
+ }
+
+ XtraTabPage tabPage = new XtraTabPage();
+ GridDetailModel detailModel = new GridDetailModel(item, null, GridCustomColumnStruct.BaseDetailGridView);
+ if (!string.IsNullOrEmpty(detailModel.UnionModule))
+ {
+ ModuleModel moduleModel = new ModuleModel(MainImpl.GetSystemdllTab(detailModel.UnionModule));
+ if (string.IsNullOrWhiteSpace(moduleModel.FormKey))
+ {
+ string text = Business.Impl.LanguageTranslation.Translatable ? Business.Impl.LanguageTranslation.GetTranslatedText("模块配置错误") : "模块配置错误";
+ MessageUtil.Show(detailModel.DetailName + text);
+ return;
+ }
+ detailModel.DetailSql = moduleModel.MenuSql;
+ }
+ detailModel.GridColumns = ReportImpl.GetReportDetailColumns(Model.ModuleCode, item["id"] + "");
+ tabPage.Text = detailModel.DetailName;
+ tabPage.Tag = detailModel;
+ if (ModuleAddControl.plMainControlObj.Tag is XtraTabControl)
+ {
+ XtraTabControl xtr = ModuleAddControl.plMainControlObj.Tag as XtraTabControl;
+ xtr.TabPages.Add(tabPage);
+ isInside = true;
+ xtr.SelectedPageChanged += new DevExpress.XtraTab.TabPageChangedEventHandler(this.OnSelectedPageChanged);
+ xtr.SelectedPageChanging += new DevExpress.XtraTab.TabPageChangingEventHandler(this.OnSelectedPageChanging);
+ }
+ else
+ {
+ this.xtcControl.TabPages.Add(tabPage);
+ }
+ }
+
+ this.xtcControl.ShowTabHeader = details.Rows.Count > 0 && !isInside ? DefaultBoolean.True : DefaultBoolean.False;
+ });
+ }
+
+ ///
+ /// 说明:创建控件
+ /// 创建人:龚宇超
+ /// 创建日期:2017-11-03
+ /// 修改人:
+ /// 修改日期:
+ /// 修改备注:
+ /// 版本:1.0
+ ///
+ private void CreateControlLocation()
+ {
+ this.ModuleAddControl.SavaState = Model.SaveState.Equals("1");
+ this.ModuleAddControl.IsView = Model.IsView;
+ this.ModuleAddControl.ParentKey = Model.ParentKey;
+ this.ModuleAddControl.ParentValue = Model.ParentValue;
+ this.ModuleAddControl.PrimaryKey = this.SysModel.ParmaryKey;// BaseImpl.GetBasePrimaryKey(Model.ModuleCode); 和上方获取主键执行方法相同,直接取上方的值
+ this.ModuleAddControl.UnionKey = Model.UnionKey;
+ this.ModuleAddControl.UnionValue = Model.UnionValue;
+ this.ModuleAddControl.PrimaryValue = Model.ObjectId;
+ this.ModuleAddControl.ControlSql = Model.ControlSql;
+ this.ModuleAddControl.OnCloseCallback += new EventHandler(OnCloseCallback);
+ this.ModuleAddControl.SearchObject = Model.SearchObject;
+
+ if (this.details.Columns.Contains("orderId"))
+ {
+ DataRow[] dataRows = details.Select("orderId<0");
+ this.ModuleAddControl.DetailsData = dataRows;
+ }
+
+ this.ModuleAddControl.InitializeControl(SysModel, Model, isAutoScroll);
+
+ }
+
+ ///
+ /// 说明:关闭按钮回调
+ /// 创建人:龚宇超
+ /// 创建日期:2017-11-08
+ /// 修改人:
+ /// 修改日期:
+ /// 修改备注:
+ /// 版本:1.0
+ ///
+ /// The source of the event.
+ /// The instance containing the event data.
+ protected void OnCloseCallback(object sender, EventArgs e)
+ {
+ try
+ {
+ this.DialogResult = DialogResult.OK;
+ this.Close();
+ }
+ catch (Exception ex)
+ {
+ string Message = ErrorMessage.PromptErrorMessage(ex);
+ MessageUtil.Show(Message, ex.Message);
+ }
+ }
+ ///
+ /// 说明:查询条件执行前
+ /// 创建人:龚宇超
+ /// 创建日期:2017-11-10
+ /// 修改人:
+ /// 修改日期:
+ /// 修改备注:
+ /// 版本:1.0
+ ///
+ /// The sender.
+ /// The e.
+ protected void OnSearchBefore(object sender, SearchArgs e)
+ {
+ try
+ {
+ XtraTabPage tabPage = xtcControl.SelectedTabPage;
+ if (ModuleAddControl.plMainControlObj.Tag is XtraTabControl)
+ {
+ XtraTabControl xtr = ModuleAddControl.plMainControlObj.Tag as XtraTabControl;
+ tabPage = xtr.SelectedTabPage;
+ }
+ if (tabPage != null)
+ {
+ ModuleGridEx moduleGrid = tabPage.Tag as ModuleGridEx;
+ GridDetailModel detailModel = moduleGrid.Tag as GridDetailModel;
+
+ moduleGrid.SearchObj.SearchGrid(detailModel.DetailSql + string.Format(" and {0}='{1}'", moduleGrid.DetailKeyField, moduleGrid.UnionValue));
+ }
+ e.Continue = false;
+ }
+ catch (Exception ex)
+ {
+ string Message = ErrorMessage.PromptErrorMessage(ex);
+ MessageUtil.Show(Message, ex.Message);
+ }
+ }
+ ///
+ /// 说明:查询条件执行后
+ /// 创建人:龚宇超
+ /// 创建日期:2017-11-10
+ /// 修改人:
+ /// 修改日期:
+ /// 修改备注:
+ /// 版本:1.0
+ ///
+ /// The source of the event.
+ /// The instance containing the event data.
+ protected void OnSearchAfter(object sender, EventArgs e)
+ {
+ try
+ {
+ XtraTabPage tabPage = xtcControl.SelectedTabPage;
+ if (ModuleAddControl.plMainControlObj.Tag is XtraTabControl)
+ {
+ XtraTabControl xtr = ModuleAddControl.plMainControlObj.Tag as XtraTabControl;
+ tabPage = xtr.SelectedTabPage;
+ }
+ if (tabPage != null)
+ {
+ if (tabPage.Tag is ModuleGridEx)
+ {
+ ModuleGridEx moduleGrid = tabPage.Tag as ModuleGridEx;
+ GridDetailModel detailModel = moduleGrid.Tag as GridDetailModel;
+ tabPage.Text = detailModel.DetailName + "(" + moduleGrid.SearchObj.GridRowCount + "条)";
+ }
+ else if (tabPage.Tag is GridControlEx)
+ {
+
+ GridControlEx moduleGrid = tabPage.Tag as GridControlEx;
+ GridDetailModel detailModel = moduleGrid.Tag as GridDetailModel;
+ tabPage.Text = detailModel.DetailName + "(" + moduleGrid.DataRowCount() + "条)";
+ }
+
+ }
+ }
+ catch (Exception ex)
+ {
+ string Message = ErrorMessage.PromptErrorMessage(ex);
+ MessageUtil.Show(Message, ex.Message);
+ }
+ }
+ ///
+ /// 说明:切换选项卡
+ /// 创建人:龚宇超
+ /// 创建日期:2018-04-09
+ /// 修改人:
+ /// 修改日期:
+ /// 修改备注:
+ /// 版本:1.0
+ ///
+ /// The source of the event.
+ /// The instance containing the event data.
+ protected void OnSelectedPageChanging(object sender, TabPageChangingEventArgs e)
+ {
+ try
+ {
+ XtraTabPage page = e.Page;
+ if (page != null)
+ {
+ if (e.PrevPage == xtcControl.TabPages[0] && string.IsNullOrEmpty(this.ModuleAddControl.PrimaryValue))
+ {
+ MessageUtil.Show(ResourceKeys.BeforeSaveData);
+ e.Cancel = true;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ string Message = ErrorMessage.PromptErrorMessage(ex);
+ MessageUtil.Show(Message, ex.Message);
+ }
+ }
+ ///
+ /// 说明:切换标签刷新主键值
+ /// 创建人:龚宇超
+ /// 创建日期:2018-04-09
+ /// 修改人:
+ /// 修改日期:
+ /// 修改备注:
+ /// 版本:1.0
+ ///
+ /// The source of the event.
+ /// The instance containing the event data.
+ protected void OnSelectedPageChanged(object sender, TabPageChangedEventArgs e)
+ {
+ try
+ {
+
+ XtraTabPage tabPage = e.Page;
+ ModuleAddControl.OperatePanelControlObj.Visible = true;
+ //XtraTabPage tabPage = this.xtcControl.SelectedTabPage;
+ if (tabPage.Tag is ModuleGridEx) ModuleAddControl.OperatePanelControlObj.Visible = false;
+ if (!(tabPage.Tag is GridDetailModel)) return;
+ ModuleAddControl.OperatePanelControlObj.Visible = false;
+ if (tabPage.Controls.Count == 0)
+ {
+
+ GridDetailModel detailModel = tabPage.Tag as GridDetailModel;
+ ModuleModel moduleModel = null;
+ DynamicAddModel addModel = new DynamicAddModel(new string[] {
+ detailModel.DetailName,
+ ERPInfo.Instance.UserId,
+ ERPInfo.Instance.UserName,
+ "1",detailModel.UnionModule,"","",""
+ });
+ addModel.Params = Model.OtherParams();
+ if (detailModel.IsWebView)
+ {
+ // 加载网页
+ string url = detailModel.DetailSql.StartsWith("http") ? detailModel.DetailSql : SystemInfo.Instance.OAUrl + detailModel.DetailSql;
+ if (!string.IsNullOrWhiteSpace(Model.ParentKey))
+ {
+ string codeSql = "select";
+ codeSql += string.Format(" '{0}' as {1}", Model.ObjectId, this.SysModel.ParmaryKey);
+ url = ReplaceHelper.ReplaceRowParam(BaseImpl.GetDataRowResult(codeSql), ReplaceHelper.ReplaceWhereCond(detailModel.DetailSql));
+ }
+ if (this.ModuleAddControl.ControlObj.CurrentData != null) url = ReplaceHelper.ReplaceRowParam(this.ModuleAddControl.ControlObj.CurrentData, url);
+ //url= System.Web.HttpUtility.UrlEncode(url);
+
+ if (SystemInfo.Instance.PrimitiveBrowser)
+ {
+ FrmMiniBlink webView = new FrmMiniBlink();
+ webView.IsDownVerify = true;
+ webView.Dock = DockStyle.Fill;
+ webView.Tag = detailModel;
+ tabPage.Tag = webView;
+ tabPage.Controls.Add(webView);
+ webView.LoadUrl(ReplaceHelper.ReplaceUserInfo(url));
+ }
+ else
+ {
+ FrmWebBrowser webView = new FrmWebBrowser();
+ webView.Dock = DockStyle.Fill;
+ webView.Tag = detailModel;
+ tabPage.Tag = webView;
+ tabPage.Controls.Add(webView);
+ webView.FrmLoad(ReplaceHelper.ReplaceUserInfo(url));
+ }
+ }
+ else if (detailModel.IsWebView2)
+ {
+ // 加载网页
+ string url = detailModel.DetailSql.StartsWith("http") ? detailModel.DetailSql : SystemInfo.Instance.OAUrl + detailModel.DetailSql;
+ //url= System.Web.HttpUtility.UrlEncode(url);
+ if (this.ModuleAddControl.ControlObj.CurrentData != null) url = ReplaceHelper.ReplaceRowParam(this.ModuleAddControl.ControlObj.CurrentData, url);
+ if (SystemInfo.Instance.PrimitiveBrowser)
+ {
+ FrmMiniBlink webView = new FrmMiniBlink();
+ webView.Dock = DockStyle.Fill;
+ webView.Tag = detailModel;
+ tabPage.Tag = webView;
+ tabPage.Controls.Add(webView);
+ webView.LoadUrl(ReplaceHelper.ReplaceUserInfo(url));
+ }
+ else
+ {
+ FrmWebBrowser2 webView = new FrmWebBrowser2();
+ webView.Dock = DockStyle.Fill;
+ webView.Tag = detailModel;
+ tabPage.Tag = webView;
+ tabPage.Controls.Add(webView);
+ webView.FrmLoad(ReplaceHelper.ReplaceUserInfo(url));
+ }
+ }
+ else if (detailModel.IsWebView3)
+ {
+ // 加载网页
+ string url = detailModel.DetailSql.StartsWith("http") ? detailModel.DetailSql : SystemInfo.Instance.OAUrl + detailModel.DetailSql;
+ //url= System.Web.HttpUtility.UrlEncode(url);
+ if (this.ModuleAddControl.ControlObj.CurrentData != null) url = ReplaceHelper.ReplaceRowParam(this.ModuleAddControl.ControlObj.CurrentData, url);
+ if (SystemInfo.Instance.PrimitiveBrowser)
+ {
+ FrmMiniBlink webView = new FrmMiniBlink();
+ webView.AllowDownload = false;
+ webView.Dock = DockStyle.Fill;
+ webView.Tag = detailModel;
+ tabPage.Tag = webView;
+ tabPage.Controls.Add(webView);
+ webView.LoadUrl(ReplaceHelper.ReplaceUserInfo(url));
+ }
+ else
+ {
+ FrmWebBrowser2 webView = new FrmWebBrowser2();
+ webView.Dock = DockStyle.Fill;
+ webView.Tag = detailModel;
+ webView.AllowDownload = false;
+ tabPage.Tag = webView;
+ tabPage.Controls.Add(webView);
+ webView.FrmLoad(ReplaceHelper.ReplaceUserInfo(url));
+ }
+ }
+ else if (string.IsNullOrEmpty(detailModel.UnionModule))
+ {
+ PanelControl plBottom = new PanelControl();
+ plBottom.Dock = DockStyle.Bottom;
+ plBottom.Visible = false;
+ PanelControl plMain = new PanelControl();
+ plMain.Dock = DockStyle.Fill;
+ GridControlEx gridEx = detailModel.AutoMultiHeader == 1 ? new BandedGridControlEx() : new GridControlEx();
+ gridEx.Dock = DockStyle.Fill;
+ gridEx.Tag = detailModel;
+ gridEx.Parent = plMain;
+ gridEx.Model = this.Model;
+ gridEx.SetReadOnlyColumns(detailModel.GridColumns, detailModel.GridCustomColumnKey);
+ //gridEx.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(model.FormKey), this.Model, OnGridViewRightCallBack);
+ //gridEx.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(model.FormKey));
+
+ gridEx.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(detailModel.FormKey), this.Model);
+ gridEx.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(detailModel.FormKey));
+ if (detailModel.IsCheck == 1)//加载复选框
+ {
+ GridDragGrid.GridAddCheckBox(gridEx.GridView);
+ }
+ // 加载配置查询条件
+ if (Model != null && Model.IsDetailSearch)
+ {
+ plBottom.Visible = true;
+ MyControl searchObj = new MyControl(detailModel.DetailSql, gridEx);
+ plBottom.Height = searchObj.InitSearchControl(BaseModuleImpl.GetCustomQueryFields(detailModel.FormKey), plBottom);
+ }
+ tabPage.Tag = gridEx;
+ tabPage.Controls.AddRange(new PanelControl[] { plBottom, plMain });
+ if (detailModel.AutoRefresh)
+ {
+ if (!string.IsNullOrWhiteSpace(this.ModuleAddControl.ParentKey))
+ {
+ string codeSql = "select";
+ codeSql += string.Format(" '{0}' as {1}", this.ModuleAddControl.PrimaryValue, this.ModuleAddControl.PrimaryKey);
+ gridEx.SetGridViewDataSource(SqlHelper.ExecuteDataTable(ReplaceHelper.ReplaceRowParam(BaseImpl.GetDataRowResult(codeSql), ReplaceHelper.ReplaceWhereCond(detailModel.DetailSql))));
+ }
+ else if (this.ModuleAddControl.ControlObj.CurrentData != null)
+ {
+ gridEx.SetGridViewDataSource(SqlHelper.ExecuteDataTable(ReplaceHelper.ReplaceRowParam(this.ModuleAddControl.ControlObj.CurrentData, ReplaceHelper.ReplaceWhereCond(detailModel.DetailSql))));
+ }
+ // 自动刷新
+ }
+ }
+ else
+ {
+
+ moduleModel = new ModuleModel(MainImpl.GetSystemdllTab(detailModel.UnionModule));
+ moduleModel.maintabFocusedRow = SysModel.maintabFocusedRow;
+ ModuleGridEx moduleGrid = new ModuleGridEx();
+ moduleGrid.IsDetail = true;
+ moduleGrid.Dock = DockStyle.Fill;
+ moduleGrid.Tag = detailModel;
+ moduleGrid.ParentKeyField = string.IsNullOrEmpty(detailModel.UnionParentField) ? SysModel.ParmaryKey : detailModel.UnionParentField;
+
+ //直接在控件数据源中取值,控件可能是禁显状态(没用控件获取不到值)
+ if (!string.IsNullOrWhiteSpace(moduleGrid.ParentKeyField) && this.ModuleAddControl.ControlObj.CurrentData.Table.Columns.Contains(moduleGrid.ParentKeyField))
+ {
+ moduleGrid.ParentKeyValue = moduleGrid.UnionValue = this.ModuleAddControl.ControlObj.CurrentData[moduleGrid.ParentKeyField] + "";
+ }
+
+ if (detailModel.AddHideBottomPanel || detailModel.HideBottomPanel || detailModel.Library.Equals("Lskj.Report.dll", StringComparison.OrdinalIgnoreCase))
+ {
+ moduleGrid.VisibleOperPanel = false;
+ }
+
+ //moduleGrid.ParentKeyValue = this.ModuleAddControl.ControlObj.GetControlValue(moduleGrid.ParentKeyField);
+ moduleGrid.DetailKeyField = detailModel.UnionValue;
+ moduleGrid.UnionKey = detailModel.UnionValue;
+ //moduleGrid.UnionValue = this.ModuleAddControl.ControlObj.GetControlValue(moduleGrid.ParentKeyField); //Model.ObjectId;
+ moduleGrid.SearchControlSql = Model.ControlSql;
+ moduleGrid.InitializeControl(moduleModel, addModel);
+ moduleGrid.SearchObj.OnSearchBeforeCallBack += new SearchEventHandler(OnSearchBefore);
+ moduleGrid.SearchObj.OnSearchAfterCallBack += new EventHandler(OnSearchAfter);
+ Lskj.Control.Model.AutoSizeChange.ControllInitializeSize(moduleGrid);
+ tabPage.Controls.Add(moduleGrid);
+ tabPage.Tag = moduleGrid;
+ if (detailModel.AutoRefresh)
+ {
+ moduleGrid.SearchObj.OnDataSourceBindCallBack += new EventHandler(OnMainSearchDataSourceBindCallBack);
+ // 自动刷新
+ //moduleGrid.SearchObj.SearchGrid(ReplaceHelper.ReplaceWhereCond(moduleModel.MenuSql) + string.Format(" and {0}='{1}'", moduleGrid.DetailKeyField, moduleGrid.UnionValue));
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ string Message = ErrorMessage.PromptErrorMessage(ex);
+ MessageUtil.Show(Message, ex.Message);
+ }
+ }
+ ///
+ /// 说明:查询条件绑定完成查询数据
+ /// 创建人:龚宇超
+ /// 创建日期:
+ /// 修改人:
+ /// 修改日期:
+ /// 修改备注:
+ /// 版本:1.0
+ ///
+ /// The sender.
+ /// The instance containing the event data.
+ protected void OnMainSearchDataSourceBindCallBack(object sender, EventArgs e)
+ {
+ try
+ {
+ MyControl searchobj = sender as MyControl;
+ //if (!string.IsNullOrEmpty(this.SysModel.CustomColumnSQL))
+ //{
+ // BaseImpl.ExecSqlValue(searchobj.ReplaceControlValue(this.SysModel.CustomColumnSQL));
+ //}
+ searchobj.SearchGrid();
+ OnSearchAfter(null, null);
+ }
+ catch (Exception ex)
+ {
+ string Message = ErrorMessage.PromptErrorMessage(ex);
+ MessageUtil.Show(Message, ex.Message);
+ }
+
+ }
+ ///
+ /// 清理后回调
+ ///
+ ///
+ ///
+ private void OnClearCallBack(object sender, EventArgs e)
+ {
+ //新增时输入焦点
+ ControlModel controlModel = ModuleAddControl.ControlObj.ControlModels.Where(n => n.Location.X != 0 || n.Location.Y != 0).OrderBy(n => n.TabOrder).FirstOrDefault();
+ if (controlModel != null)
+ {
+ BaseUserControl baseControl = ModuleAddControl.ControlObj.FindControl(controlModel);
+ if (baseControl != null)
+ {
+ baseControl.Focus();
+ }
+ }
+ }
+ ///
+ /// 添加保存成功后执行
+ ///
+ ///
+ ///
+ private void OnAddRecordCallBack(object sender, EventArgs e)
+ {
+ FormDialogModel dialogModel = new FormDialogModel()
+ {
+ DialogDllName = "Lskj.PubAdd.dll",
+ PubDialogType = DialogType.PubAddRecord,
+ ReturnTag = ModuleAddControl.ControlObj
+ };
+ this.Tag = dialogModel;
+ }
+ ///
+ /// 分割条位置改变时
+ ///
+ ///
+ ///
private void OnSplitterPositionChanged(object sender, EventArgs e)
{
IniHelper.Write(string.Format("ModulePanelExAdd_Split_{0}", this.Model.ModuleCode), this.ModuleAddControl.SplitContainerControl.SplitterPosition + "");
}
- ///
- /// 说明:窗口关闭
- /// 创建人:龚宇超
- /// 创建日期:2019-07-15
- /// 修改人:
- /// 修改日期:
- /// 修改备注:
- /// 版本:1.0
- ///
- /// The source of the event.
- /// The instance containing the event data.
- protected void OnFormClosed(object sender, FormClosedEventArgs e)
- {
- if (this.ModuleAddControl.ControlObj != null)
- {
- this.ModuleAddControl.ControlObj.ReleaseImageResources();
- }
- }
- ///
- /// 说明:窗口关闭之前
- /// 创建人:龚宇超
- /// 创建日期:2019-07-15
- /// 修改人:
- /// 修改日期:
- /// 修改备注:
- /// 版本:1.0
- ///
- /// The source of the event.
- /// The instance containing the event data.
- protected void OnFormClosing(object sender, FormClosingEventArgs e)
- {
- try
- {
- if (this.ModuleAddControl != null && this.ModuleAddControl.IsCard)
- {
- this.ModuleAddControl.CloseIDCardThread();
- }
- this.DialogResult = DialogResult.OK;
- }
- catch (Exception ex)
- {
- string Message = ErrorMessage.PromptErrorMessage(ex);
- MessageUtil.Show(Message, ex.Message);
- }
- }
- protected override CreateParams CreateParams
- {
- get
- {
- CreateParams cp = base.CreateParams;
- cp.ExStyle |= 0x02000000;
- return cp;
- }
- }
- }
-}
+ ///
+ /// 说明:窗口关闭
+ /// 创建人:龚宇超
+ /// 创建日期:2019-07-15
+ /// 修改人:
+ /// 修改日期:
+ /// 修改备注:
+ /// 版本:1.0
+ ///
+ /// The source of the event.
+ /// The instance containing the event data.
+ protected void OnFormClosed(object sender, FormClosedEventArgs e)
+ {
+ if (this.ModuleAddControl.ControlObj != null)
+ {
+ this.ModuleAddControl.ControlObj.ReleaseImageResources();
+ }
+ }
+ ///
+ /// 说明:窗口关闭之前
+ /// 创建人:龚宇超
+ /// 创建日期:2019-07-15
+ /// 修改人:
+ /// 修改日期:
+ /// 修改备注:
+ /// 版本:1.0
+ ///
+ /// The source of the event.
+ /// The instance containing the event data.
+ protected void OnFormClosing(object sender, FormClosingEventArgs e)
+ {
+ try
+ {
+ if (this.ModuleAddControl != null && this.ModuleAddControl.IsCard)
+ {
+ this.ModuleAddControl.CloseIDCardThread();
+ }
+ this.DialogResult = DialogResult.OK;
+ }
+ catch (Exception ex)
+ {
+ string Message = ErrorMessage.PromptErrorMessage(ex);
+ MessageUtil.Show(Message, ex.Message);
+ }
+ }
+ protected override CreateParams CreateParams
+ {
+ get
+ {
+ CreateParams cp = base.CreateParams;
+ cp.ExStyle |= 0x02000000;
+ return cp;
+ }
+ }
+ }
+}
diff --git a/插件库/Lskj.PubBillManagement/BillModule.cs b/插件库/Lskj.PubBillManagement/BillModule.cs
index 912ef9c..c725762 100644
--- a/插件库/Lskj.PubBillManagement/BillModule.cs
+++ b/插件库/Lskj.PubBillManagement/BillModule.cs
@@ -1,552 +1,552 @@
-using DevExpress.Data;
-using DevExpress.Utils;
-using DevExpress.XtraBars;
-using DevExpress.XtraEditors;
-using DevExpress.XtraGrid.Columns;
-using DevExpress.XtraGrid.Views.Base;
-using DevExpress.XtraGrid.Views.Grid;
-using DevExpress.XtraTab;
-using DevExpress.XtraTreeList.Columns;
-using DevExpress.XtraTreeList.Nodes;
-using Lskj.Business;
-using Lskj.Business.Impl;
-using Lskj.Control;
-using Lskj.Control.BrowserSetting;
-using Lskj.Control.Model;
-using Lskj.Core;
-using Lskj.Data;
-using Lskj.Model;
-using Lskj.PubBillManagement.Model;
-using Lskj.Util;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Data.SqlClient;
-using System.Drawing;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Reflection;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace Lskj.PubBillManagement
-{
- public partial class BillModule : UserControl
- {
- private static void AttachCachedTask(
- Dictionary