⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 childmgruser.cs

📁 报刊广告管理系统。CSharp编写
💻 CS
📖 第 1 页 / 共 3 页
字号:
			this.chkMPG2I1.Size = new System.Drawing.Size(80, 19);
			this.chkMPG2I1.TabIndex = 32;
			// 
			// chkMPG2
			// 
			this.chkMPG2.Location = new System.Drawing.Point(456, 8);
			this.chkMPG2.Name = "chkMPG2";
			// 
			// chkMPG2.Properties
			// 
			this.chkMPG2.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.chkMPG2.Properties.Appearance.Options.UseFont = true;
			this.chkMPG2.Properties.Caption = "管理";
			this.chkMPG2.Properties.ReadOnly = true;
			this.chkMPG2.Size = new System.Drawing.Size(48, 19);
			this.chkMPG2.TabIndex = 31;
			// 
			// chkMPG1I5
			// 
			this.chkMPG1I5.Location = new System.Drawing.Point(376, 96);
			this.chkMPG1I5.Name = "chkMPG1I5";
			// 
			// chkMPG1I5.Properties
			// 
			this.chkMPG1I5.Properties.Caption = "广告模版";
			this.chkMPG1I5.Properties.ReadOnly = true;
			this.chkMPG1I5.Size = new System.Drawing.Size(80, 19);
			this.chkMPG1I5.TabIndex = 31;
			// 
			// mainPanel
			// 
			this.mainPanel.Controls.Add(this.gcUser);
			this.mainPanel.Controls.Add(this.nbbUser);
			this.mainPanel.Dock = System.Windows.Forms.DockStyle.Fill;
			this.mainPanel.Location = new System.Drawing.Point(0, 0);
			this.mainPanel.Name = "mainPanel";
			this.mainPanel.Size = new System.Drawing.Size(552, 232);
			this.mainPanel.TabIndex = 6;
			// 
			// ChildMgrUser
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(552, 382);
			this.Controls.Add(this.mainPanel);
			this.Controls.Add(this.dpDetail);
			this.Name = "ChildMgrUser";
			this.Controls.SetChildIndex(this.dpDetail, 0);
			this.Controls.SetChildIndex(this.mainPanel, 0);
			this.Controls.SetChildIndex(this.btnClose, 0);
			((System.ComponentModel.ISupportInitialize)(this.gcUser)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.wwamds1)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.gvUser)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.dockManager1)).EndInit();
			this.dpDetail.ResumeLayout(false);
			this.dockPanel1_Container.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.txtName.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtCode.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtDuty.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtPhone.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtMemo.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.chkMPG1I3.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.chkMPG1I4.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.chkMPG1I2.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.chkMPG1I1.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.chkMPG1.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.chkMPG2I4.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.chkMPG2I3.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.chkMPG2I2.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.chkMPG2I1.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.chkMPG2.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.chkMPG1I5.Properties)).EndInit();
			this.mainPanel.ResumeLayout(false);
			this.ResumeLayout(false);

		}		#endregion		#endregion		#region Variable && Property		Dlg.DlgDataUser dlgUser;		WWAM.BLL.UserInfo uinfoshow = new WWAM.BLL.UserInfo();		DataRow drUser		{			get			{				return this.gvUser.GetDataRow(this.gvUser.FocusedRowHandle);			}		}		DataTable dtUser		{			get			{				return (DataTable)this.gcUser.DataSource;			}		}		#endregion		#region Virtaul Event
		protected override void OnFormLoad()
		{
			dlgUser = new WWAM.Forms.Dlg.DlgDataUser(this);
			this.setLayoutFileName("User");
			this.ViewLoadLayout(this.gvUser);
		}
		protected override void OnFormClose()
		{
			this.ViewSaveLayout(this.gvUser);
		}
		protected override void OnFormShow()
		{}
		protected override void DataRefresh()
		{
			this.gcUser.DataSource = this.BaseDB.RunCmdGetTable("select * from iUser where SysKeep = 0",0);
			ShowDetail();
		}
		#endregion

		#region ShowDetail
		void ShowDetail()
		{
			this.uinfoshow.GetData(this.drUser);

			this.txtCode.Text = this.uinfoshow.Data.Code;			this.txtName.Text = this.uinfoshow.Data.Name;			this.txtDuty.Text = this.uinfoshow.Data.Duty;			this.txtPhone.Text = this.uinfoshow.Data.Phone;			this.txtMemo.Text = this.uinfoshow.Data.Memo;			this.chkMPG1.Checked = this.uinfoshow.Purview.MPG1;			this.chkMPG1I1.Checked = this.uinfoshow.Purview.MPG1I1;			this.chkMPG1I2.Checked = this.uinfoshow.Purview.MPG1I2;			this.chkMPG1I3.Checked = this.uinfoshow.Purview.MPG1I3;			this.chkMPG1I4.Checked = this.uinfoshow.Purview.MPG1I4;			this.chkMPG1I5.Checked = this.uinfoshow.Purview.MPG1I5;			this.chkMPG2.Checked = this.uinfoshow.Purview.MPG2;			this.chkMPG2I1.Checked = this.uinfoshow.Purview.MPG2I1;			this.chkMPG2I2.Checked = this.uinfoshow.Purview.MPG2I2;			this.chkMPG2I3.Checked = this.uinfoshow.Purview.MPG2I3;			this.chkMPG2I4.Checked = this.uinfoshow.Purview.MPG2I4;		}
		#endregion

		#region Control EditValue Changed
		private void gvUser_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
		{
			ShowDetail();
		}
		#endregion

		#region NavBarBtns ClickButton
		private void nbbUser_ClickButton(object sender, WWAM.BLL.NavBarBtns.ButtonEventArgs e)
		{
			switch((string)e.Button.Tag)
			{
				case "Append":
					#region Append
					DataTable _fdt = this.dtUser!=null?this.dtUser:new DataTable();
					if(this.dlgUser.ShowDialog(_fdt) == DialogResult.OK)
					{
						DataRow _ndr = this.dlgUser.GetRow();
						int rv = this.BaseDB.RunSPGetInt("iUserInsert",_ndr,0);
						if(rv > 0)
						{
							_ndr["Userid"] = rv;
							WWAM.DBA.DTPro.AddRow(dtUser,_ndr);
							ShowDetail();
						}
						else
						{
							string title = "人员资料添加失败";
							switch(rv)
							{
								case -1:
									this.BaseMsgBox.ShowWarning("帐号["+(string)_ndr["Code"]+"]已被占用。",title);
									break;
								case -2:
									this.BaseMsgBox.ShowWarning("姓名["+(string)_ndr["Name"]+"]已被占用。",title);
									break;
								case -99:
									this.BaseMsgBox.ShowWarning("数据库执行错误!\r\n"+this.BaseDB.LastError,title);
									break;
								default:
									this.BaseMsgBox.ShowWarning("未知错误!\r\n错误码:"+rv.ToString(),title);
									break;
							}
						}
					}
					#endregion
					break;
				case "Delete":
					#region Delete
					if(this.drUser!=null)
					{
						if(this.BaseMsgBox.ShowQuestion("您确认要删除该条人员资料数据吗?","客户资料删除")==DialogResult.OK)
						{
							int rv = this.BaseDB.RunSPGetInt("iUserDelete",new WWAM.DBA.SqlPara((int)this.drUser["Userid"]),0);
							if(rv>0)
							{
								WWAM.DBA.DTPro.RemoveRow(dtUser,drUser);
								ShowDetail();
							}
							else
							{
								string title = "人员资料删除失败";
								switch(rv)
								{
									case -99:
										this.BaseMsgBox.ShowWarning("数据库执行错误!\r\n"+this.BaseDB.LastError,title);
										break;
									default:
										this.BaseMsgBox.ShowWarning("未知错误!\r\n错误码:"+rv.ToString(),title);
										break;
								}
							}
						}
					}
					#endregion
					break;
				case "Edit":
					#region Edit
					if(drUser != null)
					{
						DataTable _fdt1 = this.dtUser!=null?this.dtUser:new DataTable();
						if(this.dlgUser.ShowDialog(drUser,_fdt1) == DialogResult.OK)
						{
							DataRow _ndr = this.dlgUser.GetRow();
							int rv = this.BaseDB.RunSPGetInt("iUserUpdate",_ndr,0);
							if(rv > 0)
							{
								WWAM.DBA.DRPro.CloneDataRow(_ndr,drUser);
								ShowDetail();
							}
							else
							{
								string title = "人员资料修改失败";
								switch(rv)
								{
									case -1:
										this.BaseMsgBox.ShowWarning("帐号["+(string)_ndr["Code"]+"]已被占用。",title);
										break;
									case -2:
										this.BaseMsgBox.ShowWarning("姓名["+(string)_ndr["Name"]+"]已被占用。",title);
										break;
									case -99:
										this.BaseMsgBox.ShowWarning("数据库执行错误!\r\n"+this.BaseDB.LastError,title);
										break;
									default:
										this.BaseMsgBox.ShowWarning("未知错误!\r\n错误码:"+rv.ToString(),title);
										break;
								}
							}
						}
					}
					#endregion
					break;
				case "Refresh":
					DataRefresh();
					break;
			}
		}
		#endregion

	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -