SVN-Revision: r801
This commit is contained in:
cyf
2025-06-27 07:49:43 +00:00
parent 39a388b0f4
commit 13f2022d1a
9 changed files with 466 additions and 47 deletions
+55 -35
View File
@@ -82,6 +82,60 @@ namespace Lskj.Control
}
}
public FrmGridSelectPopup(GridColumnModel model)
{
try
{
InitializeComponent();
this.Model = new ControlModel();
this.Model.SourceSql = model.SqlSource;
this.Model.ValueMember = model.ValueMember;
this.Model.TextMember = model.TextMember;
this.Model.FieldType = model.FieldType;
this.gridView.BestFitColumns();//设置根据内容填充列宽
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
public void InitNew(string sql, string ShowText, string ShowValue)
{
this.ShowText = ShowText;
this.ShowValue = ShowValue;
if (string.IsNullOrEmpty(sql))
{
MessageUtil.Show("请先配置数据源");
}
else
{
this.mSourceTable = BaseImpl.GetDataTableResult(sql);
if (this.Model.FieldType == ControlType.LabGridPopupMutilText || this.Model.FieldType == ControlType.LabGridPopupMutilValue)
{
this.simpleButton5.Visible = true;
this.mSourceTable.Columns.Add(_checkFieldName, typeof(bool));
this.mSourceTable.Columns[_checkFieldName].SetOrdinal(0);
for (int i = 0; i < mSourceTable.Rows.Count; i++)
{
mSourceTable.Rows[i][_checkFieldName] = 0;
}
}
this.InitColumn();
this.InitControl();
this.gridView.RowClick += new DevExpress.XtraGrid.Views.Grid.RowClickEventHandler(gridView_RowClick);
}
}
void gridView_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
{
try
@@ -226,38 +280,4 @@ namespace Lskj.Control
{
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);
}
}
private void simpleButton5_Click(object sender, EventArgs e)
{
try
{
this.DialogResult = System.Windows.Forms.DialogResult.OK;
this.ShowText = this.ShowText.TrimStart(',');
this.ShowValue = this.ShowValue.TrimStart(',');
this.Close();
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
}
}
private void simpleButton6_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
if (this.mPage == this.mMaxPage) return;