SVN r654
SVN-Revision: r654
This commit is contained in:
@@ -382,6 +382,7 @@ namespace Lskj.Control
|
|||||||
{
|
{
|
||||||
this.gridFinish.SetReadOnlyColumns(BaseAuditImpl.GetAuditMainGridCoulmns(AuditComModelObj.SystemTable, this.SysModel.ModuleCode), modelkeyName + key);
|
this.gridFinish.SetReadOnlyColumns(BaseAuditImpl.GetAuditMainGridCoulmns(AuditComModelObj.SystemTable, this.SysModel.ModuleCode), modelkeyName + key);
|
||||||
}
|
}
|
||||||
|
this.gridFinish.Model = this.SysModel;
|
||||||
// 创建自定义搜索控件
|
// 创建自定义搜索控件
|
||||||
this.SearchCreateTopControl();
|
this.SearchCreateTopControl();
|
||||||
}
|
}
|
||||||
@@ -616,6 +617,7 @@ namespace Lskj.Control
|
|||||||
pcGrid.Parent = gridPanel;
|
pcGrid.Parent = gridPanel;
|
||||||
pcGrid.Dock = DockStyle.Fill;
|
pcGrid.Dock = DockStyle.Fill;
|
||||||
pcGrid.GridView.Tag = accrModel;
|
pcGrid.GridView.Tag = accrModel;
|
||||||
|
pcGrid.Model = SysModel;
|
||||||
//pcGrid.GridView.RowClick += new DevExpress.XtraGrid.Views.Grid.RowClickEventHandler(OnPcgridRowCellClick);
|
//pcGrid.GridView.RowClick += new DevExpress.XtraGrid.Views.Grid.RowClickEventHandler(OnPcgridRowCellClick);
|
||||||
//pcGrid.GridView.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(OnPcgridRowFocusedRowChanged);
|
//pcGrid.GridView.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(OnPcgridRowFocusedRowChanged);
|
||||||
LabelControl lab = new LabelControl();
|
LabelControl lab = new LabelControl();
|
||||||
|
|||||||
@@ -20,22 +20,35 @@ namespace Lskj.Control
|
|||||||
public string ShowValue = "", ShowText = "";
|
public string ShowValue = "", ShowText = "";
|
||||||
public MyControl ControlObj;
|
public MyControl ControlObj;
|
||||||
public ControlModel mControlModel;
|
public ControlModel mControlModel;
|
||||||
|
public int ListBoxFontSize = 0;
|
||||||
public FrmComboxMutilPopup()
|
public FrmComboxMutilPopup()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FrmComboxMutilPopup(ControlModel model, string showValue, string showText, MyControl ControlObj)
|
public FrmComboxMutilPopup(ControlModel model, string showValue, string showText, MyControl ControlObj,int FontSize= 0)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
this.ListBoxFontSize = FontSize;
|
||||||
this.ShowValue = showValue;
|
this.ShowValue = showValue;
|
||||||
this.ShowText = showText;
|
this.ShowText = showText;
|
||||||
this.mControlModel = model;
|
this.mControlModel = model;
|
||||||
this.ControlObj = ControlObj;
|
this.ControlObj = ControlObj;
|
||||||
this.Text = model.LabelText + "选择";
|
this.Text = model.LabelText + "选择";
|
||||||
|
if (this.ListBoxFontSize>0)
|
||||||
|
{
|
||||||
|
foreach (System.Windows.Forms.Control ctrol in this.panel2.Controls)
|
||||||
|
{
|
||||||
|
if (ctrol is SimpleButton)
|
||||||
|
{
|
||||||
|
SimpleButton simpleButton = ctrol as SimpleButton;
|
||||||
|
Font oldFont = simpleButton.Font;
|
||||||
|
simpleButton.Font = new Font(oldFont.Name, ListBoxFontSize);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
this.OnLoad();
|
this.OnLoad();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -82,6 +95,14 @@ namespace Lskj.Control
|
|||||||
btn.Text = text.Length > 6 ? text.Substring(0, 6) + "\n" + text.Substring(6) : text;
|
btn.Text = text.Length > 6 ? text.Substring(0, 6) + "\n" + text.Substring(6) : text;
|
||||||
btn.Click -= new EventHandler(btn_Click);
|
btn.Click -= new EventHandler(btn_Click);
|
||||||
btn.Click += new EventHandler(btn_Click);
|
btn.Click += new EventHandler(btn_Click);
|
||||||
|
|
||||||
|
if (ListBoxFontSize>0)
|
||||||
|
{
|
||||||
|
Font oldFont = btn.Font;
|
||||||
|
btn.Font = new Font(oldFont.Name, ListBoxFontSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.SetSelect(btn, this.ShowValue.Contains(rowItem[this.mControlModel.ValueMember] + ","));
|
this.SetSelect(btn, this.ShowValue.Contains(rowItem[this.mControlModel.ValueMember] + ","));
|
||||||
}
|
}
|
||||||
controlIndex++;
|
controlIndex++;
|
||||||
@@ -184,41 +205,4 @@ namespace Lskj.Control
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||||
MessageUtil.Show(Message,ex.Message);
|
MessageUtil.Show(Message,ex.Messag
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void simpleButton24_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
if (this.mPage < this.mMaxPage)
|
|
||||||
{
|
|
||||||
this.mPage += 1;
|
|
||||||
this.InitControl();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
||||||
MessageUtil.Show(Message,ex.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void simpleButton25_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
if (this.mPage == this.mMaxPage) return;
|
|
||||||
this.mPage = this.mMaxPage;
|
|
||||||
this.InitControl();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
||||||
MessageUtil.Show(Message,ex.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -20,20 +20,34 @@ namespace Lskj.Control
|
|||||||
public string ShowValue, ShowText;
|
public string ShowValue, ShowText;
|
||||||
public MyControl ControlObj;
|
public MyControl ControlObj;
|
||||||
public ControlModel mControlModel;
|
public ControlModel mControlModel;
|
||||||
|
public int ListBoxFontSize = 0;
|
||||||
|
|
||||||
public FrmComboxPopup()
|
public FrmComboxPopup()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FrmComboxPopup(ControlModel model, MyControl controlObj)
|
public FrmComboxPopup(ControlModel model, MyControl controlObj, int FontSize = 0)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
this.ListBoxFontSize = FontSize;
|
||||||
this.mControlModel = model;
|
this.mControlModel = model;
|
||||||
this.ControlObj = controlObj;
|
this.ControlObj = controlObj;
|
||||||
this.Text = model.LabelText + "选择";
|
this.Text = model.LabelText + "选择";
|
||||||
|
if (this.ListBoxFontSize > 0)
|
||||||
|
{
|
||||||
|
foreach (System.Windows.Forms.Control ctrol in this.panel3.Controls)
|
||||||
|
{
|
||||||
|
if (ctrol is SimpleButton)
|
||||||
|
{
|
||||||
|
SimpleButton simpleButton = ctrol as SimpleButton;
|
||||||
|
Font oldFont = simpleButton.Font;
|
||||||
|
simpleButton.Font = new Font(oldFont.Name, ListBoxFontSize);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
this.OnLoad();
|
this.OnLoad();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -79,7 +93,16 @@ namespace Lskj.Control
|
|||||||
btn.Tag = rowItem;
|
btn.Tag = rowItem;
|
||||||
//text.Length > 6 ? text.Substring(0, 6) + "\n" + text.Substring(6) :
|
//text.Length > 6 ? text.Substring(0, 6) + "\n" + text.Substring(6) :
|
||||||
btn.Text = text;
|
btn.Text = text;
|
||||||
btn.Font = new Font("微软雅黑", 12);
|
if (ListBoxFontSize > 0)
|
||||||
|
{
|
||||||
|
btn.Font = new Font("微软雅黑", ListBoxFontSize);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
btn.Font = new Font("微软雅黑", 12);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
btn.Click -= new EventHandler(btn_Click);
|
btn.Click -= new EventHandler(btn_Click);
|
||||||
btn.Click += new EventHandler(btn_Click);
|
btn.Click += new EventHandler(btn_Click);
|
||||||
}
|
}
|
||||||
@@ -140,41 +163,4 @@ namespace Lskj.Control
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||||
MessageUtil.Show(Message,ex.Message);
|
MessageUtil.Show(Message,ex.Messa
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void simpleButton24_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
if (this.mPage < this.mMaxPage)
|
|
||||||
{
|
|
||||||
this.mPage += 1;
|
|
||||||
this.InitControl();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
||||||
MessageUtil.Show(Message,ex.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void simpleButton25_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
if (this.mPage == this.mMaxPage) return;
|
|
||||||
this.mPage = this.mMaxPage;
|
|
||||||
this.InitControl();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
||||||
MessageUtil.Show(Message,ex.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -15,6 +15,10 @@ namespace Lskj.Control
|
|||||||
{
|
{
|
||||||
public string editValue = "";
|
public string editValue = "";
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 弹出框中字体大小
|
||||||
|
/// </summary>
|
||||||
|
public int ListBoxFontSize = 0;
|
||||||
|
/// <summary>
|
||||||
/// 文本控件
|
/// 文本控件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public TextEdit TextEdit { get { return txtEdit; } }
|
public TextEdit TextEdit { get { return txtEdit; } }
|
||||||
@@ -185,7 +189,7 @@ namespace Lskj.Control
|
|||||||
|
|
||||||
public void ShowPopup()
|
public void ShowPopup()
|
||||||
{
|
{
|
||||||
FrmComboxMutilPopup popup = new FrmComboxMutilPopup(this.Model, this.editValue, this.EditText, ControlObj);
|
FrmComboxMutilPopup popup = new FrmComboxMutilPopup(this.Model, this.editValue, this.EditText, ControlObj, ListBoxFontSize);
|
||||||
DialogResult result = popup.ShowDialog();
|
DialogResult result = popup.ShowDialog();
|
||||||
if (result == DialogResult.OK)
|
if (result == DialogResult.OK)
|
||||||
{
|
{
|
||||||
@@ -215,41 +219,4 @@ namespace Lskj.Control
|
|||||||
this.ShowPopup();
|
this.ShowPopup();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
|
||||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
||||||
MessageUtil.Show(Message,ex.Message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void simpleButton1_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
this.ShowPopup();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
||||||
MessageUtil.Show(Message,ex.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void simpleButton4_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
this.editValue = this.EditText = "";
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
||||||
MessageUtil.Show(Message,ex.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public Control.Model.MyControl ControlObj { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ namespace Lskj.Control
|
|||||||
/// 数据源
|
/// 数据源
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DataTable table = new DataTable();
|
public DataTable table = new DataTable();
|
||||||
|
/// <summary>
|
||||||
|
/// 弹出框中字体大小
|
||||||
|
/// </summary>
|
||||||
|
public int ListBoxFontSize = 0;
|
||||||
|
|
||||||
public LabelComboxPopupEdit()
|
public LabelComboxPopupEdit()
|
||||||
{
|
{
|
||||||
@@ -230,7 +234,7 @@ namespace Lskj.Control
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void ShowPopup()
|
public void ShowPopup()
|
||||||
{
|
{
|
||||||
FrmComboxPopup popup = new FrmComboxPopup(this.Model, this.ControlObj);
|
FrmComboxPopup popup = new FrmComboxPopup(this.Model, this.ControlObj, ListBoxFontSize);
|
||||||
DialogResult result = popup.ShowDialog();
|
DialogResult result = popup.ShowDialog();
|
||||||
if (result == DialogResult.OK)
|
if (result == DialogResult.OK)
|
||||||
{
|
{
|
||||||
@@ -258,42 +262,3 @@ namespace Lskj.Control
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.ShowPopup();
|
this.ShowPopup();
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
||||||
MessageUtil.Show(Message,ex.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void simpleButton1_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
this.ShowPopup();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
||||||
MessageUtil.Show(Message,ex.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void simpleButton4_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
this.editValue = this.EditText = "";
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
||||||
MessageUtil.Show(Message,ex.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -16,6 +16,8 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using DevExpress.XtraEditors;
|
using DevExpress.XtraEditors;
|
||||||
|
using DevExpress.XtraEditors.Repository;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Lskj.Control
|
namespace Lskj.Control
|
||||||
{
|
{
|
||||||
@@ -43,6 +45,7 @@ namespace Lskj.Control
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>说明:设置控件显示文本</para>
|
/// <para>说明:设置控件显示文本</para>
|
||||||
/// <para>创建人:龚宇超</para>
|
/// <para>创建人:龚宇超</para>
|
||||||
@@ -204,17 +207,4 @@ namespace Lskj.Control
|
|||||||
/// <para>版本:1.0</para>
|
/// <para>版本:1.0</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="formatString">The format string.</param>
|
/// <param name="formatString">The format string.</param>
|
||||||
public void DateFormat(string formatString)
|
publi
|
||||||
{
|
|
||||||
if (!string.IsNullOrWhiteSpace(formatString))
|
|
||||||
{
|
|
||||||
this.txtEdit.Properties.DisplayFormat.FormatString = this.txtEdit.Properties.EditFormat.FormatString = this.txtEdit.Properties.Mask.EditMask = formatString;
|
|
||||||
this.txtEdit.Properties.DisplayFormat.FormatType = this.txtEdit.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Custom;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -298,4 +298,8 @@ namespace Lskj.Control.Model
|
|||||||
/// 条件
|
/// 条件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string SplicingConditions;
|
public string SplicingConditions;
|
||||||
/// <
|
/// <summary>
|
||||||
|
///模块选择返回框,是否单选模式
|
||||||
|
/// </summary>
|
||||||
|
public bool IsRadio { get; set; }
|
||||||
|
/
|
||||||
@@ -347,6 +347,10 @@ namespace Lskj.Control.Model
|
|||||||
/// 聚合字段列
|
/// 聚合字段列
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int IsCustomGroupField;
|
public int IsCustomGroupField;
|
||||||
|
/// <summary>
|
||||||
|
/// 导入时转格式
|
||||||
|
/// </summary>
|
||||||
|
public string ImportConversionFormat;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -439,4 +443,4 @@ namespace Lskj.Control.Model
|
|||||||
this._lookUpWidth = item.Table.Columns.Contains("LookUpWidth") ? int.TryParse(item["LookUpWidth"] + "", out int lookUpWidth) ? lookUpWidth : 0 : 0;
|
this._lookUpWidth = item.Table.Columns.Contains("LookUpWidth") ? int.TryParse(item["LookUpWidth"] + "", out int lookUpWidth) ? lookUpWidth : 0 : 0;
|
||||||
this._lookUpFieldsWidth = item.Table.Columns.Contains("LookUpFieldsWidth") ? item["LookUpFieldsWidth"] + "" : "";
|
this._lookUpFieldsWidth = item.Table.Columns.Contains("LookUpFieldsWidth") ? item["LookUpFieldsWidth"] + "" : "";
|
||||||
this.isDynamic = item.Table.Columns.Contains("isDynamic") && !string.IsNullOrWhiteSpace(item["isDynamic"] + "") ? "1".Equals(item["isDynamic"] + "") : false;
|
this.isDynamic = item.Table.Columns.Contains("isDynamic") && !string.IsNullOrWhiteSpace(item["isDynamic"] + "") ? "1".Equals(item["isDynamic"] + "") : false;
|
||||||
th
|
this.ConfigureColumnMode = item.Table.Columns.Contains("ConfigureColumnMode") && !string.IsNullOrWhiteSpace(item["ConfigureColumnMode"] + "") ? "1".Equa
|
||||||
@@ -1920,19 +1920,49 @@ namespace Lskj.Control.Model
|
|||||||
{
|
{
|
||||||
string selWhere = "1=1";
|
string selWhere = "1=1";
|
||||||
DataTable table = ValueGridColumnTable[model];
|
DataTable table = ValueGridColumnTable[model];
|
||||||
if (table != null && table.Rows.Count > 0)
|
|
||||||
|
if (model.FieldType == ControlType.LabMultiSelectValue || model.FieldType == ControlType.LabMultiSelectValueNew || model.FieldType == ControlType.LabMultiSelectValueParam)
|
||||||
{
|
{
|
||||||
DataRow rowItemValue = table.Rows.Cast<DataRow>().FirstOrDefault(x => x[model.TextMember] + "" == text);
|
string[] splitString = text.Split(',');
|
||||||
DataRow rowItemText = table.Rows.Cast<DataRow>().FirstOrDefault(x => x[model.ValueMember] + "" == text);
|
string nemValue = string.Empty;
|
||||||
//value = rowItemValue != null ? rowItemValue[isBillImport ? model.ValueMember : model.TextMember] + "" : rowItemText != null ? rowItemText[isBillImport ? model.ValueMember : model.TextMember] + "" : "";
|
foreach (string newText in splitString)
|
||||||
value = rowItemValue != null ? rowItemValue[model.ValueMember] + "" : rowItemText != null ? rowItemText[model.ValueMember] + "" : "";
|
{
|
||||||
|
if (table != null && table.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
DataRow rowItemValue = table.Rows.Cast<DataRow>().FirstOrDefault(x => x[model.TextMember] + "" == newText);
|
||||||
|
DataRow rowItemText = table.Rows.Cast<DataRow>().FirstOrDefault(x => x[model.ValueMember] + "" == newText);
|
||||||
|
value = rowItemValue != null ? rowItemValue[model.ValueMember] + "" : rowItemText != null ? rowItemText[model.ValueMember] + "" : "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
value = "";
|
||||||
|
}
|
||||||
|
nemValue += value + ',';
|
||||||
|
}
|
||||||
|
value = nemValue.TrimEnd(',');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
value = "";
|
{
|
||||||
|
if (table != null && table.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
DataRow rowItemValue = table.Rows.Cast<DataRow>().FirstOrDefault(x => x[model.TextMember] + "" == text);
|
||||||
|
DataRow rowItemText = table.Rows.Cast<DataRow>().FirstOrDefault(x => x[model.ValueMember] + "" == text);
|
||||||
|
//value = rowItemValue != null ? rowItemValue[isBillImport ? model.ValueMember : model.TextMember] + "" : rowItemText != null ? rowItemText[isBillImport ? model.ValueMember : model.TextMember] + "" : "";
|
||||||
|
value = rowItemValue != null ? rowItemValue[model.ValueMember] + "" : rowItemText != null ? rowItemText[model.ValueMember] + "" : "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
value = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>说明:导入到表格中</para>
|
/// <para>说明:导入到表格中</para>
|
||||||
/// <para>创建人:龚宇超</para>
|
/// <para>创建人:龚宇超</para>
|
||||||
@@ -2074,6 +2104,22 @@ namespace Lskj.Control.Model
|
|||||||
// dataRow[col.FieldName] = cell.StringCellValue;
|
// dataRow[col.FieldName] = cell.StringCellValue;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(SystemInfo.Instance.ImportRemoveSpaces && cell.CellType == CellType.String)
|
||||||
|
{
|
||||||
|
// 清除字符串前后空格
|
||||||
|
string cellValue = cell.StringCellValue.Trim();
|
||||||
|
cell.SetCellValue(cellValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((model.ImportConversionFormat+"").Equals("1"))
|
||||||
|
{
|
||||||
|
// 转成全大写
|
||||||
|
string cellValue = cell.StringCellValue.ToUpper();
|
||||||
|
cell.SetCellValue(cellValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (cell.CellType == CellType.Numeric && (cell.NumericCellValue + "").StartsWith("-"))
|
if (cell.CellType == CellType.Numeric && (cell.NumericCellValue + "").StartsWith("-"))
|
||||||
{
|
{
|
||||||
dataRow[col.FieldName] = cell.NumericCellValue;
|
dataRow[col.FieldName] = cell.NumericCellValue;
|
||||||
@@ -2411,6 +2457,14 @@ namespace Lskj.Control.Model
|
|||||||
//isImportRows = false;
|
//isImportRows = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SystemInfo.Instance.ImportRemoveSpaces && cell.CellType == CellType.String)
|
||||||
|
{
|
||||||
|
// 清除字符串前后空格
|
||||||
|
string cellValue = cell.StringCellValue.Trim();
|
||||||
|
cell.SetCellValue(cellValue);
|
||||||
|
}
|
||||||
|
|
||||||
if (cell.CellType == CellType.Numeric && (cell.NumericCellValue + "").StartsWith("-"))
|
if (cell.CellType == CellType.Numeric && (cell.NumericCellValue + "").StartsWith("-"))
|
||||||
{
|
{
|
||||||
dataRow[col.FieldName] = cell.NumericCellValue;
|
dataRow[col.FieldName] = cell.NumericCellValue;
|
||||||
@@ -3686,47 +3740,4 @@ namespace Lskj.Control.Model
|
|||||||
// 设置填充模式为实心填充
|
// 设置填充模式为实心填充
|
||||||
cellStyle.FillPattern = FillPattern.SolidForeground;
|
cellStyle.FillPattern = FillPattern.SolidForeground;
|
||||||
}
|
}
|
||||||
cell.CellStyle = cellStyle;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 保存更改回原始文件
|
|
||||||
using (FileStream file = new FileStream(excelFilePath, FileMode.Create, FileAccess.Write))
|
|
||||||
{
|
|
||||||
workbook.Write(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否存在未保存的数据
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="control"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static bool IsDataNotSaved(this GridControlEx control)
|
|
||||||
{
|
|
||||||
DataTable table = control.gridControl.DataSource as DataTable;
|
|
||||||
foreach (DataRow row in table.Rows)
|
|
||||||
{
|
|
||||||
if (row.RowState == DataRowState.Modified || row.RowState == DataRowState.Added)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1505,7 +1505,7 @@ namespace Lskj.Control.Model
|
|||||||
// 右键调用Lskj.PubBill.dll、Lskj.PubBillBrp,并且为多选新增,则汇总明细数据且只执行一次.
|
// 右键调用Lskj.PubBill.dll、Lskj.PubBillBrp,并且为多选新增,则汇总明细数据且只执行一次.
|
||||||
bool isOnlyOne = (model.DllName.Equals("lskj.pubbill.dll", StringComparison.OrdinalIgnoreCase) ||
|
bool isOnlyOne = (model.DllName.Equals("lskj.pubbill.dll", StringComparison.OrdinalIgnoreCase) ||
|
||||||
model.DllName.Equals("lskj.pubbillbrp.dll", StringComparison.OrdinalIgnoreCase)) &&
|
model.DllName.Equals("lskj.pubbillbrp.dll", StringComparison.OrdinalIgnoreCase)) &&
|
||||||
!string.IsNullOrEmpty(model.DllParam8) && !string.IsNullOrEmpty(model.DllParam9) && model.MoreClick;
|
!string.IsNullOrEmpty(model.DllParam8) && !string.IsNullOrEmpty(model.DllParam9) && model.Mergeexec;
|
||||||
if (isOnlyOne)
|
if (isOnlyOne)
|
||||||
{
|
{
|
||||||
string fieldValue = paramList[8];
|
string fieldValue = paramList[8];
|
||||||
@@ -1675,14 +1675,18 @@ namespace Lskj.Control.Model
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//多条合并执行时替换参数
|
//多条合并执行时替换参数
|
||||||
fieldValue = fieldValue.Replace("[", "{").Replace("]", "}");
|
//先替换{},替换的是选中行的数据
|
||||||
|
fieldValue = ReplaceHelper.ReplaceRowParam(rowData, fieldValue.Replace("#", ""));
|
||||||
|
//替换[],替换的是多选行中的数据
|
||||||
|
fieldValue = ReplaceHelper.ReplaceRowParam(rowDatas, fieldValue.Replace("[", "{").Replace("]", "}"), "", "");
|
||||||
|
|
||||||
//如果是sql的情况,可能有 select '[xx]' as xxx 和 where xx in([xxx]) 的情况,start和end不好统一设置,先默认为空
|
//如果是sql的情况,可能有 select '[xx]' as xxx 和 where xx in([xxx]) 的情况,start和end不好统一设置,先默认为空
|
||||||
//string start = "'", end = "'";
|
//string start = "'", end = "'";
|
||||||
//if (fieldValue.ToUpper().Contains("EXEC"))
|
//if (fieldValue.ToUpper().Contains("EXEC"))
|
||||||
//{
|
//{
|
||||||
// start = end = string.Empty;
|
// start = end = string.Empty;
|
||||||
//}
|
//}
|
||||||
handleParamList.Add(ReplaceHelper.ReplaceRowParam(rowDatas, fieldValue, "", "") + "");
|
handleParamList.Add(fieldValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "[": //[FormTitle_格式数据
|
case "[": //[FormTitle_格式数据
|
||||||
@@ -1788,4 +1792,28 @@ namespace Lskj.Control.Model
|
|||||||
DataRow[] dataRows = columnsTab.Select().Where(n => (n["name"] + "").Equals(colunmField.Key)).ToArray();
|
DataRow[] dataRows = columnsTab.Select().Where(n => (n["name"] + "").Equals(colunmField.Key)).ToArray();
|
||||||
if (dataRows.Length == 0)
|
if (dataRows.Length == 0)
|
||||||
{
|
{
|
||||||
string a
|
string addColSql = string.Format("alter table P_PrivateDllTab add {0} {1}", colunmField.Key, colunmField.Value);
|
||||||
|
SqlHelper.ExecuteNonQuery(addColSql);//添加列
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string createTabSql = "create table P_PrivateDllTab(id int IDENTITY(1,1) NOT NULL,{0})";
|
||||||
|
string createCol = string.Empty;
|
||||||
|
foreach (KeyValuePair<string, string> colunmField in colDic)
|
||||||
|
{
|
||||||
|
createCol += string.Format("{0} {1},", colunmField.Key, colunmField.Value);
|
||||||
|
}
|
||||||
|
createTabSql = string.Format(createTabSql, createCol.TrimEnd(','));
|
||||||
|
SqlHelper.ExecuteNonQuery(createTabSql);//创建表
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2969,7 +2969,7 @@ namespace Lskj.Control.Model
|
|||||||
#endregion
|
#endregion
|
||||||
#region 保存成功后上传附件
|
#region 保存成功后上传附件
|
||||||
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);
|
||||||
}
|
}
|
||||||
@@ -3024,7 +3024,7 @@ namespace Lskj.Control.Model
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region 保存后执行某个右键
|
#region 保存后执行某个右键
|
||||||
if (SystemModel!=null&&!string.IsNullOrEmpty(SystemModel.AfterSaveExec))
|
if (SystemModel != null && !string.IsNullOrEmpty(SystemModel.AfterSaveExec))
|
||||||
{
|
{
|
||||||
DataRow menuRow = BaseModuleImpl.GetBaseGridRightMenuById(SystemModel.AfterSaveExec);
|
DataRow menuRow = BaseModuleImpl.GetBaseGridRightMenuById(SystemModel.AfterSaveExec);
|
||||||
if (menuRow != null)
|
if (menuRow != null)
|
||||||
@@ -3287,7 +3287,10 @@ namespace Lskj.Control.Model
|
|||||||
|
|
||||||
this._mainGridEx.LastSearchSql = sqlValue;
|
this._mainGridEx.LastSearchSql = sqlValue;
|
||||||
this._mainGridEx.LastSearchButtonhSql = sqlValue;
|
this._mainGridEx.LastSearchButtonhSql = sqlValue;
|
||||||
|
//while (!_mainGridEx.IsHandleCreated)
|
||||||
|
//{
|
||||||
|
// System.Threading.Thread.Sleep(100);
|
||||||
|
//}
|
||||||
if (_mainGridEx.IsHandleCreated)
|
if (_mainGridEx.IsHandleCreated)
|
||||||
{
|
{
|
||||||
// 窗口加载完成搜索,采用异步加载
|
// 窗口加载完成搜索,采用异步加载
|
||||||
@@ -3924,6 +3927,7 @@ namespace Lskj.Control.Model
|
|||||||
model.ImportReturnValue = item.Table.Columns.Contains("ImportReturnValue") && !string.IsNullOrWhiteSpace(item["ImportReturnValue"] + "") ? "1".Equals(item["ImportReturnValue"] + "") : false;
|
model.ImportReturnValue = item.Table.Columns.Contains("ImportReturnValue") && !string.IsNullOrWhiteSpace(item["ImportReturnValue"] + "") ? "1".Equals(item["ImportReturnValue"] + "") : false;
|
||||||
model.ImportCurrentValue = item.Table.Columns.Contains("ImportCurrentValue") && !string.IsNullOrWhiteSpace(item["ImportCurrentValue"] + "") ? "1".Equals(item["ImportCurrentValue"] + "") : false;
|
model.ImportCurrentValue = item.Table.Columns.Contains("ImportCurrentValue") && !string.IsNullOrWhiteSpace(item["ImportCurrentValue"] + "") ? "1".Equals(item["ImportCurrentValue"] + "") : false;
|
||||||
model.SchedStartDataControl = item.Table.Columns.Contains("SchedStartDataControl") && !string.IsNullOrWhiteSpace(item["SchedStartDataControl"] + "") ? "1".Equals(item["SchedStartDataControl"] + "") : false;
|
model.SchedStartDataControl = item.Table.Columns.Contains("SchedStartDataControl") && !string.IsNullOrWhiteSpace(item["SchedStartDataControl"] + "") ? "1".Equals(item["SchedStartDataControl"] + "") : false;
|
||||||
|
model.ListBoxFontSize = item.Table.Columns.Contains("ListBoxFontSize") && !string.IsNullOrEmpty(item["ListBoxFontSize"] + "") ? Convert.ToInt32(item["ListBoxFontSize"] + "") : 0;
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -4066,8 +4070,8 @@ namespace Lskj.Control.Model
|
|||||||
case ControlType.LabMultiComTreeboxTextParam:
|
case ControlType.LabMultiComTreeboxTextParam:
|
||||||
// 自动树节点搜索框
|
// 自动树节点搜索框
|
||||||
LabelAutoTreeEdit autoTreeEdit = new LabelAutoTreeEdit();
|
LabelAutoTreeEdit autoTreeEdit = new LabelAutoTreeEdit();
|
||||||
autoTreeEdit.isMultiClick = (ControlType.LabMulitTreeValue == model.FieldType || ControlType.LabMulitTreeText == model.FieldType || ControlType.LabMulitTreeValueParam == model.FieldType || ControlType.LabMulitTreeTextParam == model.FieldType|| ControlType.LabMultiComTreeboxValue == model.FieldType || ControlType.LabMultiComTreeboxText == model.FieldType || ControlType.LabMultiComTreeboxValueParam == model.FieldType || ControlType.LabMultiComTreeboxTextParam == model.FieldType);
|
autoTreeEdit.isMultiClick = (ControlType.LabMulitTreeValue == model.FieldType || ControlType.LabMulitTreeText == model.FieldType || ControlType.LabMulitTreeValueParam == model.FieldType || ControlType.LabMulitTreeTextParam == model.FieldType || ControlType.LabMultiComTreeboxValue == model.FieldType || ControlType.LabMultiComTreeboxText == model.FieldType || ControlType.LabMultiComTreeboxValueParam == model.FieldType || ControlType.LabMultiComTreeboxTextParam == model.FieldType);
|
||||||
autoTreeEdit.ValueMember = ControlType.LabMultiComTreeboxValueParam == model.FieldType || ControlType.LabMultiComTreeboxValue == model.FieldType||ControlType.LabMulitTreeValue == model.FieldType || ControlType.LabMulitTreeValueParam == model.FieldType || ControlType.LabTreeLookValue == model.FieldType || ControlType.LabCheckTreeLookValue == model.FieldType || ControlType.LabTreeLastlevelValue == model.FieldType || ControlType.LabCheckTreeLastlevelValue == model.FieldType ? model.ValueMember : model.TextMember;
|
autoTreeEdit.ValueMember = ControlType.LabMultiComTreeboxValueParam == model.FieldType || ControlType.LabMultiComTreeboxValue == model.FieldType || ControlType.LabMulitTreeValue == model.FieldType || ControlType.LabMulitTreeValueParam == model.FieldType || ControlType.LabTreeLookValue == model.FieldType || ControlType.LabCheckTreeLookValue == model.FieldType || ControlType.LabTreeLastlevelValue == model.FieldType || ControlType.LabCheckTreeLastlevelValue == model.FieldType ? model.ValueMember : model.TextMember;
|
||||||
autoTreeEdit.ValueField = model.ValueMember;
|
autoTreeEdit.ValueField = model.ValueMember;
|
||||||
autoTreeEdit.TextField = model.TextMember;
|
autoTreeEdit.TextField = model.TextMember;
|
||||||
if (ControlType.LabTreeLastlevelValue == model.FieldType || ControlType.LabTreeLastlevelText == model.FieldType || ControlType.LabCheckTreeLastlevelValue == model.FieldType || ControlType.LabCheckTreeLastlevelText == model.FieldType) autoTreeEdit.isRootNode = false;
|
if (ControlType.LabTreeLastlevelValue == model.FieldType || ControlType.LabTreeLastlevelText == model.FieldType || ControlType.LabCheckTreeLastlevelValue == model.FieldType || ControlType.LabCheckTreeLastlevelText == model.FieldType) autoTreeEdit.isRootNode = false;
|
||||||
@@ -4348,6 +4352,7 @@ namespace Lskj.Control.Model
|
|||||||
case ControlType.LabComboxPopupText:
|
case ControlType.LabComboxPopupText:
|
||||||
// 弹出下拉列表框
|
// 弹出下拉列表框
|
||||||
LabelComboxPopupEdit comboxPopupEdit = new LabelComboxPopupEdit();
|
LabelComboxPopupEdit comboxPopupEdit = new LabelComboxPopupEdit();
|
||||||
|
comboxPopupEdit.ListBoxFontSize = model.ListBoxFontSize;
|
||||||
comboxPopupEdit.ControlObj = this;
|
comboxPopupEdit.ControlObj = this;
|
||||||
comboxPopupEdit.TextEdit.TextChanged += new EventHandler(OnTextEditTextChanged);
|
comboxPopupEdit.TextEdit.TextChanged += new EventHandler(OnTextEditTextChanged);
|
||||||
if (!isLoadBorder) comboxPopupEdit.TextEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
if (!isLoadBorder) comboxPopupEdit.TextEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||||
@@ -4357,6 +4362,7 @@ namespace Lskj.Control.Model
|
|||||||
case ControlType.LabComboxPopupMutilText:
|
case ControlType.LabComboxPopupMutilText:
|
||||||
// 弹出多选列表框
|
// 弹出多选列表框
|
||||||
LabelComboxMutilPopupEdit comboxMutilPopupEdit = new LabelComboxMutilPopupEdit();
|
LabelComboxMutilPopupEdit comboxMutilPopupEdit = new LabelComboxMutilPopupEdit();
|
||||||
|
comboxMutilPopupEdit.ListBoxFontSize = model.ListBoxFontSize;
|
||||||
comboxMutilPopupEdit.ControlObj = this;
|
comboxMutilPopupEdit.ControlObj = this;
|
||||||
comboxMutilPopupEdit.TextEdit.TextChanged += new EventHandler(OnTextEditTextChanged);
|
comboxMutilPopupEdit.TextEdit.TextChanged += new EventHandler(OnTextEditTextChanged);
|
||||||
if (!isLoadBorder) comboxMutilPopupEdit.TextEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
if (!isLoadBorder) comboxMutilPopupEdit.TextEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||||
|
|||||||
@@ -480,7 +480,7 @@ namespace Lskj.Control
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
DataRow rowItem = this.ModuleGridObj.GridControlObj.GetViewFocusedDataRow();
|
DataRow rowItem = this.ModuleGridObj.GridControlObj.GetViewFocusedDataRow();
|
||||||
string mainModuleCode = rowItem[SysModel.MainModuleCodeField] + "";
|
string mainModuleCode = (rowItem[SysModel.MainModuleCodeField] + "").ToLower();
|
||||||
//mainModuleCode = String.Empty;
|
//mainModuleCode = String.Empty;
|
||||||
this.TabObj.TabPages.Clear();
|
this.TabObj.TabPages.Clear();
|
||||||
//if (string.IsNullOrWhiteSpace(mainModuleCode)) return;
|
//if (string.IsNullOrWhiteSpace(mainModuleCode)) return;
|
||||||
|
|||||||
@@ -575,16 +575,17 @@ namespace Lskj.Control
|
|||||||
detailTabPageModel.DetailModel = model;
|
detailTabPageModel.DetailModel = model;
|
||||||
if (!string.IsNullOrEmpty(model.ParentModuleCode))
|
if (!string.IsNullOrEmpty(model.ParentModuleCode))
|
||||||
{
|
{
|
||||||
if (this.DetailTabPagesDic.ContainsKey(model.ParentModuleCode))
|
string ParentModuleCode = model.ParentModuleCode.ToLower();
|
||||||
|
if (this.DetailTabPagesDic.ContainsKey(ParentModuleCode))
|
||||||
{
|
{
|
||||||
List<DetailTabPageModel> detailTabPageModels = this.DetailTabPagesDic[model.ParentModuleCode];
|
List<DetailTabPageModel> detailTabPageModels = this.DetailTabPagesDic[ParentModuleCode];
|
||||||
detailTabPageModels.Add(detailTabPageModel);
|
detailTabPageModels.Add(detailTabPageModel);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
List<DetailTabPageModel> detailTabPageModels = new List<DetailTabPageModel>();
|
List<DetailTabPageModel> detailTabPageModels = new List<DetailTabPageModel>();
|
||||||
detailTabPageModels.Add(detailTabPageModel);
|
detailTabPageModels.Add(detailTabPageModel);
|
||||||
this.DetailTabPagesDic.Add(model.ParentModuleCode, detailTabPageModels);
|
this.DetailTabPagesDic.Add(ParentModuleCode, detailTabPageModels);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2188,11 +2188,16 @@ namespace Lskj.Control
|
|||||||
/// <param name="selectRowHandler">if set to <c>true</c> [select row handler].</param>
|
/// <param name="selectRowHandler">if set to <c>true</c> [select row handler].</param>
|
||||||
public override void SetGridViewDataSource(DataTable table, bool selectRowHandler = true)
|
public override void SetGridViewDataSource(DataTable table, bool selectRowHandler = true)
|
||||||
{
|
{
|
||||||
|
if (this.ColumnList == null || this.ColumnList.Count == 0)
|
||||||
|
{
|
||||||
|
this.gcMain.Columns.Clear();
|
||||||
|
}
|
||||||
lastNodeIndex = 0;
|
lastNodeIndex = 0;
|
||||||
if (selectRowHandler) lastNodeIndex = this.TreeListObj.GetVisibleIndexByNode(this.TreeListObj.FocusedNode);
|
if (selectRowHandler) lastNodeIndex = this.TreeListObj.GetVisibleIndexByNode(this.TreeListObj.FocusedNode);
|
||||||
GetTreeExpanded();
|
GetTreeExpanded();
|
||||||
this.gcMain.ClearNodes();
|
this.gcMain.ClearNodes();
|
||||||
this.gcMain.DataSource = table;
|
this.gcMain.DataSource = table;
|
||||||
|
this.SetAutoColumns();
|
||||||
}
|
}
|
||||||
public override int SetGridViewDataSource(SqlDataAdapter adapter, bool selectRowHandler = true)
|
public override int SetGridViewDataSource(SqlDataAdapter adapter, bool selectRowHandler = true)
|
||||||
{
|
{
|
||||||
@@ -2203,10 +2208,17 @@ namespace Lskj.Control
|
|||||||
DataSet dataSet = new DataSet();
|
DataSet dataSet = new DataSet();
|
||||||
adapter.Fill(dataSet, "SetGridViewDataSource");
|
adapter.Fill(dataSet, "SetGridViewDataSource");
|
||||||
|
|
||||||
|
if (this.ColumnList == null || this.ColumnList.Count == 0)
|
||||||
|
{
|
||||||
|
this.gcMain.Columns.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
SqlCommandBuilder cb = new SqlCommandBuilder(this.AdapterObj);
|
SqlCommandBuilder cb = new SqlCommandBuilder(this.AdapterObj);
|
||||||
|
|
||||||
GetTreeExpanded();
|
GetTreeExpanded();
|
||||||
this.gcMain.DataSource = dataSet.Tables[0];
|
this.gcMain.DataSource = dataSet.Tables[0];
|
||||||
|
this.SetAutoColumns();
|
||||||
|
|
||||||
if ((Expansion + "").Equals("1"))
|
if ((Expansion + "").Equals("1"))
|
||||||
{
|
{
|
||||||
this.gcMain.ExpandAll();
|
this.gcMain.ExpandAll();
|
||||||
@@ -2221,6 +2233,97 @@ namespace Lskj.Control
|
|||||||
}
|
}
|
||||||
return dataSet.Tables[0] != null ? dataSet.Tables[0].Rows.Count : 0;
|
return dataSet.Tables[0] != null ? dataSet.Tables[0].Rows.Count : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>说明:设置动态列</para>
|
||||||
|
/// <para>创建人:龚宇超</para>
|
||||||
|
/// <para>创建日期:2019-06-03 </para>
|
||||||
|
/// <para>修改人:</para>
|
||||||
|
/// <para>修改日期:</para>
|
||||||
|
/// <para>修改备注:</para>
|
||||||
|
/// <para>版本:1.0</para>
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void SetAutoColumns()
|
||||||
|
{
|
||||||
|
if (this.ColumnList == null || this.ColumnList.Count == 0)
|
||||||
|
{
|
||||||
|
bool isShowFooter = false;
|
||||||
|
for (int i = 0; i < gcMain.Columns.Count; i++)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
TreeListColumn col = gcMain.Columns[i];
|
||||||
|
col.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
|
||||||
|
col.OptionsFilter.FilterPopupMode = FilterPopupMode.CheckedList;
|
||||||
|
|
||||||
|
if (col.FieldName.Contains("_"))
|
||||||
|
{
|
||||||
|
string[] colSplit = col.FieldName.Split('_');
|
||||||
|
if (colSplit.Length >= 2)
|
||||||
|
{
|
||||||
|
col.Caption = colSplit[0];
|
||||||
|
col.Width = Convert.ToInt32(colSplit[1]);
|
||||||
|
if (Convert.ToInt32(colSplit[1]) == 0)
|
||||||
|
col.Visible = false;
|
||||||
|
if (colSplit.Length > 2)
|
||||||
|
{
|
||||||
|
bool visible = "1".Equals(colSplit[2]);
|
||||||
|
// 设置底部合计
|
||||||
|
if (col.VisibleIndex == 0)
|
||||||
|
{
|
||||||
|
isShowFooter = true;
|
||||||
|
|
||||||
|
gcMain.OptionsView.ShowSummaryFooter = true;
|
||||||
|
col.AllNodesSummary = true;
|
||||||
|
col.SummaryFooter = SummaryItemType.Count;
|
||||||
|
col.SummaryFooterStrFormat = "合计:{0:#,###}行";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (visible)
|
||||||
|
{
|
||||||
|
isShowFooter = true;
|
||||||
|
|
||||||
|
gcMain.OptionsView.ShowSummaryFooter = true;
|
||||||
|
col.AllNodesSummary = true;
|
||||||
|
col.SummaryFooter = DevExpress.XtraTreeList.SummaryItemType.Sum;
|
||||||
|
col.SummaryFooterStrFormat = "{0:}";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (colSplit.Length > 3)
|
||||||
|
{
|
||||||
|
string dataFormat = colSplit[3];
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(dataFormat))
|
||||||
|
{
|
||||||
|
col.Format.FormatType = FormatType.Custom;
|
||||||
|
col.Format.FormatString = dataFormat;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
col.Width = 150;
|
||||||
|
}
|
||||||
|
//cMain.OptionsView.ShowFooter = isShowFooter;
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 记录展开的节点
|
/// 记录展开的节点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user