SVN r801
SVN-Revision: r801
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user