工程报价一览,子工程报价和材料报价,报价表预览打印管理员编号:0 密码 asdf
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace ProjectBudget{ public partial class FormMain : Form { public FormMain() { InitializeComponent(); InitUserRights(); } private void InitUserRights() { txtWelcome.Text = string.Format("欢迎:{0}", LoginStatus.CurrentUser.UserName); foreach (var item in mainToolStrip.Items) { var btn = item as ToolStripButton; if (btn != null && btn.Tag != null) { var flag = Utility.GetSysRights(btn.Tag.ToString()); btn.Enabled = ((LoginStatus.CurrentUser.UserRight & flag) == LoginStatus.CurrentUser.UserRight); } } } private void OnLogoutButtonClick(object sender, EventArgs e) { if (DialogResult.OK == MessageBox.Show("确定要退出系统吗?", "系统提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question)) { Application.Exit(); } } private void ShowMdiChild(Type formType) { foreach (var child in MdiChildren) { if (child.GetType().Equals(formType)) { child.Activate(); return; } } var form = Activator.CreateInstance(formType) as Form; if (form != null) { form.MdiParent = this; form.WindowState = FormWindowState.Maximized; form.Show(); } } private void OnChangePwdButtonClick(object sender, EventArgs e) { new FormChangePwd().ShowDialog(this); } private void OnUnitButtonClick(object sender, EventArgs e) { ShowMdiChild(typeof(FormUnits)); } private const int WM_GETTEXT = 0xD; protected override void WndProc(ref Message m) { if (m.Msg == WM_GETTEXT) { if (!(mainToolStrip.Items[0] is ToolStripButton)) mainToolStrip.Items[0].Visible = false; } base.WndProc(ref m); } private void OnManageUserButtonClick(object sender, EventArgs e) { ShowMdiChild(typeof(FormSysUser)); } private void OnMaterialButtonClick(object sender, EventArgs e) { ShowMdiChild(typeof(FormMaterialPrice)); } private void OnProjectBudgetButtonClick(object sender, EventArgs e) { ShowMdiChild(typeof(FormProjects)); } private void OnPrintButtonClick(object sender, EventArgs e) { ShowMdiChild(typeof(FormPrint)); } }}
评论