基线 SVN r240
SVN-Revision: r240
This commit is contained in:
@@ -0,0 +1,125 @@
|
||||
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.Core;
|
||||
using DevExpress.XtraEditors.Repository;
|
||||
using DevExpress.XtraEditors.Controls;
|
||||
using DevExpress.Utils;
|
||||
using DevExpress.XtraGrid.Views.Grid;
|
||||
|
||||
namespace Lskj.ToolSet
|
||||
{
|
||||
public partial class PreviewFrom : BaseForm
|
||||
{
|
||||
public string sqlFormat = string.Empty;
|
||||
public PreviewFrom()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
#region 初始化预览表格数据
|
||||
public void iniControls(DataTable dt, string TableName)
|
||||
{
|
||||
InitGridControl(TableName);
|
||||
this.gcMain.DataSource = dt;
|
||||
this.gvMain.CustomDrawRowIndicator += new RowIndicatorCustomDrawEventHandler(OnGridViewCustomDrawRowIndicator);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 序号生成事件
|
||||
/// <summary>
|
||||
/// <para>说明:生成序号</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2020-12-31 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="RowIndicatorCustomDrawEventArgs"/> instance containing the event data.</param>
|
||||
protected virtual void OnGridViewCustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
e.Appearance.TextOptions.HAlignment = HorzAlignment.Center;
|
||||
if (e.Info.IsRowIndicator)
|
||||
{
|
||||
if (e.RowHandle >= 0)
|
||||
{
|
||||
e.Info.DisplayText = (e.RowHandle + 1).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 初始化表格控件
|
||||
/// <summary>
|
||||
/// <para>说明: 初始化表格控件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2020-12-31 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="RowIndicatorCustomDrawEventArgs"/> instance containing the event data.</param>
|
||||
private void InitGridControl(string TableName)
|
||||
{
|
||||
switch (TableName)
|
||||
{
|
||||
case "p_systemwordbooktab":
|
||||
case "p_systemdlltabflowstepgrid":
|
||||
sqlFormat = "select DllCoid as dm,ToolsName as mc from P_systemdllTab";
|
||||
this.ModelName.FieldName = "tab";
|
||||
this.userName.FieldName="username1";
|
||||
this.fieldName.FieldName = "fieldname";
|
||||
break;
|
||||
case "p_systemDlltabDetailGrid":
|
||||
sqlFormat = "select formkey as dm,detailName as mc from p_systemDlltabDetail";
|
||||
this.ModelName.FieldName = "detailKey";
|
||||
break;
|
||||
case "p_systembillDetail":
|
||||
case "p_systembillstepgrid":
|
||||
sqlFormat = "select typeCode as dm,typeName as mc from p_systembilltype";
|
||||
this.ModelName.FieldName = "typeCode";
|
||||
break;
|
||||
case "p_systembillsourcegrid":
|
||||
case "p_systembillsourcedetail":
|
||||
sqlFormat = "select formKey as dm,sourceName as mc from p_systembillsource";
|
||||
this.ModelName.FieldName = "sourcekey";
|
||||
break;
|
||||
case "p_systembillauditAttachDetail":
|
||||
sqlFormat = "select formKey as dm,attachName as mc from p_systembillauditAttach";
|
||||
this.ModelName.FieldName = "attachKey";
|
||||
break;
|
||||
|
||||
}
|
||||
DataTable ColumnFormat = SqlHelper.ExecuteDataTable(sqlFormat);
|
||||
RepositoryItemLookUpEdit comboxEdit = this.repositoryItemLookUpEdit1;
|
||||
comboxEdit.ShowHeader = false;
|
||||
comboxEdit.ImmediatePopup = false;
|
||||
comboxEdit.SearchMode = SearchMode.AutoFilter;
|
||||
comboxEdit.NullText = "";
|
||||
comboxEdit.PopupBorderStyle = PopupBorderStyles.Flat;
|
||||
comboxEdit.AllowNullInput = DefaultBoolean.False;
|
||||
comboxEdit.DisplayMember = "mc";
|
||||
comboxEdit.ValueMember = "dm";
|
||||
comboxEdit.DataSource = ColumnFormat;
|
||||
LookUpColumnInfo valueColumn = new LookUpColumnInfo();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user