代码模板参考

namespace NLISClient.OECForm
{
/// <summary>
///
<para>程序名称:日清模板客户端窗体</para>
/// <list type="table">

/// <listheader>
///
<term>作者</term><term>日期</term><term>版本</term><term>更改说明</term>

/// <item>
///
<term>高明胜</term><term>2014-04-2</term><term>V1.0</term><term>创建</term>

/// </item>
/// </listheader>
/// </list>

/// </summary>
public partial class DayClearTempletForm :
DataEditMiddleBase, NLISClient.InterFace.IMainToolDelete,

NLISClient.InterFace.IMainToolAdd, NLISClient.InterFace.IMainToolUpdate,

NLISClient.InterFace.IMainToolSave,
NLISClient.InterFace.IMainToolSelect,NLISClient.InterFace.IMainToolPreview

{
#region 属性

WCFDayClearTempletService.DayClearTempletServiceClient client = new
WCFDayClearTempletService.DayClearTempletServiceClient();
private
AuthorizationScope _AuthorizationScope = AuthorizationScope.Personal;

//部门
private PUB_Department_BL departMent_BL = new PUB_Department_BL();

private PUB_UseInfo _infoUser = new PUB_UseInfo();
private
PUB_EntityAuthorization_BL _bllEntityAuthorization = new
PUB_EntityAuthorization_BL();
string strWhere ="";

/// <summary>
/// 激活的标签分类
///
</summary>
private TabType tabType = TabType.Update;

#endregion

#region 枚举

enum TabType
{
Add,
Update

}

/// <summary>
/// 操作分类
/// </summary>

[Description("操作类型")]
public enum ActionType
{

/// <summary>
/// 新建
/// </summary>

[NLISServiceEnumAttribute(Name = "新建")]
Add = 0,

/// <summary>
/// 修改
///
</summary>
[NLISServiceEnumAttribute(Name = "修改")]
Edit
= 1,

/// <summary>
/// 删除
///
</summary>
[NLISServiceEnumAttribute(Name =
"删除")]
Remove = 2,

/// <summary>
/// 详细
///
</summary>
[NLISServiceEnumAttribute(Name =
"详细")]
Detail = 3,

/// <summary>
/// 搜索
///
</summary>
[NLISServiceEnumAttribute(Name =
"搜索")]
Search = 4,

/// <summary>
/// 导出
///
</summary>
[NLISServiceEnumAttribute(Name = "变更")]
Chang
= 5
}
#endregion
/// <summary>

///
/// </summary>
public DayClearTempletForm()

{
InitializeComponent();
}

private void DayClearTempletForm_Load(object sender, EventArgs e)

{
try
{
_infoUser =
(PUB_UseInfo)ApplicationData.Get("UserInfo");

tbxDayClearTempletItem.Focus();
this.wfpPaging.PageSize =
30;
ComboxUnit();
MyBind(1,
wfpPaging.PageSize, GetWhere());
}
catch
(Exception)
{
throw;
}

}

/// <summary>
/// 获取组对象集合分页
///
</summary>
/// <param name="pageNum">页码</param>

/// <param name="pageSize">每页显示条数</param>
///
<returns></returns>
private void MyBind(int pageNum, int
pageSize, string strWhere)
{
Dictionary<string,
string> dic = new Dictionary<string, string>();
dic =
client.Search(pageNum, this.wfpPaging.PageSize, strWhere);

this.wfpPaging.RecordCount = Convert.ToInt32(dic["pages"]);

wfpPaging.PageIndex = pageNum;
dgv.AutoGenerateColumns =
false;
dgv.Columns["DayClearTempletID"].DataPropertyName =
"DayClearTempletID";

dgv.Columns["DayClearTempletWorkModule"].DataPropertyName =
"DayClearTempletWorkModule";

dgv.Columns["DayClearTempletPostID"].DataPropertyName =
"DayClearTempletPostID";

dgv.Columns["DayClearTempletPostName"].DataPropertyName =
"DayClearTempletPostName";

dgv.Columns["DayClearTempletStatus"].DataPropertyName =
"DayClearTempletStatus";;

dgv.Columns["StatusName"].DataPropertyName = "StatusName";

dgv.Columns["DayClearTempletRemark"].DataPropertyName =
"DayClearTempletRemark";

dgv.Columns["DayClearTempletNewUserID"].DataPropertyName =
"DayClearTempletNewUserID";

dgv.Columns["DayClearTempletNewUserName"].DataPropertyName =
"DayClearTempletNewUserName";

dgv.Columns["DayClearTempletNewTime"].DataPropertyName =
"DayClearTempletNewTime";

dgv.Columns["DayClearTempletUpdateUserName"].DataPropertyName =
"DayClearTempletUpdateUserName";

dgv.Columns["DayClearTempletUpdateUserID"].DataPropertyName =
"DayClearTempletUpdateUserID";

dgv.Columns["DayClearTempletUpdateTime"].DataPropertyName =
"DayClearTempletUpdateTime";

DataTable dt =
NLISClient.UIBase.Helper.TableHelper.DeserializationTable(dic["table"]);

DataColumn dc = new DataColumn("StatusName");

dt.Columns.Add(dc);

foreach (DataRow row in dt.Rows)
{

row["StatusName"] = (Convert.ToInt16(row["DayClearTempletStatus"]) == 1 ?
"有效" :

(Convert.ToInt16(row["DayClearTempletStatus"]) == 0 ? "无效" : "新建"));

}
this.dgv.DataSource = null;
this.dgv.DataSource = dt;

TextBoxUnit();
}
/// <summary>

/// 与gridview选中行的内容保持一致
/// </summary>
public void
TextBoxUnit()
{
lblNewUserName.Text = "";

lblNewTime.Text = "";
lblUpdateUserName.Text = "";

lblUpdateTime.Text = "";
DataGridViewSelectedRowCollection rows
= dgv.SelectedRows;
if (rows != null && rows.Count ==
1)
{
tabType = TabType.Update;

lblDayClearTempletID.Text =
rows[0].Cells["DayClearTempletID"].Value.ToString();

tbxsDayClearTempletPositionName.Text =
rows[0].Cells["DayClearTempletWorkModule"].Value.ToString();

txtEmployeePost.Text =
rows[0].Cells["DayClearTempletPostName"].Value.ToString();

lblEmployeePostID.Text =
rows[0].Cells["DayClearTempletPostID"].Value.ToString();

tbxDayClearTempletRemark.Text =
rows[0].Cells["DayClearTempletRemark"].Value.ToString();

lblNewUserName.Text =
rows[0].Cells["DayClearTempletNewUserName"].Value.ToString();

lblNewTime.Text = rows[0].Cells["DayClearTempletNewTime"].Value.ToString();

lblUpdateUserName.Text =
rows[0].Cells["DayClearTempletUpdateUserName"].Value.ToString();

lblUpdateTime.Text =
rows[0].Cells["DayClearTempletUpdateTime"].Value.ToString();

#region 状态的控制
//状态若为有效,则控件不可用
if
(rows[0].Cells["DayClearTempletStatus"].Value.ToString() == "1")

{
#region MyRegion

ControlEnable(false);
cbxDayClearTempletStatus.Enabled =
true;
//初始化 状态combox
DataTable
dtStatus = new DataTable();

dtStatus.Columns.Add("name");

dtStatus.Columns.Add("value", typeof(object));

dtStatus.Rows.Add("无效", 0);
dtStatus.Rows.Add("有效",
1);
cbxDayClearTempletStatus.DisplayMember = "name";

cbxDayClearTempletStatus.ValueMember = "value";

cbxDayClearTempletStatus.DataSource = dtStatus;

tbxsDayClearTempletPositionName.ReadOnly = true;

txtEmployeePost.ReadOnly = true;

tbxDayClearTempletRemark.ReadOnly = true;

this.btnSPost.Enabled = false;
#endregion

}
else if
(rows[0].Cells["DayClearTempletStatus"].Value.ToString() == "2")//新建
{

#region MyRegion
ControlEnable(true);

tbxsDayClearTempletPositionName.ReadOnly = true;

//初始化 状态combox
DataTable dtStatus = new
DataTable();
dtStatus.Columns.Add("name");

dtStatus.Columns.Add("value", typeof(object));

dtStatus.Rows.Add("有效", 1);
dtStatus.Rows.Add("新建",
2);
cbxDayClearTempletStatus.DisplayMember = "name";

cbxDayClearTempletStatus.ValueMember = "value";

cbxDayClearTempletStatus.DataSource = dtStatus;

cbxDayClearTempletStatus.Enabled = true;

this.btnSPost.Enabled = true;

this.tbxDayClearTempletRemark.ReadOnly = false;

#endregion
}
else if
(rows[0].Cells["DayClearTempletStatus"].Value.ToString() == "0")//无效
{

//初始化 状态combox
#region MyRegion

DataTable dtStatus = new DataTable();

dtStatus.Columns.Add("name");

dtStatus.Columns.Add("value", typeof(object));

dtStatus.Rows.Add("无效", 0);
dtStatus.Rows.Add("有效",
1);
cbxDayClearTempletStatus.DisplayMember = "name";

cbxDayClearTempletStatus.ValueMember = "value";

cbxDayClearTempletStatus.DataSource = dtStatus;

ControlEnable(false);
cbxDayClearTempletStatus.Enabled =
false;
tbxsDayClearTempletPositionName.ReadOnly =
true;
this.btnSPost.Enabled = false;

this.tbxDayClearTempletRemark.ReadOnly = true;

#endregion
}

cbxDayClearTempletStatus.SelectedValue =
rows[0].Cells["DayClearTempletStatus"].Value;
#endregion

}
else
{
tabType
= TabType.Add;
ControlEnable(true);

#region 状态初始化 新建、有效、无效
try
{
//初始化
状态combox
DataTable dtStatus = new DataTable();

dtStatus.Columns.Add("name");

dtStatus.Columns.Add("value", typeof(object));

dtStatus.Rows.Add("有效", 1);
dtStatus.Rows.Add("新建",
2);
cbxDayClearTempletStatus.DisplayMember = "name";

cbxDayClearTempletStatus.ValueMember = "value";

cbxDayClearTempletStatus.DataSource = dtStatus;

cbxDayClearTempletStatus.SelectedIndex = 1;

cbxDayClearTempletStatus.Enabled = false;

tbxsDayClearTempletPositionName.ReadOnly = false;

txtEmployeePost.ReadOnly = false;

tbxDayClearTempletRemark.ReadOnly = false;
}

catch (Exception)
{
throw;

}
#endregion

lblDayClearTempletID.Text = "";

tbxsDayClearTempletPositionName.Tag = null;

tbxsDayClearTempletPositionName.Text = "";

txtEmployeePost.Text = "";
tbxDayClearTempletRemark.Text =
"";
lblNewUserName.Text = "";

lblNewTime.Text = "";
lblUpdateUserName.Text = "";

lblUpdateTime.Text = "";
}

txtEmployeePost.Focus();
}

/// <summary>
/// 状态控制控件的可用性
///
</summary>
public void ControlEnable(bool flag)

{
txtEmployeePost.Enabled =!flag;

tbxsDayClearTempletPositionName.ReadOnly =flag;

tbxDayClearTempletRemark.ReadOnly = !flag;
}
///
<summary>
/// 获取查询条件
/// </summary>
///
<returns>查询条件</returns>
public string GetWhere()

{
strWhere = " 1=1";
//工作模块
if
(tbxDayClearTempletItem.Text.Trim() != "")
{

strWhere += " AND DayClearTempletWorkModule Like ‘%" +
tbxDayClearTempletItem.Text + "%‘";
}
//所属职务
if
(txtEmployeePostName.Text.Trim() != "")
{

strWhere += " AND DayClearTempletPostID =" + lblEmployeePostID.Text;

}
//状态
if (cbxSStatus.Text.Trim() != "")

{
strWhere += " AND DayClearTempletStatus =" +
cbxSStatus.SelectedValue;
}
return strWhere;

}
/// <summary>
/// 收索绑定
///
</summary>
public void ComboxUnit()
{

//初始化 状态combox
DataTable dtStatus = new DataTable();

dtStatus.Columns.Add("name");
dtStatus.Columns.Add("value",
typeof(object));
dtStatus.Rows.Add("无效", 0);

dtStatus.Rows.Add("有效", 1);
dtStatus.Rows.Add("新建", 2);

dtStatus.Rows.Add("", 3);
cbxSStatus.DisplayMember =
"name";
cbxSStatus.ValueMember = "value";

cbxSStatus.DataSource = dtStatus;
cbxSStatus.SelectedIndex =
dtStatus.Rows.Count - 1;
}
#region 实现接口
///
<summary>
/// 添加
/// </summary>
///
<returns></returns>
public bool Add()
{

bool IsAuthorization = false;
//判断用户是否有单独权限
if
(!_infoUser.UserIsAuthority)
{
IsAuthorization
= _bllEntityAuthorization.IsAuthorization(_infoUser.UserGroupID,
client.GetNamespace(), ActionType.Add.ToString("D"));
}

else
{
IsAuthorization =
_bllEntityAuthorization.IsAuthorizations(_infoUser.UserID,
_infoUser.UserGroupID, client.GetNamespace(), ActionType.Add.ToString("D"));

}
//判断是否具有对该业务实体操作的权限
if (IsAuthorization)

{
dgv.ClearSelection();

TextBoxUnit();
}
else
{

MessageBox.Show("您没有权限进行此操作!", "NLIS系统信息提示", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
return true;

}
/// <summary>
/// 保存
///
</summary>
/// <returns></returns>

public bool SaveDate()
{

try
{
bool IsAuthorization =
false;
//判断用户是否有单独权限
if (!_infoUser.UserIsAuthority)

{
IsAuthorization =
_bllEntityAuthorization.IsAuthorization(_infoUser.UserGroupID,
client.GetNamespace(), ActionType.Add.ToString("D"));
}

else
{
IsAuthorization =
_bllEntityAuthorization.IsAuthorizations(_infoUser.UserID,
_infoUser.UserGroupID, client.GetNamespace(), ActionType.Add.ToString("D"));

}
//判断是否具有对该业务实体操作的权限
if
(IsAuthorization)
{
if (tabType ==
TabType.Add)
{
#region
验证
if (tbxsDayClearTempletPositionName.Text.Trim() == "")

{
MessageBox.Show("工作模块不能为空!",
"NLIS系统信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

tbxsDayClearTempletPositionName.Focus();

return false;
}
if
(txtEmployeePost.Text.Trim() == "")
{

MessageBox.Show("请输入职位!", "NLIS系统信息提示", MessageBoxButtons.OK,
MessageBoxIcon.Information);

txtEmployeePost.Focus();
return false;

}
#endregion

OEC_DayClearTemplet BI = new OEC_DayClearTemplet();

BI.DayClearTempletWorkModule = tbxsDayClearTempletPositionName.Text;

BI.DayClearTempletPostID =
Convert.ToInt32(lblEmployeePostID.Text);

BI.DayClearTempletStatus =
Convert.ToInt16(cbxDayClearTempletStatus.SelectedValue);

BI.DayClearTempletRemark = tbxDayClearTempletRemark.Text.Trim();

BI.DayClearTempletNewTime = DateTime.Now;

BI.DayClearTempletNewUserID = _infoUser.UserID;

MessageInfo messageInfo = client.Add(BI);

NLISServiceMessage.ShowMessage(messageInfo, MessageBoxType.Info);

if (messageInfo.Success)
{

MyBind(wfpPaging.PageIndex, wfpPaging.PageSize, strWhere);

}
}
else

{

MessageBox.Show("不是新建数据不能保存,请先点击添加按钮!", "NLIS系统信息提示", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
}

else
{

MessageBox.Show("您没有权限进行此操作!", "NLIS系统信息提示", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
}

catch (Exception)
{
throw;

}
return true;
}
/// <summary>

/// 修改
/// </summary>
///
<returns></returns>
public new bool Update()

{
if (lblDayClearTempletID.Text != "" && tabType ==
TabType.Update)
{
bool IsAuthorization =
false;
//判断用户是否有单独权限
if (!_infoUser.UserIsAuthority)

{
IsAuthorization =
_bllEntityAuthorization.IsAuthorization(_infoUser.UserGroupID,
client.GetNamespace(), ActionType.Edit.ToString("D"));
}

else
{
IsAuthorization =
_bllEntityAuthorization.IsAuthorizations(_infoUser.UserID,
_infoUser.UserGroupID, client.GetNamespace(),
ActionType.Edit.ToString("D"));
}

//判断是否具有对该业务实体操作的权限
if (IsAuthorization)
{

if (MessageBox.Show("确认修改?", "NLIS系统信息提示", MessageBoxButtons.OKCancel,
MessageBoxIcon.Question) == DialogResult.OK)
{

try
{

#region 验证
if (tbxsDayClearTempletPositionName.Text.Trim() == "")

{

MessageBox.Show("工作模块不能为空!", "NLIS系统信息提示", MessageBoxButtons.OK,
MessageBoxIcon.Information);

tbxsDayClearTempletPositionName.Focus();

return false;
}
if
(txtEmployeePost.Text.Trim() == "")
{

MessageBox.Show("请输入职位!", "NLIS系统信息提示",
MessageBoxButtons.OK, MessageBoxIcon.Information);

txtEmployeePost.Focus();
return
false;
}

#endregion

OEC_DayClearTemplet BI = new
OEC_DayClearTemplet();

BI.DayClearTempletWorkModule = tbxsDayClearTempletPositionName.Text;

BI.DayClearTempletID =
Convert.ToInt32(lblDayClearTempletID.Text);

BI.DayClearTempletPostID = Convert.ToInt32(lblEmployeePostID.Text);

BI.DayClearTempletStatus =
Convert.ToInt16(cbxDayClearTempletStatus.SelectedValue);

BI.DayClearTempletRemark = tbxDayClearTempletRemark.Text.Trim();

BI.DayClearTempletUpdateTime = DateTime.Now;

BI.DayClearTempletUpdateUserID = _infoUser.UserID;

MessageInfo messageinfo = client.UpdateById(BI);

NLISServiceMessage.ShowMessage(messageinfo,
MessageBoxType.Info);
if
(messageinfo.Success)
{

MyBind(wfpPaging.PageIndex, wfpPaging.PageSize, strWhere);

}
}

catch (Exception)
{

throw;
}
}

}
else
{

MessageBox.Show("您没有权限进行此操作!", "NLIS系统信息提示", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
}

else
{
MessageBox.Show("不是数据修改,请先点击一条数据后修改!",
"NLIS系统信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

}
return true;
}
/// <summary>

/// 删除
/// </summary>
///
<returns></returns>
public bool Delete()
{

try
{
bool IsAuthorization =
false;
//判断用户是否有单独权限
if (!_infoUser.UserIsAuthority)

{
IsAuthorization =
_bllEntityAuthorization.IsAuthorization(_infoUser.UserGroupID,
client.GetNamespace(), ActionType.Remove.ToString("D"));

}
else
{

IsAuthorization = _bllEntityAuthorization.IsAuthorizations(_infoUser.UserID,
_infoUser.UserGroupID, client.GetNamespace(),
ActionType.Remove.ToString("D"));
}

//判断是否具有对该业务实体操作的权限
if (IsAuthorization)
{

if (lblDayClearTempletID.Text.Trim() != "")
{

if (MessageBox.Show("确认删除?", "NLIS系统信息提示",
MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)

{
MessageInfo messageinfo =
client.DeleteById(Convert.ToInt64(lblDayClearTempletID.Text));

NLISServiceMessage.ShowMessage(messageinfo,
MessageBoxType.Info);
if
(messageinfo.Success)
{

MyBind(this.wfpPaging.PageIndex, this.wfpPaging.PageSize,
strWhere);
}
}

}
else
{

MessageBox.Show("您没有选中一行数据,不能删除!", "NLIS系统信息提示",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}

}
else
{

MessageBox.Show("您没有权限进行此操作!", "NLIS系统信息提示", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
}

catch (Exception)
{
throw;

}
return true;
}
/// <summary>

/// 查询事件
/// </summary>
public new bool Select()

{
try
{
bool IsAuthorization
= false;
//判断用户是否有单独权限
if (!_infoUser.UserIsAuthority)

{
IsAuthorization =
_bllEntityAuthorization.IsAuthorization(_infoUser.UserGroupID,
client.GetNamespace(), ActionType.Search.ToString("D"));

}
else
{

IsAuthorization = _bllEntityAuthorization.IsAuthorizations(_infoUser.UserID,
_infoUser.UserGroupID, client.GetNamespace(),
ActionType.Search.ToString("D"));
}

//判断是否具有对该业务实体操作的权限
if (IsAuthorization)
{

strWhere = GetWhere();
MyBind(1,
this.wfpPaging.PageSize, strWhere);
if (dgv.Rows.Count ==
0)
{

MessageBox.Show("未查到与条件相符的数据!", "NLIS系统信息提示", MessageBoxButtons.OK,
MessageBoxIcon.Information);

}
}
else

{
MessageBox.Show("您没有权限进行此操作!", "NLIS系统信息提示",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}

}
catch (Exception)
{

throw;
}
return true;
}

/// <summary>
/// 预览
/// </summary>

/// <returns></returns>
public bool Preview()

{
DataGridViewSelectedRowCollection rows =
this.dgv.SelectedRows;
if (rows != null && rows.Count ==
1)
{
try
{

if (Convert.ToInt32(rows[0].Cells["DayClearTempletStatus"].Value) !=
2)
{

DayClearTempletPreviewInfoForm info = new
DayClearTempletPreviewInfoForm(rows[0].Cells["DayClearTempletPostID"].Value.ToString());

info.Tag = this.Tag;

info.Owner = this;
info.ShowDialog();

}
}
catch (Exception)

{
throw;
}
}

return true;
}

#endregion

private void btnSPost_Click(object sender, EventArgs e)

{
PostListForm postForm = new PostListForm(txtEmployeePost,
lblEmployeePostID);
postForm.Owner = this;

postForm.ShowDialog();
lblEmployeePostID.Visible = false;

//lblEmployeePostID.Text = "";
//txtEmployeePostName.Text
= "";

}
private void btnSPostName_Click(object sender, EventArgs
e)
{
PostListForm postForm = new
PostListForm(txtEmployeePostName, lblEmployeePostID);

postForm.Owner = this;
postForm.ShowDialog();

lblEmployeePostID.Visible = false;
//lblEmployeePostID.Text =
"";
//txtEmployeePost.Text = "";
}

private void dgv_CellClick(object sender, DataGridViewCellEventArgs
e)
{
try
{

this.TextBoxUnit();
}
catch (Exception)

{
throw;
}
}
///
<summary>
/// 双击查看详细
/// </summary>
///
<param name="sender"></param>
/// <param
name="e"></param>
private void dgv_CellDoubleClick(object
sender, DataGridViewCellEventArgs e)
{

DataGridViewSelectedRowCollection rows = this.dgv.SelectedRows;

if (rows != null && rows.Count == 1 && tabType ==
TabType.Update)
{
bool IsAuthorization =
false;
//判断用户是否有单独权限
if (!_infoUser.UserIsAuthority)

{
IsAuthorization =
_bllEntityAuthorization.IsAuthorization(_infoUser.UserGroupID,
client.GetNamespace(), ActionType.Detail.ToString("D"));

}
else
{

IsAuthorization = _bllEntityAuthorization.IsAuthorizations(_infoUser.UserID,
_infoUser.UserGroupID, client.GetNamespace(),
ActionType.Detail.ToString("D"));
}

//判断是否具有对该业务实体操作的权限
if (IsAuthorization)
{

try
{
if
(Convert.ToInt32(rows[0].Cells["DayClearTempletStatus"].Value) != 2 &&
Convert.ToInt32(rows[0].Cells["DayClearTempletStatus"].Value) != 0)

{
Label lbl = new Label();

lbl.Text =
rows[0].Cells["DayClearTempletWorkModule"].Value.ToString();

lbl.Tag = rows[0].Cells["DayClearTempletID"].Value;

DayClearTempletInfoForm info = new
DayClearTempletInfoForm(lbl);
info.Tag =
this.Tag;
info.Owner = this;

info.ShowDialog();
}

}
catch (Exception)
{

}
}
else

{
MessageBox.Show("您没有权限进行此操作!", "NLIS系统信息提示",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}

}
else
{

MessageBox.Show("不是数据修改,请先点击一条数据后修改!", "NLIS系统信息提示", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
}

private void wfpPaging_PageIndexChanged(object sender, EventArgs
e)
{
try
{

wfpPaging.PageIndex = wfpPaging.PageIndex;

MyBind(wfpPaging.PageIndex, wfpPaging.PageSize, strWhere);
}

catch (Exception)
{

throw;
}
}

}

}

时间: 2024-11-08 21:13:57

代码模板参考的相关文章

IDEA 设置代码模板

一.代码模板 参考: IntelliJ IDEA 使用(一)基本设置与类.方法模板设置 - 云 + 社区 - 腾讯云 文件代码模板的使用 - IntelliJ IDEA 使用教程 - 极客学院 Wiki 1.文件代码模板 用于新建文件时的默认配置.(请注意这里修改的只是新建Class文件的配置,其他文件请自行更改) /** * Copyright (C), 2018-${YEAR} * FileName: ${NAME} * Author: ${USER} * Date: ${DATE} ${T

Eclipse常用快捷键与代码模板

Eclipse常用快捷键汇总 Eclipse的编辑功能非常强大,掌握了Eclipse快捷键功能,能够大大提高开发效率.Eclipse中有如下一些和编辑相关的快捷键.1. [ALT+/]此快捷键为用户编辑的好帮手,能为用户提供内容的辅助,不要为记不全方法和属性名称犯愁,当记不全类.方法和属性的名字时,多体验一下[ALT+/]快捷键带来的好处吧. 2. [Ctrl+O]显示类中方法和属性的大纲,能快速定位类的方法和属性,在查找Bug时非常有用. 3. [Ctrl+/]快速添加注释,能为光标所在行或所

善用Eclipse的代码模板功能

Eclipse是个非常强大的IDE,作为一个JAVA程序员,几乎每天都与它打交道,但是它强大的功能都用到了吗? 今天让我们来看一下Eclipse中的“代码模板”功能.什么是代码模板呢?举个例子,一个很常见的应用,如何在一个类中中建立一个main函数? 这还不简单?话音未落,只见你在键盘上飞快的敲击着,三下五除二便搞定了. OK,打字很快的说.但是,是不是应该思考下,对于这种非常固定的代码,有必要一个字母一个字母的敲吗? 作为IDE,其中一个设计哲学就是能帮用户干的就帮用户干,像上面这种情况,就该

Xcode 代码模板

当我们在Xcode中新建一个UIViewController子类的viewController 时候,Xcode会自动帮我们把一部分代码生成(viewDidLoad.didReceiveMemoryWarning方法等,以及注释). 今天,于是花了一点时间了研究了一下,并整理出一个简化模板拷贝以及修改TemplateInfo.plist 中后缀名的Shell 脚本工具. 脚本 脚本比较简单,就不详细解释了.模板Demo以及脚本都放在github上了 #!/bin/bash # write by

FLASH BUILDER 代码模板修改

打开"窗口">“首选参数”对话框,然后选择“Flash Builder”>“编辑器”>“代码模板” 代码模板修改-选中需要修改的代码模板点击"编辑" 代码模板导出-点击"导出"-保存为XML(可选中多条同时导出) <?xml version="1.0" encoding="UTF-8" standalone="no"?><templates>&l

【资源共享】《Camera_for_RockChipSDK参考说明_v4.1》下载

关于摄像头调试的文档<Camera_for_RockChipSDK参考说明_v4.1> 下载地址:http://developer.t-firefly.com/thread-12429-1-1.html

angular参考手册拷贝

AngularJS 参考手册 AngularJS 指令 本教程用到的 AngularJS 指令 : 指令 描述 ng-app 定义应用程序的根元素. ng-bind 绑定 HTML 元素到应用程序数据 ng-bind-html 绑定 HTML 元素的 innerHTML 到应用程序数据,并移除 HTML 字符串中危险字符 ng-bind-template 规定要使用模板替换的文本内容 ng-blur 规定 blur 事件的行为 ng-change 规定在内容改变时要执行的表达式 ng-check

分析实现zc706 AMP-linux和裸奔的注意点更新-参考xapp1078 latest info.

在上一篇博文中,研究了xapp1078,它的目标平台是zc702.本文分析在zc706实现AMP时需要修改的关键点.参考资料:http://www.wiki.xilinx.com/XAPP1078+Latest+Information 1,zc706中的bootROM中,采用了V2版本.该版本使用了不同的WFE loop,CPU1被唤醒(中断.sev或者其他事件)后,会读取0xFFFFFFF0位置的数据与0xFFFFFF2C比较,如果与0xFFFFFF2C相同,则回到WFE状态(待机).如果与0

.net 自己写的操作Excel 导入导出 类(以供大家参考和自己查阅)

由于现在网页很多都关系到Excel 的操作问题,其中数据的导入导出更是频繁,作为一个菜鸟,收集网上零散的知识,自己整合,写了一个Excel导入到GridView ,以及将GridView的数据导出到EXCEL的类方法,以供参考和方便自己以后查阅. 1 #region 引用部分 2 using System; 3 using System.Collections.Generic; 4 using System.Linq; 5 using System.Web; 6 using System.Dat