Example #1
0
 /// <summary>
 /// 设计器支持所需的方法 - 不要使用代码编辑器修改
 /// 此方法的内容。
 /// </summary>
 private void InitializeComponent()
 {
     this.cn                = new System.Data.SqlClient.SqlConnection();
     this.daRole            = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sm1               = new LIMS.SystemManagement.SM();
     this.daPermission      = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand2 = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand2 = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand2 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand2 = new System.Data.SqlClient.SqlCommand();
     ((System.ComponentModel.ISupportInitialize)(this.sm1)).BeginInit();
     this.dgRole.UpdateCellBatch  += new Infragistics.WebUI.UltraWebGrid.UpdateCellBatchEventHandler(this.dgRole_UpdateCellBatch);
     this.dgRole.DeleteRowBatch   += new Infragistics.WebUI.UltraWebGrid.DeleteRowBatchEventHandler(this.dgRole_DeleteRowBatch);
     this.dgRole.AddRowBatch      += new Infragistics.WebUI.UltraWebGrid.AddRowBatchEventHandler(this.dgRole_AddRowBatch);
     this.ConfirmRole.Click       += new Infragistics.WebUI.WebDataInput.ClickHandler(this.ConfirmRole_Click);
     this.CancelRole.Click        += new Infragistics.WebUI.WebDataInput.ClickHandler(this.CancelRole_Click);
     this.ModifyPermission.Click  += new Infragistics.WebUI.WebDataInput.ClickHandler(this.ModifyPermission_Click);
     this.ConfirmPermission.Click += new Infragistics.WebUI.WebDataInput.ClickHandler(this.ConfirmPermission_Click);
     this.CancelPermission.Click  += new Infragistics.WebUI.WebDataInput.ClickHandler(this.CancelPermission_Click);
     //
     // cn
     //
     this.cn.ConnectionString = "workstation id=QDMT;packet size=4096;user id=sa;integrated security=SSPI;data sou" +
                                "rce=\".\";persist security info=False;initial catalog=lims";
     //
     // daRole
     //
     this.daRole.DeleteCommand = this.sqlDeleteCommand1;
     this.daRole.InsertCommand = this.sqlInsertCommand1;
     this.daRole.SelectCommand = this.sqlSelectCommand1;
     this.daRole.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "角色", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ID", "ID"),
             new System.Data.Common.DataColumnMapping("角色名称", "角色名称"),
             new System.Data.Common.DataColumnMapping("角色描述", "角色描述")
         })
     });
     this.daRole.UpdateCommand = this.sqlUpdateCommand1;
     //
     // sqlDeleteCommand1
     //
     this.sqlDeleteCommand1.CommandText = "DELETE FROM 角色 WHERE (ID = @Original_ID) AND (角色名称 = @Original_角色名称 OR @Original_" +
                                          "角色名称 IS NULL AND 角色名称 IS NULL)";
     this.sqlDeleteCommand1.Connection = this.cn;
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_角色名称", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "角色名称", System.Data.DataRowVersion.Original, null));
     //
     // sqlInsertCommand1
     //
     this.sqlInsertCommand1.CommandText = "INSERT INTO 角色(角色名称, 角色描述) VALUES (@角色名称, @角色描述); SELECT ID, 角色名称, 角色描述 FROM 角色 W" +
                                          "HERE (ID = @@IDENTITY)";
     this.sqlInsertCommand1.Connection = this.cn;
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@角色名称", System.Data.SqlDbType.NVarChar, 50, "角色名称"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@角色描述", System.Data.SqlDbType.NVarChar, 1073741823, "角色描述"));
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = "SELECT ID, 角色名称, 角色描述 FROM 角色";
     this.sqlSelectCommand1.Connection  = this.cn;
     //
     // sqlUpdateCommand1
     //
     this.sqlUpdateCommand1.CommandText = "UPDATE 角色 SET 角色名称 = @角色名称, 角色描述 = @角色描述 WHERE (ID = @Original_ID) AND (角色名称 = @O" +
                                          "riginal_角色名称 OR @Original_角色名称 IS NULL AND 角色名称 IS NULL); SELECT ID, 角色名称, 角色描述 " +
                                          "FROM 角色 WHERE (ID = @ID)";
     this.sqlUpdateCommand1.Connection = this.cn;
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@角色名称", System.Data.SqlDbType.NVarChar, 50, "角色名称"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@角色描述", System.Data.SqlDbType.NVarChar, 1073741823, "角色描述"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_角色名称", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "角色名称", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"));
     //
     // sm1
     //
     this.sm1.DataSetName = "SM";
     this.sm1.Locale      = new System.Globalization.CultureInfo("zh-CN");
     //
     // daPermission
     //
     this.daPermission.DeleteCommand = this.sqlDeleteCommand2;
     this.daPermission.InsertCommand = this.sqlInsertCommand2;
     this.daPermission.SelectCommand = this.sqlSelectCommand2;
     this.daPermission.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "权限模块", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("权限模块名", "权限模块名"),
             new System.Data.Common.DataColumnMapping("ID", "ID")
         })
     });
     this.daPermission.UpdateCommand = this.sqlUpdateCommand2;
     //
     // sqlDeleteCommand2
     //
     this.sqlDeleteCommand2.CommandText = "DELETE FROM 权限模块 WHERE (ID = @Original_ID) AND (权限模块名 = @Original_权限模块名)";
     this.sqlDeleteCommand2.Connection  = this.cn;
     this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_权限模块名", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "权限模块名", System.Data.DataRowVersion.Original, null));
     //
     // sqlInsertCommand2
     //
     this.sqlInsertCommand2.CommandText = "INSERT INTO 权限模块(权限模块名) VALUES (@权限模块名); SELECT 权限模块名, ID FROM 权限模块 WHERE (ID = @" +
                                          "@IDENTITY)";
     this.sqlInsertCommand2.Connection = this.cn;
     this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@权限模块名", System.Data.SqlDbType.NVarChar, 50, "权限模块名"));
     //
     // sqlSelectCommand2
     //
     this.sqlSelectCommand2.CommandText = "SELECT 权限模块名, ID FROM 权限模块";
     this.sqlSelectCommand2.Connection  = this.cn;
     //
     // sqlUpdateCommand2
     //
     this.sqlUpdateCommand2.CommandText = "UPDATE 权限模块 SET 权限模块名 = @权限模块名 WHERE (ID = @Original_ID) AND (权限模块名 = @Original_权" +
                                          "限模块名); SELECT 权限模块名, ID FROM 权限模块 WHERE (ID = @ID)";
     this.sqlUpdateCommand2.Connection = this.cn;
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@权限模块名", System.Data.SqlDbType.NVarChar, 50, "权限模块名"));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_权限模块名", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "权限模块名", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"));
     this.Load += new System.EventHandler(this.Page_Load);
     ((System.ComponentModel.ISupportInitialize)(this.sm1)).EndInit();
 }
 /// <summary>
 /// 设计器支持所需的方法 - 不要使用代码编辑器修改
 /// 此方法的内容。
 /// </summary>
 private void InitializeComponent()
 {
     this.cn                = new System.Data.SqlClient.SqlConnection();
     this.daPermission      = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sm1               = new LIMS.SystemManagement.SM();
     this.daPermissionType  = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand2 = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand2 = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand2 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand2 = new System.Data.SqlClient.SqlCommand();
     this.daMenu            = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand3 = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand3 = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand3 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand3 = new System.Data.SqlClient.SqlCommand();
     ((System.ComponentModel.ISupportInitialize)(this.sm1)).BeginInit();
     this.dgPermission.UpdateCellBatch += new Infragistics.WebUI.UltraWebGrid.UpdateCellBatchEventHandler(this.dgPermission_UpdateCellBatch);
     this.dgPermission.DeleteRowBatch  += new Infragistics.WebUI.UltraWebGrid.DeleteRowBatchEventHandler(this.dgPermission_DeleteRowBatch);
     this.dgPermission.AddRowBatch     += new Infragistics.WebUI.UltraWebGrid.AddRowBatchEventHandler(this.dgPermission_AddRowBatch);
     this.Sumbit.Click += new Infragistics.WebUI.WebDataInput.ClickHandler(this.Sumbit_Click);
     this.Cancel.Click += new Infragistics.WebUI.WebDataInput.ClickHandler(this.Cancel_Click);
     //
     // cn
     //
     this.cn.ConnectionString = "workstation id=QDMT;packet size=4096;user id=sa;integrated security=SSPI;data sou" +
                                "rce=\".\";persist security info=False;initial catalog=lims";
     //
     // daPermission
     //
     this.daPermission.DeleteCommand = this.sqlDeleteCommand1;
     this.daPermission.InsertCommand = this.sqlInsertCommand1;
     this.daPermission.SelectCommand = this.sqlSelectCommand1;
     this.daPermission.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "权限模块", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ID", "ID"),
             new System.Data.Common.DataColumnMapping("权限模块名", "权限模块名"),
             new System.Data.Common.DataColumnMapping("类别", "类别"),
             new System.Data.Common.DataColumnMapping("菜单级别", "菜单级别"),
             new System.Data.Common.DataColumnMapping("菜单项目ID", "菜单项目ID"),
             new System.Data.Common.DataColumnMapping("链接地址", "链接地址"),
             new System.Data.Common.DataColumnMapping("备注", "备注")
         })
     });
     this.daPermission.UpdateCommand = this.sqlUpdateCommand1;
     //
     // sqlDeleteCommand1
     //
     this.sqlDeleteCommand1.CommandText = @"DELETE FROM 权限模块 WHERE (ID = @Original_ID) AND (权限模块名 = @Original_权限模块名) AND (类别 = @Original_类别) AND (菜单级别 = @Original_菜单级别 OR @Original_菜单级别 IS NULL AND 菜单级别 IS NULL) AND (菜单项目ID = @Original_菜单项目ID OR @Original_菜单项目ID IS NULL AND 菜单项目ID IS NULL) AND (链接地址 = @Original_链接地址 OR @Original_链接地址 IS NULL AND 链接地址 IS NULL)";
     this.sqlDeleteCommand1.Connection  = this.cn;
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_权限模块名", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "权限模块名", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_类别", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "类别", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_菜单级别", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "菜单级别", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_菜单项目ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "菜单项目ID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_链接地址", System.Data.SqlDbType.NVarChar, 1000, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "链接地址", System.Data.DataRowVersion.Original, null));
     //
     // sqlInsertCommand1
     //
     this.sqlInsertCommand1.CommandText = "INSERT INTO 权限模块(权限模块名, 类别, 菜单级别, 菜单项目ID, 链接地址, 备注) VALUES (@权限模块名, @类别, @菜单级别, @" +
                                          "菜单项目ID, @链接地址, @备注); SELECT ID, 权限模块名, 类别, 菜单级别, 菜单项目ID, 链接地址, 备注 FROM 权限模块 WHER" +
                                          "E (ID = @@IDENTITY)";
     this.sqlInsertCommand1.Connection = this.cn;
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@权限模块名", System.Data.SqlDbType.NVarChar, 50, "权限模块名"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@类别", System.Data.SqlDbType.Int, 4, "类别"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@菜单级别", System.Data.SqlDbType.Int, 4, "菜单级别"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@菜单项目ID", System.Data.SqlDbType.Int, 4, "菜单项目ID"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@链接地址", System.Data.SqlDbType.NVarChar, 1000, "链接地址"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@备注", System.Data.SqlDbType.NVarChar, 1073741823, "备注"));
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = "SELECT ID, 权限模块名, 类别, 菜单级别, 菜单项目ID, 链接地址, 备注 FROM 权限模块";
     this.sqlSelectCommand1.Connection  = this.cn;
     //
     // sqlUpdateCommand1
     //
     this.sqlUpdateCommand1.CommandText = @"UPDATE 权限模块 SET 权限模块名 = @权限模块名, 类别 = @类别, 菜单级别 = @菜单级别, 菜单项目ID = @菜单项目ID, 链接地址 = @链接地址, 备注 = @备注 WHERE (ID = @Original_ID) AND (权限模块名 = @Original_权限模块名) AND (类别 = @Original_类别) AND (菜单级别 = @Original_菜单级别 OR @Original_菜单级别 IS NULL AND 菜单级别 IS NULL) AND (菜单项目ID = @Original_菜单项目ID OR @Original_菜单项目ID IS NULL AND 菜单项目ID IS NULL) AND (链接地址 = @Original_链接地址 OR @Original_链接地址 IS NULL AND 链接地址 IS NULL); SELECT ID, 权限模块名, 类别, 菜单级别, 菜单项目ID, 链接地址, 备注 FROM 权限模块 WHERE (ID = @ID)";
     this.sqlUpdateCommand1.Connection  = this.cn;
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@权限模块名", System.Data.SqlDbType.NVarChar, 50, "权限模块名"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@类别", System.Data.SqlDbType.Int, 4, "类别"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@菜单级别", System.Data.SqlDbType.Int, 4, "菜单级别"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@菜单项目ID", System.Data.SqlDbType.Int, 4, "菜单项目ID"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@链接地址", System.Data.SqlDbType.NVarChar, 1000, "链接地址"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@备注", System.Data.SqlDbType.NVarChar, 1073741823, "备注"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_权限模块名", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "权限模块名", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_类别", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "类别", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_菜单级别", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "菜单级别", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_菜单项目ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "菜单项目ID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_链接地址", System.Data.SqlDbType.NVarChar, 1000, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "链接地址", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"));
     //
     // sm1
     //
     this.sm1.DataSetName = "SM";
     this.sm1.Locale      = new System.Globalization.CultureInfo("zh-CN");
     //
     // daPermissionType
     //
     this.daPermissionType.DeleteCommand = this.sqlDeleteCommand2;
     this.daPermissionType.InsertCommand = this.sqlInsertCommand2;
     this.daPermissionType.SelectCommand = this.sqlSelectCommand2;
     this.daPermissionType.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "权限类别", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ID", "ID"),
             new System.Data.Common.DataColumnMapping("Type", "Type")
         })
     });
     this.daPermissionType.UpdateCommand = this.sqlUpdateCommand2;
     //
     // sqlDeleteCommand2
     //
     this.sqlDeleteCommand2.CommandText = "DELETE FROM 权限类别 WHERE (ID = @Original_ID) AND (类别 = @Original_Type OR @Original_" +
                                          "Type IS NULL AND 类别 IS NULL)";
     this.sqlDeleteCommand2.Connection = this.cn;
     this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Type", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Type", System.Data.DataRowVersion.Original, null));
     //
     // sqlInsertCommand2
     //
     this.sqlInsertCommand2.CommandText = "INSERT INTO 权限类别(类别) VALUES (@类别); SELECT ID, 类别 AS Type FROM 权限类别 WHERE (ID = @@" +
                                          "IDENTITY)";
     this.sqlInsertCommand2.Connection = this.cn;
     this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@类别", System.Data.SqlDbType.NVarChar, 50, "Type"));
     //
     // sqlSelectCommand2
     //
     this.sqlSelectCommand2.CommandText = "SELECT ID, 类别 AS Type FROM 权限类别";
     this.sqlSelectCommand2.Connection  = this.cn;
     //
     // sqlUpdateCommand2
     //
     this.sqlUpdateCommand2.CommandText = "UPDATE 权限类别 SET 类别 = @类别 WHERE (ID = @Original_ID) AND (类别 = @Original_Type OR @O" +
                                          "riginal_Type IS NULL AND 类别 IS NULL); SELECT ID, 类别 AS Type FROM 权限类别 WHERE (ID " +
                                          "= @ID)";
     this.sqlUpdateCommand2.Connection = this.cn;
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@类别", System.Data.SqlDbType.NVarChar, 50, "Type"));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Type", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Type", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"));
     //
     // daMenu
     //
     this.daMenu.DeleteCommand = this.sqlDeleteCommand3;
     this.daMenu.InsertCommand = this.sqlInsertCommand3;
     this.daMenu.SelectCommand = this.sqlSelectCommand3;
     this.daMenu.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "菜单", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ID", "ID"),
             new System.Data.Common.DataColumnMapping("item", "item")
         })
     });
     this.daMenu.UpdateCommand = this.sqlUpdateCommand3;
     //
     // sqlDeleteCommand3
     //
     this.sqlDeleteCommand3.CommandText = "DELETE FROM 菜单 WHERE (ID = @Original_ID) AND (菜单项目名 = @Original_item OR @Original" +
                                          "_item IS NULL AND 菜单项目名 IS NULL)";
     this.sqlDeleteCommand3.Connection = this.cn;
     this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_item", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "item", System.Data.DataRowVersion.Original, null));
     //
     // sqlInsertCommand3
     //
     this.sqlInsertCommand3.CommandText = "INSERT INTO 菜单(菜单项目名) VALUES (@菜单项目名); SELECT ID, 菜单项目名 AS item FROM 菜单 WHERE (ID" +
                                          " = @@IDENTITY)";
     this.sqlInsertCommand3.Connection = this.cn;
     this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@菜单项目名", System.Data.SqlDbType.NVarChar, 50, "item"));
     //
     // sqlSelectCommand3
     //
     this.sqlSelectCommand3.CommandText = "SELECT ID, 菜单项目名 AS item FROM 菜单";
     this.sqlSelectCommand3.Connection  = this.cn;
     //
     // sqlUpdateCommand3
     //
     this.sqlUpdateCommand3.CommandText = "UPDATE 菜单 SET 菜单项目名 = @菜单项目名 WHERE (ID = @Original_ID) AND (菜单项目名 = @Original_ite" +
                                          "m OR @Original_item IS NULL AND 菜单项目名 IS NULL); SELECT ID, 菜单项目名 AS item FROM 菜单" +
                                          " WHERE (ID = @ID)";
     this.sqlUpdateCommand3.Connection = this.cn;
     this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@菜单项目名", System.Data.SqlDbType.NVarChar, 50, "item"));
     this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_item", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "item", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"));
     this.Load += new System.EventHandler(this.Page_Load);
     ((System.ComponentModel.ISupportInitialize)(this.sm1)).EndInit();
 }
Example #3
0
 /// <summary>
 /// 设计器支持所需的方法 - 不要使用代码编辑器修改
 /// 此方法的内容。
 /// </summary>
 private void InitializeComponent()
 {
     this.cn                = new System.Data.SqlClient.SqlConnection();
     this.daUser            = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.daRoleOfUser      = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand2 = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand2 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sm1               = new LIMS.SystemManagement.SM();
     this.daRole            = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand2 = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand3 = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand3 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand2 = new System.Data.SqlClient.SqlCommand();
     ((System.ComponentModel.ISupportInitialize)(this.sm1)).BeginInit();
     this.dgRoleOfUser.UpdateCellBatch += new Infragistics.WebUI.UltraWebGrid.UpdateCellBatchEventHandler(this.dgRoleOfUser_UpdateCellBatch);
     this.dgRoleOfUser.DeleteRowBatch  += new Infragistics.WebUI.UltraWebGrid.DeleteRowBatchEventHandler(this.dgRoleOfUser_DeleteRowBatch);
     this.dgRoleOfUser.AddRowBatch     += new Infragistics.WebUI.UltraWebGrid.AddRowBatchEventHandler(this.dgRoleOfUser_AddRowBatch);
     this.Confirm.Click += new Infragistics.WebUI.WebDataInput.ClickHandler(this.Confirm_Click);
     //
     // cn
     //
     this.cn.ConnectionString = "workstation id=QDMT;packet size=4096;user id=sa;integrated security=SSPI;data sou" +
                                "rce=\".\";persist security info=False;initial catalog=lims";
     //
     // daUser
     //
     this.daUser.InsertCommand = this.sqlInsertCommand1;
     this.daUser.SelectCommand = this.sqlSelectCommand1;
     this.daUser.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "用户信息", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("用户名", "用户名"),
             new System.Data.Common.DataColumnMapping("姓名", "姓名"),
             new System.Data.Common.DataColumnMapping("性别", "性别"),
             new System.Data.Common.DataColumnMapping("科室", "科室"),
             new System.Data.Common.DataColumnMapping("ID", "ID")
         })
     });
     //
     // sqlInsertCommand1
     //
     this.sqlInsertCommand1.CommandText = "INSERT INTO 用户信息(用户名, 姓名, 性别, 科室) VALUES (@用户名, @姓名, @性别, @科室); SELECT 用户名, 姓名, 性" +
                                          "别, 科室, ID FROM 用户信息";
     this.sqlInsertCommand1.Connection = this.cn;
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@用户名", System.Data.SqlDbType.NVarChar, 255, "用户名"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@姓名", System.Data.SqlDbType.NVarChar, 10, "姓名"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@性别", System.Data.SqlDbType.NVarChar, 5, "性别"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@科室", System.Data.SqlDbType.NVarChar, 50, "科室"));
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = "SELECT 用户名, 姓名, 性别, 科室, ID FROM 用户信息";
     this.sqlSelectCommand1.Connection  = this.cn;
     //
     // daRoleOfUser
     //
     this.daRoleOfUser.DeleteCommand = this.sqlDeleteCommand1;
     this.daRoleOfUser.InsertCommand = this.sqlInsertCommand2;
     this.daRoleOfUser.SelectCommand = this.sqlSelectCommand2;
     this.daRoleOfUser.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "用户角色", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ID", "ID"),
             new System.Data.Common.DataColumnMapping("用户ID", "用户ID"),
             new System.Data.Common.DataColumnMapping("用户角色", "用户角色")
         })
     });
     this.daRoleOfUser.UpdateCommand = this.sqlUpdateCommand1;
     //
     // sqlDeleteCommand1
     //
     this.sqlDeleteCommand1.CommandText = "DELETE FROM 用户角色 WHERE (ID = @Original_ID) AND (用户ID = @Original_用户ID OR @Origina" +
                                          "l_用户ID IS NULL AND 用户ID IS NULL) AND (角色ID = @Original_用户角色)";
     this.sqlDeleteCommand1.Connection = this.cn;
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_用户ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "用户ID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_用户角色", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "用户角色", System.Data.DataRowVersion.Original, null));
     //
     // sqlInsertCommand2
     //
     this.sqlInsertCommand2.CommandText = "INSERT INTO 用户角色(用户ID, 角色ID) VALUES (@用户ID, @角色ID); SELECT ID, 用户ID, 角色ID AS 用户角色" +
                                          " FROM 用户角色 WHERE (ID = @@IDENTITY)";
     this.sqlInsertCommand2.Connection = this.cn;
     this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@用户ID", System.Data.SqlDbType.Int, 4, "用户ID"));
     this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@角色ID", System.Data.SqlDbType.Int, 4, "用户角色"));
     //
     // sqlSelectCommand2
     //
     this.sqlSelectCommand2.CommandText = "SELECT ID, 用户ID, 角色ID AS 用户角色 FROM 用户角色";
     this.sqlSelectCommand2.Connection  = this.cn;
     //
     // sqlUpdateCommand1
     //
     this.sqlUpdateCommand1.CommandText = "UPDATE 用户角色 SET 用户ID = @用户ID, 角色ID = @角色ID WHERE (ID = @Original_ID) AND (用户ID = " +
                                          "@Original_用户ID OR @Original_用户ID IS NULL AND 用户ID IS NULL) AND (角色ID = @Original" +
                                          "_用户角色); SELECT ID, 用户ID, 角色ID AS 用户角色 FROM 用户角色 WHERE (ID = @ID)";
     this.sqlUpdateCommand1.Connection = this.cn;
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@用户ID", System.Data.SqlDbType.Int, 4, "用户ID"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@角色ID", System.Data.SqlDbType.Int, 4, "用户角色"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_用户ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "用户ID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_用户角色", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "用户角色", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"));
     //
     // sm1
     //
     this.sm1.DataSetName = "SM";
     this.sm1.Locale      = new System.Globalization.CultureInfo("zh-CN");
     //
     // daRole
     //
     this.daRole.DeleteCommand = this.sqlDeleteCommand2;
     this.daRole.InsertCommand = this.sqlInsertCommand3;
     this.daRole.SelectCommand = this.sqlSelectCommand3;
     this.daRole.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "角色", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ID", "ID"),
             new System.Data.Common.DataColumnMapping("role", "role"),
             new System.Data.Common.DataColumnMapping("description", "description")
         })
     });
     this.daRole.UpdateCommand = this.sqlUpdateCommand2;
     //
     // sqlDeleteCommand2
     //
     this.sqlDeleteCommand2.CommandText = "DELETE FROM 角色 WHERE (ID = @Original_ID) AND (角色名称 = @Original_role OR @Original_" +
                                          "role IS NULL AND 角色名称 IS NULL)";
     this.sqlDeleteCommand2.Connection = this.cn;
     this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_role", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "role", System.Data.DataRowVersion.Original, null));
     //
     // sqlInsertCommand3
     //
     this.sqlInsertCommand3.CommandText = "INSERT INTO 角色(角色名称, 角色描述) VALUES (@角色名称, @角色描述); SELECT ID, 角色名称 AS role, 角色描述 A" +
                                          "S description FROM 角色 WHERE (ID = @@IDENTITY)";
     this.sqlInsertCommand3.Connection = this.cn;
     this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@角色名称", System.Data.SqlDbType.NVarChar, 50, "role"));
     this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@角色描述", System.Data.SqlDbType.NVarChar, 1073741823, "description"));
     //
     // sqlSelectCommand3
     //
     this.sqlSelectCommand3.CommandText = "SELECT ID, 角色名称 AS role, 角色描述 AS description FROM 角色";
     this.sqlSelectCommand3.Connection  = this.cn;
     //
     // sqlUpdateCommand2
     //
     this.sqlUpdateCommand2.CommandText = "UPDATE 角色 SET 角色名称 = @角色名称, 角色描述 = @角色描述 WHERE (ID = @Original_ID) AND (角色名称 = @O" +
                                          "riginal_role OR @Original_role IS NULL AND 角色名称 IS NULL); SELECT ID, 角色名称 AS rol" +
                                          "e, 角色描述 AS description FROM 角色 WHERE (ID = @ID)";
     this.sqlUpdateCommand2.Connection = this.cn;
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@角色名称", System.Data.SqlDbType.NVarChar, 50, "role"));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@角色描述", System.Data.SqlDbType.NVarChar, 1073741823, "description"));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_role", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "role", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"));
     this.Load += new System.EventHandler(this.Page_Load);
     ((System.ComponentModel.ISupportInitialize)(this.sm1)).EndInit();
 }