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

📄 pickrole.cs

📁 微软的行业应用解决方案示例
💻 CS
字号:
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace HardwareDistributor.UI
{
	public partial class PickRole : Form
	{		
		public PickRole()
		{
			InitializeComponent();

			// We are removing both the Control Box and the Minimize Box, so that we don't
			// have to handle these in our code. This is not necessary in Windows Mobile Standard,
			// but we are writing this code so that it works on all platforms without any changes
			// or any recompiling.
			this.ControlBox = false;
			this.MinimizeBox = false;
		}

		/// <summary>
		/// Go back to the last state
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void menuItem1_Click(object sender, EventArgs e)
		{
			// Using the state machine go back to the Logon screen
			this.Close();			
		}

		/// <summary>
		/// Go to the currently selected role
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void menuItem2_Click(object sender, EventArgs e)
		{
			//Take user to appropriate screen based on Role
			if (customerServiceGradientButton.Pressed)					
				customerServiceGradientButton_Click(sender, e);
			else if (warehouseGradientButton.Pressed)	
				warehouseGradientButton_Click(sender, e);
			else if (deliveryGradientButton.Pressed)
				deliveryGradientButton_Click(sender, e);
		}

		/// <summary>
		/// The Customer Service Role was clicked
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void customerServiceGradientButton_Click(object sender, EventArgs e)
		{
			//Launch Customer Service screen
			CustomerService cs = new CustomerService();
			cs.ShowDialog();
			cs.Dispose();

            //bring back focus
            this.Activate();
		}

		/// <summary>
		/// The Warehouse role was clicked
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void warehouseGradientButton_Click(object sender, EventArgs e)
		{
			//Launch Warehouse screen
			Warehouse warehouse = new Warehouse();
			warehouse.ShowDialog();
			warehouse.Dispose();

            //bring back focus
            this.Activate();
		}

		/// <summary>
		/// The Delivery Role was clicked
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void deliveryGradientButton_Click(object sender, EventArgs e)
		{
			//Launch Deliveries screen
			Deliveries deliveries = new Deliveries();
			deliveries.ShowDialog();
			deliveries.Dispose();

            //bring back focus
            this.Activate();
		}

		// <summary>
		/// Custom Handling for the back key
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void BackKeyDown(object sender, KeyEventArgs e)
		{
			if ((e.KeyCode == System.Windows.Forms.Keys.Back))
			{
				// Back

				// if the back key is hit, close this dialog
				this.Close();
			}
		}
	}
}

⌨️ 快捷键说明

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