日期:2013-02-21  浏览次数:20550 次

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using com.prm.client.tools;
using System.Data.OracleClient;
//using com.prm.client.common;

namespace com.prm.client.forms
{
/// <summary>
/// SM_EditFunction 的摘要说明。
/// </summary>
public class SM_EditFunction: System.Windows.Forms.Form
{
private System.Windows.Forms.Label lbl_Name;
private System.Windows.Forms.TextBox txt_Name;
private System.Windows.Forms.Label lbl_Tag;
private System.Windows.Forms.TextBox txt_Tag;
private System.Windows.Forms.CheckBox ckb_IsInterface;
private System.Windows.Forms.Label lbl_IsInterface;
private System.Windows.Forms.Label lbl_Type;
private System.Windows.Forms.Label lbl_FunEntity;
private System.Windows.Forms.ComboBox cbo_Type;
private System.Windows.Forms.TextBox txt_FunEntity;
private System.Windows.Forms.Label lbl_BelongTo;
private System.Windows.Forms.TextBox txt_BelongTo;
private System.Windows.Forms.TextBox txt_Detail;
private System.Windows.Forms.Label lbl_Detail;
private System.Windows.Forms.Button btn_Confirm;
private System.Windows.Forms.Button btn_Cancel;
private System.Windows.Forms.Button btn_Help;

//用来保存原始的功能记录
private FunctionTable oriFuncItem;

//用来保存数字字典功能类别的数据
ClientDictionary[] DIC_funcType;
//用来保存Connection属性
private OracleConnection funcTableConn;
//用来保存修改后的记录
private FunctionTable newFuncItem;
public FunctionTable NewFuncItem {get {return newFuncItem;}}
//用来判断是否用户进行了修改
private bool isEdit=false;
public bool IsEdit {get {return isEdit;}}
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;

/// <summary>
/// 构造函数,通过editFuncItem参数和dic_funcType对窗口进行初始化值
/// </summary>
public SM_EditFunction(FunctionTable editFuncItem,ClientDictionary[] dic_funcType)
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//用参数值对本窗口相应的变量进行赋值保存
oriFuncItem=editFuncItem;
DIC_funcType=dic_funcType;
const string VALUEMEMBER="valueMember",DISPLAYMEMBER="displayMember",NULLTEXT="";
cbo_Type.DataSource = DIC_funcType;
cbo_Type.ValueMember = VALUEMEMBER;
cbo_Type.DisplayMember = DISPLAYMEMBER;

DataAccessObject funcTableAccessObject=new DataAccessObject();
funcTableConn=funcTableAccessObject.Connection;

this.txt_Name.Text=oriFuncItem.funcName;
this.txt_Tag.Text=oriFuncItem.funcTag;
if (oriFuncItem.funcIsInterface =="0")
{
this.ckb_IsInterface.Checked=false;
}
else
{
this.ckb_IsInterface.Checked=true;
}
this.cbo_Type.SelectedValue=oriFuncItem.funcType;
this.txt_FunEntity.Text=oriFuncItem.funcEntity;
this.txt_BelongTo.Text=oriFuncItem.funcBelongTo;
this.txt_Detail.Text=oriFuncItem.funcDetail;

}

/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(SM_EditFunction));
this.lbl_Name = new System.Windows.Forms.Label();
this.lbl_Tag = new System.Windows.Forms.Label();
this.lbl_Type = ne