using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

using BookCommunityClient.AuthWS;
using BookCommunityClient.DataWS;

using System.Data;

namespace BookCommunityClient
{
	/// <summary>
	/// RequestFrm 的摘要说明。
	/// </summary>
	public class RequestFrm : System.Windows.Forms.Form
	{
		#region 自动生成字段
		private System.ComponentModel.IContainer components;
		private System.Windows.Forms.Panel pnlHome;
		private System.Windows.Forms.Panel pnlFinish;
		private System.Windows.Forms.Panel pnlFirst;
		private System.Windows.Forms.Panel pnlSecond;
		private System.Windows.Forms.Panel pnlThird;
		private System.Windows.Forms.Button btnPrev;
		private System.Windows.Forms.Button btnNext;
		private System.Windows.Forms.Button btnCancel;
		private System.Windows.Forms.Panel pnlBottom;
		private System.Windows.Forms.PictureBox pbxHome;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Panel pnlTop_First;
		private System.Windows.Forms.PictureBox pictureBox1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Panel pnlFill_First;
		private System.Windows.Forms.Label label13;
		private System.Windows.Forms.PictureBox pbxCoverPage_BookDetail;
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.Label label25;
		private System.Windows.Forms.Label label20;
		private System.Windows.Forms.Label label16;
		private System.Windows.Forms.Label lblBookNameChn_First;
		private System.Windows.Forms.Label lblBookNameEng_First;
		private System.Windows.Forms.Label lblStatus_First;
		private System.Windows.Forms.Label lblOwner_First;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.DataGrid dgQueue_First;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Panel pnlTop_Second;
		private System.Windows.Forms.PictureBox pbxPoint_Second;
		private System.Windows.Forms.TabControl tbcMain_Second;
		private System.Windows.Forms.TabPage tbpRequest;
		private System.Windows.Forms.TabPage tbpPreview;
		private System.Windows.Forms.LinkLabel llbEdit_Second;
		private System.Windows.Forms.LinkLabel llbSave_Second;
		private System.Windows.Forms.LinkLabel llbRestore_Second;
		private System.Windows.Forms.TextBox tbxPreview_Second;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.Label label8;
		private System.Windows.Forms.Label label9;
		private System.Windows.Forms.TextBox tbxUserName_Second;
		private System.Windows.Forms.TextBox tbxRealName_Second;
		private System.Windows.Forms.Label label10;
		private System.Windows.Forms.Label label11;
		private System.Windows.Forms.Label label12;
		private System.Windows.Forms.Label label14;
		private System.Windows.Forms.Label label15;
		private System.Windows.Forms.Label label17;
		private System.Windows.Forms.Label label18;
		private System.Windows.Forms.Label label19;
		private System.Windows.Forms.ComboBox cbbMobile_Second;
		private System.Windows.Forms.ComboBox cbbEmail_Second;
		private System.Windows.Forms.ComboBox cbbAddress_Second;
		private System.Windows.Forms.TextBox tbxMessage_Second;
		private System.Windows.Forms.DateTimePicker dtpPlanEndDate_Second;
		private System.Windows.Forms.DateTimePicker dtpPlanBeginDate_Second;
		private System.Windows.Forms.Label label21;
		private System.Windows.Forms.Label label22;
		private System.Windows.Forms.Button btnSend;
		private System.Windows.Forms.PictureBox pbxPoint_Third;
		private System.Windows.Forms.Panel pnlTop_Third;
		private System.Windows.Forms.Panel pnlFill_Third;
		private System.Windows.Forms.Panel pnlTop_Preview;
		private System.Windows.Forms.RichTextBox rtbMail;
		private System.Windows.Forms.Button btnFinish;
		private System.Windows.Forms.Label label23;
		private System.Windows.Forms.PictureBox pictureBox2;
		#endregion

		#region 自定义字段
		//当前是第几步
		int stage;

		//Main窗口对象的本地引用
		//书本信息
		private BookInformation m_curBookInfo;
		//用户信息
		private UserInformation m_curUserInfo;
		//书籍封面
		private Image m_curCoverPage;
		//auth服务
		private AuthService m_authSvc;
		//data服务
		private DataService m_dataSvc;
		//ticket
		private string m_authTicket;

		//cache了的ShareInfo
		private DataSetShareInfo m_dsShareInfo ;
		private DataSetMessage m_dsMessage;

		private MainFrm frmMain;

		#endregion

		#region 窗体创建与销毁
		public RequestFrm(MainFrm mainFrm)
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
			this.stage = 0;

			this.m_curBookInfo = mainFrm.CurrentBookInfo;
			this.m_curCoverPage = mainFrm.CurrentCoverPage;
			this.m_curUserInfo = mainFrm.CurrentUserInfo;

			this.m_authSvc = mainFrm.m_authSvc;
			this.m_dataSvc = mainFrm.m_dataSvc;

			this.m_dsShareInfo = mainFrm.DsShareInfo;

			this.m_authTicket = mainFrm.m_authTicket;

			this.m_dsMessage = mainFrm.DsMessage;

			this.frmMain = mainFrm;
		}

		/// <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(RequestFrm));
			this.pnlBottom = new System.Windows.Forms.Panel();
			this.btnFinish = new System.Windows.Forms.Button();
			this.btnSend = new System.Windows.Forms.Button();
			this.btnCancel = new System.Windows.Forms.Button();
			this.btnNext = new System.Windows.Forms.Button();
			this.btnPrev = new System.Windows.Forms.Button();
			this.pnlHome = new System.Windows.Forms.Panel();
			this.label1 = new System.Windows.Forms.Label();
			this.pbxHome = new System.Windows.Forms.PictureBox();
			this.pnlFinish = new System.Windows.Forms.Panel();
			this.label23 = new System.Windows.Forms.Label();
			this.pictureBox2 = new System.Windows.Forms.PictureBox();
			this.pnlFirst = new System.Windows.Forms.Panel();
			this.pnlFill_First = new System.Windows.Forms.Panel();
			this.dgQueue_First = new System.Windows.Forms.DataGrid();
			this.label13 = new System.Windows.Forms.Label();
			this.pbxCoverPage_BookDetail = new System.Windows.Forms.PictureBox();
			this.button1 = new System.Windows.Forms.Button();
			this.label25 = new System.Windows.Forms.Label();
			this.lblBookNameChn_First = new System.Windows.Forms.Label();
			this.lblBookNameEng_First = new System.Windows.Forms.Label();
			this.label20 = new System.Windows.Forms.Label();
			this.lblStatus_First = new System.Windows.Forms.Label();
			this.label16 = new System.Windows.Forms.Label();
			this.lblOwner_First = new System.Windows.Forms.Label();
			this.label4 = new System.Windows.Forms.Label();
			this.pnlTop_First = new System.Windows.Forms.Panel();
			this.label2 = new System.Windows.Forms.Label();
			this.pictureBox1 = new System.Windows.Forms.PictureBox();
			this.label3 = new System.Windows.Forms.Label();
			this.pnlSecond = new System.Windows.Forms.Panel();
			this.tbcMain_Second = new System.Windows.Forms.TabControl();
			this.tbpRequest = new System.Windows.Forms.TabPage();
			this.tbxMessage_Second = new System.Windows.Forms.TextBox();
			this.dtpPlanEndDate_Second = new System.Windows.Forms.DateTimePicker();
			this.dtpPlanBeginDate_Second = new System.Windows.Forms.DateTimePicker();
			this.label15 = new System.Windows.Forms.Label();
			this.label17 = new System.Windows.Forms.Label();
			this.label18 = new System.Windows.Forms.Label();
			this.cbbMobile_Second = new System.Windows.Forms.ComboBox();
			this.tbxRealName_Second = new System.Windows.Forms.TextBox();
			this.tbxUserName_Second = new System.Windows.Forms.TextBox();
			this.label7 = new System.Windows.Forms.Label();
			this.label8 = new System.Windows.Forms.Label();
			this.label9 = new System.Windows.Forms.Label();
			this.label10 = new System.Windows.Forms.Label();
			this.label11 = new System.Windows.Forms.Label();
			this.label12 = new System.Windows.Forms.Label();
			this.cbbEmail_Second = new System.Windows.Forms.ComboBox();
			this.cbbAddress_Second = new System.Windows.Forms.ComboBox();
			this.label14 = new System.Windows.Forms.Label();
			this.label19 = new System.Windows.Forms.Label();
			this.tbpPreview = new System.Windows.Forms.TabPage();
			this.tbxPreview_Second = new System.Windows.Forms.TextBox();
			this.pnlTop_Preview = new System.Windows.Forms.Panel();
			this.llbSave_Second = new System.Windows.Forms.LinkLabel();
			this.llbEdit_Second = new System.Windows.Forms.LinkLabel();
			this.llbRestore_Second = new System.Windows.Forms.LinkLabel();
			this.pnlTop_Second = new System.Windows.Forms.Panel();
			this.label5 = new System.Windows.Forms.Label();
			this.pbxPoint_Second = new System.Windows.Forms.PictureBox();
			this.label6 = new System.Windows.Forms.Label();
			this.pnlThird = new System.Windows.Forms.Panel();
			this.pnlFill_Third = new System.Windows.Forms.Panel();
			this.rtbMail = new System.Windows.Forms.RichTextBox();
			this.pnlTop_Third = new System.Windows.Forms.Panel();
			this.label21 = new System.Windows.Forms.Label();
			this.pbxPoint_Third = new System.Windows.Forms.PictureBox();
			this.label22 = new System.Windows.Forms.Label();
			this.pnlBottom.SuspendLayout();
			this.pnlHome.SuspendLayout();
			this.pnlFinish.SuspendLayout();
			this.pnlFirst.SuspendLayout();
			this.pnlFill_First.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.dgQueue_First)).BeginInit();
			this.pnlTop_First.SuspendLayout();
			this.pnlSecond.SuspendLayout();
			this.tbcMain_Second.SuspendLayout();
			this.tbpRequest.SuspendLayout();
			this.tbpPreview.SuspendLayout();
			this.pnlTop_Preview.SuspendLayout();
			this.pnlTop_Second.SuspendLayout();
			this.pnlThird.SuspendLayout();
			this.pnlFill_Third.SuspendLayout();
			this.pnlTop_Third.SuspendLayout();
			this.SuspendLayout();
			// 
			// pnlBottom
			// 
			this.pnlBottom.BackColor = System.Drawing.SystemColors.Control;
			this.pnlBottom.Controls.Add(this.btnFinish);
			this.pnlBottom.Controls.Add(this.btnSend);
			this.pnlBottom.Controls.Add(this.btnCancel);
			this.pnlBottom.Controls.Add(this.btnNext);
			this.pnlBottom.Controls.Add(this.btnPrev);
			this.pnlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
			this.pnlBottom.Location = new System.Drawing.Point(0, 350);
			this.pnlBottom.Name = "pnlBottom";
			this.pnlBottom.Size = new System.Drawing.Size(572, 44);
			this.pnlBottom.TabIndex = 1;
			// 
			// btnFinish
			// 
			this.btnFinish.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.btnFinish.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.btnFinish.Location = new System.Drawing.Point(484, 12);
			this.btnFinish.Name = "btnFinish";
			this.btnFinish.TabIndex = 4;
			this.btnFinish.Text = "完成";
			this.btnFinish.Visible = false;
			this.btnFinish.Click += new System.EventHandler(this.btnFinish_Click);
			// 
			// btnSend
			// 
			this.btnSend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.btnSend.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.btnSend.Location = new System.Drawing.Point(396, 12);
			this.btnSend.Name = "btnSend";
			this.btnSend.TabIndex = 3;
			this.btnSend.Text = "发送申请";
			this.btnSend.Visible = false;
			this.btnSend.Click += new System.EventHandler(this.btnSend_Click);
			// 
			// btnCancel
			// 
			this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.btnCancel.Location = new System.Drawing.Point(484, 12);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.TabIndex = 2;
			this.btnCancel.Text = "取消";
			this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
			// 
			// btnNext
			// 
			this.btnNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.btnNext.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.btnNext.Location = new System.Drawing.Point(396, 12);
			this.btnNext.Name = "btnNext";
			this.btnNext.TabIndex = 1;
			this.btnNext.Text = "下一步";
			this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
			// 
			// btnPrev
			// 
			this.btnPrev.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.btnPrev.Enabled = false;
			this.btnPrev.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.btnPrev.Location = new System.Drawing.Point(320, 12);
			this.btnPrev.Name = "btnPrev";
			this.btnPrev.TabIndex = 0;
			this.btnPrev.Text = "上一步";
			this.btnPrev.Click += new System.EventHandler(this.btnPrev_Click);
			// 
			// pnlHome
			// 
			this.pnlHome.BackColor = System.Drawing.SystemColors.Window;
			this.pnlHome.Controls.Add(this.label1);
			this.pnlHome.Controls.Add(this.pbxHome);
			this.pnlHome.Dock = System.Windows.Forms.DockStyle.Fill;
			this.pnlHome.Location = new System.Drawing.Point(0, 0);
			this.pnlHome.Name = "pnlHome";
			this.pnlHome.Size = new System.Drawing.Size(572, 350);
			this.pnlHome.TabIndex = 2;
			// 
			// label1
			// 
			this.label1.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label1.Location = new System.Drawing.Point(164, 36);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(240, 23);
			this.label1.TabIndex = 2;
			this.label1.Text = "本向导将帮助您完成申请借阅的全过程";
			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// pbxHome
			// 
			this.pbxHome.Dock = System.Windows.Forms.DockStyle.Left;
			this.pbxHome.Image = ((System.Drawing.Image)(resources.GetObject("pbxHome.Image")));
			this.pbxHome.Location = new System.Drawing.Point(0, 0);
			this.pbxHome.Name = "pbxHome";
			this.pbxHome.Size = new System.Drawing.Size(144, 350);
			this.pbxHome.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
			this.pbxHome.TabIndex = 1;
			this.pbxHome.TabStop = false;
			// 
			// pnlFinish
			// 
			this.pnlFinish.BackColor = System.Drawing.SystemColors.Window;
			this.pnlFinish.Controls.Add(this.label23);
			this.pnlFinish.Controls.Add(this.pictureBox2);
			this.pnlFinish.Dock = System.Windows.Forms.DockStyle.Fill;
			this.pnlFinish.Location = new System.Drawing.Point(0, 0);
			this.pnlFinish.Name = "pnlFinish";
			this.pnlFinish.Size = new System.Drawing.Size(572, 350);
			this.pnlFinish.TabIndex = 2;
			this.pnlFinish.Visible = false;
			// 
			// label23
			// 
			this.label23.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label23.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label23.Location = new System.Drawing.Point(180, 36);
			this.label23.Name = "label23";
			this.label23.Size = new System.Drawing.Size(240, 23);
			this.label23.TabIndex = 4;
			this.label23.Text = "完成！";
			this.label23.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// pictureBox2
			// 
			this.pictureBox2.Dock = System.Windows.Forms.DockStyle.Left;
			this.pictureBox2.Location = new System.Drawing.Point(0, 0);
			this.pictureBox2.Name = "pictureBox2";
			this.pictureBox2.Size = new System.Drawing.Size(144, 350);
			this.pictureBox2.TabIndex = 3;
			this.pictureBox2.TabStop = false;
			// 
			// pnlFirst
			// 
			this.pnlFirst.BackColor = System.Drawing.SystemColors.Control;
			this.pnlFirst.Controls.Add(this.pnlFill_First);
			this.pnlFirst.Controls.Add(this.pnlTop_First);
			this.pnlFirst.Dock = System.Windows.Forms.DockStyle.Fill;
			this.pnlFirst.Location = new System.Drawing.Point(0, 0);
			this.pnlFirst.Name = "pnlFirst";
			this.pnlFirst.Size = new System.Drawing.Size(572, 350);
			this.pnlFirst.TabIndex = 2;
			this.pnlFirst.Visible = false;
			// 
			// pnlFill_First
			// 
			this.pnlFill_First.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.pnlFill_First.Controls.Add(this.dgQueue_First);
			this.pnlFill_First.Controls.Add(this.label13);
			this.pnlFill_First.Controls.Add(this.pbxCoverPage_BookDetail);
			this.pnlFill_First.Controls.Add(this.button1);
			this.pnlFill_First.Controls.Add(this.label25);
			this.pnlFill_First.Controls.Add(this.lblBookNameChn_First);
			this.pnlFill_First.Controls.Add(this.lblBookNameEng_First);
			this.pnlFill_First.Controls.Add(this.label20);
			this.pnlFill_First.Controls.Add(this.lblStatus_First);
			this.pnlFill_First.Controls.Add(this.label16);
			this.pnlFill_First.Controls.Add(this.lblOwner_First);
			this.pnlFill_First.Controls.Add(this.label4);
			this.pnlFill_First.Dock = System.Windows.Forms.DockStyle.Fill;
			this.pnlFill_First.Location = new System.Drawing.Point(0, 64);
			this.pnlFill_First.Name = "pnlFill_First";
			this.pnlFill_First.Size = new System.Drawing.Size(572, 286);
			this.pnlFill_First.TabIndex = 1;
			// 
			// dgQueue_First
			// 
			this.dgQueue_First.BackgroundColor = System.Drawing.SystemColors.Window;
			this.dgQueue_First.CaptionVisible = false;
			this.dgQueue_First.DataMember = "";
			this.dgQueue_First.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dgQueue_First.Location = new System.Drawing.Point(136, 108);
			this.dgQueue_First.Name = "dgQueue_First";
			this.dgQueue_First.ReadOnly = true;
			this.dgQueue_First.Size = new System.Drawing.Size(416, 148);
			this.dgQueue_First.TabIndex = 94;
			// 
			// label13
			// 
			this.label13.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label13.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label13.Location = new System.Drawing.Point(136, 52);
			this.label13.Name = "label13";
			this.label13.Size = new System.Drawing.Size(60, 17);
			this.label13.TabIndex = 92;
			this.label13.Text = "所有者:";
			this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// pbxCoverPage_BookDetail
			// 
			this.pbxCoverPage_BookDetail.Image = ((System.Drawing.Image)(resources.GetObject("pbxCoverPage_BookDetail.Image")));
			this.pbxCoverPage_BookDetail.Location = new System.Drawing.Point(20, 20);
			this.pbxCoverPage_BookDetail.Name = "pbxCoverPage_BookDetail";
			this.pbxCoverPage_BookDetail.Size = new System.Drawing.Size(88, 110);
			this.pbxCoverPage_BookDetail.TabIndex = 90;
			this.pbxCoverPage_BookDetail.TabStop = false;
			// 
			// button1
			// 
			this.button1.Enabled = false;
			this.button1.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.button1.Image = ((System.Drawing.Image)(resources.GetObject("button1.Image")));
			this.button1.Location = new System.Drawing.Point(12, 12);
			this.button1.Name = "button1";
			this.button1.Size = new System.Drawing.Size(104, 128);
			this.button1.TabIndex = 89;
			// 
			// label25
			// 
			this.label25.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label25.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label25.Location = new System.Drawing.Point(136, 32);
			this.label25.Name = "label25";
			this.label25.Size = new System.Drawing.Size(60, 17);
			this.label25.TabIndex = 84;
			this.label25.Text = "英文书名:";
			this.label25.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// lblBookNameChn_First
			// 
			this.lblBookNameChn_First.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.lblBookNameChn_First.Location = new System.Drawing.Point(200, 12);
			this.lblBookNameChn_First.Name = "lblBookNameChn_First";
			this.lblBookNameChn_First.Size = new System.Drawing.Size(312, 16);
			this.lblBookNameChn_First.TabIndex = 83;
			this.lblBookNameChn_First.Text = "lblBookNameChn_First";
			this.lblBookNameChn_First.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// lblBookNameEng_First
			// 
			this.lblBookNameEng_First.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.lblBookNameEng_First.Location = new System.Drawing.Point(200, 32);
			this.lblBookNameEng_First.Name = "lblBookNameEng_First";
			this.lblBookNameEng_First.Size = new System.Drawing.Size(312, 16);
			this.lblBookNameEng_First.TabIndex = 82;
			this.lblBookNameEng_First.Text = "lblBookNameEng_First";
			this.lblBookNameEng_First.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label20
			// 
			this.label20.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label20.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label20.Location = new System.Drawing.Point(136, 12);
			this.label20.Name = "label20";
			this.label20.Size = new System.Drawing.Size(64, 17);
			this.label20.TabIndex = 79;
			this.label20.Text = "中文书名:";
			this.label20.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// lblStatus_First
			// 
			this.lblStatus_First.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.lblStatus_First.Location = new System.Drawing.Point(200, 72);
			this.lblStatus_First.Name = "lblStatus_First";
			this.lblStatus_First.Size = new System.Drawing.Size(176, 16);
			this.lblStatus_First.TabIndex = 93;
			this.lblStatus_First.Text = "lblStatus_First";
			this.lblStatus_First.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label16
			// 
			this.label16.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label16.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label16.Location = new System.Drawing.Point(136, 72);
			this.label16.Name = "label16";
			this.label16.Size = new System.Drawing.Size(60, 17);
			this.label16.TabIndex = 91;
			this.label16.Text = "当前状态:";
			this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// lblOwner_First
			// 
			this.lblOwner_First.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.lblOwner_First.Location = new System.Drawing.Point(200, 52);
			this.lblOwner_First.Name = "lblOwner_First";
			this.lblOwner_First.Size = new System.Drawing.Size(176, 16);
			this.lblOwner_First.TabIndex = 93;
			this.lblOwner_First.Text = "lblOwner_First";
			this.lblOwner_First.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label4
			// 
			this.label4.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label4.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label4.Location = new System.Drawing.Point(136, 92);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(96, 17);
			this.label4.TabIndex = 91;
			this.label4.Text = "申请借阅队列:";
			this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// pnlTop_First
			// 
			this.pnlTop_First.BackColor = System.Drawing.SystemColors.Window;
			this.pnlTop_First.Controls.Add(this.label2);
			this.pnlTop_First.Controls.Add(this.pictureBox1);
			this.pnlTop_First.Controls.Add(this.label3);
			this.pnlTop_First.Dock = System.Windows.Forms.DockStyle.Top;
			this.pnlTop_First.Location = new System.Drawing.Point(0, 0);
			this.pnlTop_First.Name = "pnlTop_First";
			this.pnlTop_First.Size = new System.Drawing.Size(572, 64);
			this.pnlTop_First.TabIndex = 0;
			// 
			// label2
			// 
			this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label2.Location = new System.Drawing.Point(16, 16);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(100, 16);
			this.label2.TabIndex = 1;
			this.label2.Text = "申请借阅的书籍";
			this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// pictureBox1
			// 
			this.pictureBox1.Anchor = System.Windows.Forms.AnchorStyles.Right;
			this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
			this.pictureBox1.Location = new System.Drawing.Point(504, 8);
			this.pictureBox1.Name = "pictureBox1";
			this.pictureBox1.Size = new System.Drawing.Size(48, 48);
			this.pictureBox1.TabIndex = 0;
			this.pictureBox1.TabStop = false;
			// 
			// label3
			// 
			this.label3.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label3.Location = new System.Drawing.Point(44, 36);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(256, 16);
			this.label3.TabIndex = 1;
			this.label3.Text = "以下是您想申请借阅的书籍及其当前借阅情况。";
			this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// pnlSecond
			// 
			this.pnlSecond.BackColor = System.Drawing.SystemColors.Control;
			this.pnlSecond.Controls.Add(this.tbcMain_Second);
			this.pnlSecond.Controls.Add(this.pnlTop_Second);
			this.pnlSecond.Dock = System.Windows.Forms.DockStyle.Fill;
			this.pnlSecond.Location = new System.Drawing.Point(0, 0);
			this.pnlSecond.Name = "pnlSecond";
			this.pnlSecond.Size = new System.Drawing.Size(572, 350);
			this.pnlSecond.TabIndex = 2;
			this.pnlSecond.Visible = false;
			// 
			// tbcMain_Second
			// 
			this.tbcMain_Second.Controls.Add(this.tbpRequest);
			this.tbcMain_Second.Controls.Add(this.tbpPreview);
			this.tbcMain_Second.Dock = System.Windows.Forms.DockStyle.Fill;
			this.tbcMain_Second.Location = new System.Drawing.Point(0, 64);
			this.tbcMain_Second.Name = "tbcMain_Second";
			this.tbcMain_Second.SelectedIndex = 0;
			this.tbcMain_Second.Size = new System.Drawing.Size(572, 286);
			this.tbcMain_Second.TabIndex = 2;
			this.tbcMain_Second.SelectedIndexChanged += new System.EventHandler(this.tbcMain_Second_SelectedIndexChanged);
			// 
			// tbpRequest
			// 
			this.tbpRequest.Controls.Add(this.tbxMessage_Second);
			this.tbpRequest.Controls.Add(this.dtpPlanEndDate_Second);
			this.tbpRequest.Controls.Add(this.dtpPlanBeginDate_Second);
			this.tbpRequest.Controls.Add(this.label15);
			this.tbpRequest.Controls.Add(this.label17);
			this.tbpRequest.Controls.Add(this.label18);
			this.tbpRequest.Controls.Add(this.cbbMobile_Second);
			this.tbpRequest.Controls.Add(this.tbxRealName_Second);
			this.tbpRequest.Controls.Add(this.tbxUserName_Second);
			this.tbpRequest.Controls.Add(this.label7);
			this.tbpRequest.Controls.Add(this.label8);
			this.tbpRequest.Controls.Add(this.label9);
			this.tbpRequest.Controls.Add(this.label10);
			this.tbpRequest.Controls.Add(this.label11);
			this.tbpRequest.Controls.Add(this.label12);
			this.tbpRequest.Controls.Add(this.cbbEmail_Second);
			this.tbpRequest.Controls.Add(this.cbbAddress_Second);
			this.tbpRequest.Controls.Add(this.label14);
			this.tbpRequest.Controls.Add(this.label19);
			this.tbpRequest.Location = new System.Drawing.Point(4, 21);
			this.tbpRequest.Name = "tbpRequest";
			this.tbpRequest.Size = new System.Drawing.Size(564, 261);
			this.tbpRequest.TabIndex = 0;
			this.tbpRequest.Text = "借阅";
			// 
			// tbxMessage_Second
			// 
			this.tbxMessage_Second.Location = new System.Drawing.Point(304, 150);
			this.tbxMessage_Second.MaxLength = 400;
			this.tbxMessage_Second.Multiline = true;
			this.tbxMessage_Second.Name = "tbxMessage_Second";
			this.tbxMessage_Second.Size = new System.Drawing.Size(240, 74);
			this.tbxMessage_Second.TabIndex = 11;
			this.tbxMessage_Second.Text = "希望您考虑一下我的借阅申请，谢谢！";
			// 
			// dtpPlanEndDate_Second
			// 
			this.dtpPlanEndDate_Second.Location = new System.Drawing.Point(392, 72);
			this.dtpPlanEndDate_Second.Name = "dtpPlanEndDate_Second";
			this.dtpPlanEndDate_Second.Size = new System.Drawing.Size(152, 21);
			this.dtpPlanEndDate_Second.TabIndex = 10;
			// 
			// dtpPlanBeginDate_Second
			// 
			this.dtpPlanBeginDate_Second.Location = new System.Drawing.Point(392, 46);
			this.dtpPlanBeginDate_Second.Name = "dtpPlanBeginDate_Second";
			this.dtpPlanBeginDate_Second.Size = new System.Drawing.Size(152, 21);
			this.dtpPlanBeginDate_Second.TabIndex = 9;
			// 
			// label15
			// 
			this.label15.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label15.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label15.Location = new System.Drawing.Point(304, 120);
			this.label15.Name = "label15";
			this.label15.Size = new System.Drawing.Size(100, 16);
			this.label15.TabIndex = 8;
			this.label15.Text = "留言:";
			this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label17
			// 
			this.label17.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label17.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label17.Location = new System.Drawing.Point(304, 48);
			this.label17.Name = "label17";
			this.label17.Size = new System.Drawing.Size(80, 16);
			this.label17.TabIndex = 6;
			this.label17.Text = "期望借书日期:";
			this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label18
			// 
			this.label18.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label18.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label18.Location = new System.Drawing.Point(304, 76);
			this.label18.Name = "label18";
			this.label18.Size = new System.Drawing.Size(80, 16);
			this.label18.TabIndex = 7;
			this.label18.Text = "期望归还日期:";
			this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// cbbMobile_Second
			// 
			this.cbbMobile_Second.ItemHeight = 12;
			this.cbbMobile_Second.Location = new System.Drawing.Point(112, 150);
			this.cbbMobile_Second.MaxLength = 50;
			this.cbbMobile_Second.Name = "cbbMobile_Second";
			this.cbbMobile_Second.Size = new System.Drawing.Size(152, 20);
			this.cbbMobile_Second.TabIndex = 5;
			// 
			// tbxRealName_Second
			// 
			this.tbxRealName_Second.Enabled = false;
			this.tbxRealName_Second.Location = new System.Drawing.Point(112, 72);
			this.tbxRealName_Second.MaxLength = 20;
			this.tbxRealName_Second.Name = "tbxRealName_Second";
			this.tbxRealName_Second.Size = new System.Drawing.Size(152, 21);
			this.tbxRealName_Second.TabIndex = 4;
			this.tbxRealName_Second.Text = "tbxRealName_Second";
			// 
			// tbxUserName_Second
			// 
			this.tbxUserName_Second.Enabled = false;
			this.tbxUserName_Second.Location = new System.Drawing.Point(112, 46);
			this.tbxUserName_Second.MaxLength = 20;
			this.tbxUserName_Second.Name = "tbxUserName_Second";
			this.tbxUserName_Second.Size = new System.Drawing.Size(152, 21);
			this.tbxUserName_Second.TabIndex = 3;
			this.tbxUserName_Second.Text = "tbxUserName_Second";
			// 
			// label7
			// 
			this.label7.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label7.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label7.Location = new System.Drawing.Point(24, 16);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(100, 16);
			this.label7.TabIndex = 2;
			this.label7.Text = "个人信息";
			this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label8
			// 
			this.label8.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label8.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label8.Location = new System.Drawing.Point(24, 48);
			this.label8.Name = "label8";
			this.label8.Size = new System.Drawing.Size(56, 16);
			this.label8.TabIndex = 1;
			this.label8.Text = "用户名:";
			this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label9
			// 
			this.label9.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label9.Location = new System.Drawing.Point(24, 76);
			this.label9.Name = "label9";
			this.label9.Size = new System.Drawing.Size(56, 16);
			this.label9.TabIndex = 1;
			this.label9.Text = "真实姓名:";
			this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label10
			// 
			this.label10.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label10.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label10.Location = new System.Drawing.Point(24, 152);
			this.label10.Name = "label10";
			this.label10.Size = new System.Drawing.Size(80, 16);
			this.label10.TabIndex = 1;
			this.label10.Text = "即时联系方式:";
			this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label11
			// 
			this.label11.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label11.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label11.Location = new System.Drawing.Point(24, 120);
			this.label11.Name = "label11";
			this.label11.Size = new System.Drawing.Size(100, 16);
			this.label11.TabIndex = 2;
			this.label11.Text = "联系方式";
			this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label12
			// 
			this.label12.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label12.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label12.Location = new System.Drawing.Point(24, 180);
			this.label12.Name = "label12";
			this.label12.Size = new System.Drawing.Size(80, 16);
			this.label12.TabIndex = 1;
			this.label12.Text = "固定联系方式:";
			this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// cbbEmail_Second
			// 
			this.cbbEmail_Second.ItemHeight = 12;
			this.cbbEmail_Second.Location = new System.Drawing.Point(112, 176);
			this.cbbEmail_Second.MaxLength = 50;
			this.cbbEmail_Second.Name = "cbbEmail_Second";
			this.cbbEmail_Second.Size = new System.Drawing.Size(152, 20);
			this.cbbEmail_Second.TabIndex = 5;
			// 
			// cbbAddress_Second
			// 
			this.cbbAddress_Second.ItemHeight = 12;
			this.cbbAddress_Second.Location = new System.Drawing.Point(112, 204);
			this.cbbAddress_Second.MaxLength = 50;
			this.cbbAddress_Second.Name = "cbbAddress_Second";
			this.cbbAddress_Second.Size = new System.Drawing.Size(152, 20);
			this.cbbAddress_Second.TabIndex = 5;
			// 
			// label14
			// 
			this.label14.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label14.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label14.Location = new System.Drawing.Point(24, 208);
			this.label14.Name = "label14";
			this.label14.Size = new System.Drawing.Size(80, 16);
			this.label14.TabIndex = 1;
			this.label14.Text = "地址:";
			this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label19
			// 
			this.label19.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label19.Location = new System.Drawing.Point(304, 16);
			this.label19.Name = "label19";
			this.label19.Size = new System.Drawing.Size(100, 16);
			this.label19.TabIndex = 8;
			this.label19.Text = "借阅时间";
			this.label19.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// tbpPreview
			// 
			this.tbpPreview.Controls.Add(this.tbxPreview_Second);
			this.tbpPreview.Controls.Add(this.pnlTop_Preview);
			this.tbpPreview.DockPadding.All = 4;
			this.tbpPreview.Location = new System.Drawing.Point(4, 21);
			this.tbpPreview.Name = "tbpPreview";
			this.tbpPreview.Size = new System.Drawing.Size(564, 261);
			this.tbpPreview.TabIndex = 1;
			this.tbpPreview.Text = "申请函预览";
			// 
			// tbxPreview_Second
			// 
			this.tbxPreview_Second.BackColor = System.Drawing.SystemColors.Window;
			this.tbxPreview_Second.Dock = System.Windows.Forms.DockStyle.Fill;
			this.tbxPreview_Second.Location = new System.Drawing.Point(4, 32);
			this.tbxPreview_Second.MaxLength = 3500;
			this.tbxPreview_Second.Multiline = true;
			this.tbxPreview_Second.Name = "tbxPreview_Second";
			this.tbxPreview_Second.ReadOnly = true;
			this.tbxPreview_Second.Size = new System.Drawing.Size(556, 225);
			this.tbxPreview_Second.TabIndex = 5;
			this.tbxPreview_Second.Text = "";
			// 
			// pnlTop_Preview
			// 
			this.pnlTop_Preview.Controls.Add(this.llbSave_Second);
			this.pnlTop_Preview.Controls.Add(this.llbEdit_Second);
			this.pnlTop_Preview.Controls.Add(this.llbRestore_Second);
			this.pnlTop_Preview.Dock = System.Windows.Forms.DockStyle.Top;
			this.pnlTop_Preview.Location = new System.Drawing.Point(4, 4);
			this.pnlTop_Preview.Name = "pnlTop_Preview";
			this.pnlTop_Preview.Size = new System.Drawing.Size(556, 28);
			this.pnlTop_Preview.TabIndex = 4;
			// 
			// llbSave_Second
			// 
			this.llbSave_Second.Enabled = false;
			this.llbSave_Second.Location = new System.Drawing.Point(40, 8);
			this.llbSave_Second.Name = "llbSave_Second";
			this.llbSave_Second.Size = new System.Drawing.Size(32, 16);
			this.llbSave_Second.TabIndex = 1;
			this.llbSave_Second.TabStop = true;
			this.llbSave_Second.Text = "完成";
			this.llbSave_Second.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llbSave_Second_LinkClicked);
			// 
			// llbEdit_Second
			// 
			this.llbEdit_Second.Location = new System.Drawing.Point(0, 8);
			this.llbEdit_Second.Name = "llbEdit_Second";
			this.llbEdit_Second.Size = new System.Drawing.Size(32, 16);
			this.llbEdit_Second.TabIndex = 0;
			this.llbEdit_Second.TabStop = true;
			this.llbEdit_Second.Text = "编辑";
			this.llbEdit_Second.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llbEdit_Second_LinkClicked);
			// 
			// llbRestore_Second
			// 
			this.llbRestore_Second.Location = new System.Drawing.Point(80, 8);
			this.llbRestore_Second.Name = "llbRestore_Second";
			this.llbRestore_Second.Size = new System.Drawing.Size(56, 16);
			this.llbRestore_Second.TabIndex = 1;
			this.llbRestore_Second.TabStop = true;
			this.llbRestore_Second.Text = "重新生成";
			this.llbRestore_Second.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llbRestore_Second_LinkClicked);
			// 
			// pnlTop_Second
			// 
			this.pnlTop_Second.BackColor = System.Drawing.SystemColors.Window;
			this.pnlTop_Second.Controls.Add(this.label5);
			this.pnlTop_Second.Controls.Add(this.pbxPoint_Second);
			this.pnlTop_Second.Controls.Add(this.label6);
			this.pnlTop_Second.Dock = System.Windows.Forms.DockStyle.Top;
			this.pnlTop_Second.Location = new System.Drawing.Point(0, 0);
			this.pnlTop_Second.Name = "pnlTop_Second";
			this.pnlTop_Second.Size = new System.Drawing.Size(572, 64);
			this.pnlTop_Second.TabIndex = 1;
			// 
			// label5
			// 
			this.label5.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label5.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label5.Location = new System.Drawing.Point(16, 16);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(100, 16);
			this.label5.TabIndex = 1;
			this.label5.Text = "书籍借阅申请函";
			this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// pbxPoint_Second
			// 
			this.pbxPoint_Second.Anchor = System.Windows.Forms.AnchorStyles.Right;
			this.pbxPoint_Second.Image = ((System.Drawing.Image)(resources.GetObject("pbxPoint_Second.Image")));
			this.pbxPoint_Second.Location = new System.Drawing.Point(504, 8);
			this.pbxPoint_Second.Name = "pbxPoint_Second";
			this.pbxPoint_Second.Size = new System.Drawing.Size(48, 48);
			this.pbxPoint_Second.TabIndex = 0;
			this.pbxPoint_Second.TabStop = false;
			// 
			// label6
			// 
			this.label6.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label6.Location = new System.Drawing.Point(44, 36);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(256, 16);
			this.label6.TabIndex = 1;
			this.label6.Text = "编辑借阅申请信息，并生成申请函。";
			this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// pnlThird
			// 
			this.pnlThird.BackColor = System.Drawing.SystemColors.Control;
			this.pnlThird.Controls.Add(this.pnlFill_Third);
			this.pnlThird.Controls.Add(this.pnlTop_Third);
			this.pnlThird.Dock = System.Windows.Forms.DockStyle.Fill;
			this.pnlThird.Location = new System.Drawing.Point(0, 0);
			this.pnlThird.Name = "pnlThird";
			this.pnlThird.Size = new System.Drawing.Size(572, 350);
			this.pnlThird.TabIndex = 2;
			this.pnlThird.Visible = false;
			// 
			// pnlFill_Third
			// 
			this.pnlFill_Third.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.pnlFill_Third.Controls.Add(this.rtbMail);
			this.pnlFill_Third.Dock = System.Windows.Forms.DockStyle.Fill;
			this.pnlFill_Third.DockPadding.All = 4;
			this.pnlFill_Third.Location = new System.Drawing.Point(0, 64);
			this.pnlFill_Third.Name = "pnlFill_Third";
			this.pnlFill_Third.Size = new System.Drawing.Size(572, 286);
			this.pnlFill_Third.TabIndex = 3;
			// 
			// rtbMail
			// 
			this.rtbMail.BorderStyle = System.Windows.Forms.BorderStyle.None;
			this.rtbMail.Dock = System.Windows.Forms.DockStyle.Fill;
			this.rtbMail.Location = new System.Drawing.Point(4, 4);
			this.rtbMail.MaxLength = 3500;
			this.rtbMail.Name = "rtbMail";
			this.rtbMail.ReadOnly = true;
			this.rtbMail.Size = new System.Drawing.Size(562, 276);
			this.rtbMail.TabIndex = 0;
			this.rtbMail.Text = "";
			// 
			// pnlTop_Third
			// 
			this.pnlTop_Third.BackColor = System.Drawing.SystemColors.Window;
			this.pnlTop_Third.Controls.Add(this.label21);
			this.pnlTop_Third.Controls.Add(this.pbxPoint_Third);
			this.pnlTop_Third.Controls.Add(this.label22);
			this.pnlTop_Third.Dock = System.Windows.Forms.DockStyle.Top;
			this.pnlTop_Third.Location = new System.Drawing.Point(0, 0);
			this.pnlTop_Third.Name = "pnlTop_Third";
			this.pnlTop_Third.Size = new System.Drawing.Size(572, 64);
			this.pnlTop_Third.TabIndex = 2;
			// 
			// label21
			// 
			this.label21.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label21.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label21.Location = new System.Drawing.Point(16, 16);
			this.label21.Name = "label21";
			this.label21.Size = new System.Drawing.Size(100, 16);
			this.label21.TabIndex = 1;
			this.label21.Text = "发出申请函";
			this.label21.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// pbxPoint_Third
			// 
			this.pbxPoint_Third.Anchor = System.Windows.Forms.AnchorStyles.Right;
			this.pbxPoint_Third.Image = ((System.Drawing.Image)(resources.GetObject("pbxPoint_Third.Image")));
			this.pbxPoint_Third.Location = new System.Drawing.Point(504, 8);
			this.pbxPoint_Third.Name = "pbxPoint_Third";
			this.pbxPoint_Third.Size = new System.Drawing.Size(48, 48);
			this.pbxPoint_Third.TabIndex = 0;
			this.pbxPoint_Third.TabStop = false;
			// 
			// label22
			// 
			this.label22.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label22.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label22.Location = new System.Drawing.Point(44, 32);
			this.label22.Name = "label22";
			this.label22.Size = new System.Drawing.Size(396, 16);
			this.label22.TabIndex = 1;
			this.label22.Text = "以下是您的借阅申请的全部内容，按“发送申请”，完成借阅申请过程。";
			this.label22.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// RequestFrm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.SystemColors.Control;
			this.CancelButton = this.btnCancel;
			this.ClientSize = new System.Drawing.Size(572, 394);
			this.Controls.Add(this.pnlHome);
			this.Controls.Add(this.pnlSecond);
			this.Controls.Add(this.pnlFirst);
			this.Controls.Add(this.pnlThird);
			this.Controls.Add(this.pnlFinish);
			this.Controls.Add(this.pnlBottom);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.MaximizeBox = false;
			this.Name = "RequestFrm";
			this.Text = "RequestFrm";
			this.Load += new System.EventHandler(this.RequestFrm_Load);
			this.pnlBottom.ResumeLayout(false);
			this.pnlHome.ResumeLayout(false);
			this.pnlFinish.ResumeLayout(false);
			this.pnlFirst.ResumeLayout(false);
			this.pnlFill_First.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dgQueue_First)).EndInit();
			this.pnlTop_First.ResumeLayout(false);
			this.pnlSecond.ResumeLayout(false);
			this.tbcMain_Second.ResumeLayout(false);
			this.tbpRequest.ResumeLayout(false);
			this.tbpPreview.ResumeLayout(false);
			this.pnlTop_Preview.ResumeLayout(false);
			this.pnlTop_Second.ResumeLayout(false);
			this.pnlThird.ResumeLayout(false);
			this.pnlFill_Third.ResumeLayout(false);
			this.pnlTop_Third.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		#endregion

		#region 自定义方法
		/// <summary>
		/// 隐藏panelOld，并显示panelNew
		/// </summary>
		/// <param name="panelNew"></param>
		/// <param name="panelOld"></param>
		private void panel_switch(System.Windows.Forms.Panel panelNew, System.Windows.Forms.Panel panelOld)
		{
			if(panelOld!=null && panelOld.Visible)
			{
				panelOld.Visible = false;
			}
			if(panelNew!=null && !panelNew.Visible)
			{
				panelNew.Visible = true;
			}
		}

		/// <summary>
		/// 按用户输入的信息，生成申请函
		/// </summary>
		/// <param name="tbx"></param>
		private void preview_gen(System.Windows.Forms.TextBox tbx)
		{
			// 填充tbx.Text
			//tbx.Text = "hellow, preview!\nhellow, preview!\n";
			tbx.Text = 
				generateText(
				this.lblOwner_First.Text,
				this.m_curUserInfo.UserName,
				this.m_curBookInfo.BookNameChn,
				this.m_curBookInfo.BookNameEng,
				this.tbxMessage_Second.Text,
				this.dtpPlanBeginDate_Second.Value.ToLongDateString(),
				this.dtpPlanEndDate_Second.Value.ToLongDateString()
				);

		}
		/// <summary>
		/// 初始化，主要是载入一些内容
		/// </summary>
		private void initStep()
		{
			//step 1
			beforeStepOne();
			//step 2
			beforeStepTwo();
			//step 3
			preview_gen(this.tbxPreview_Second);
			//step 4
			generateFinalPreview();
		}
		/// <summary>
		/// 显示申请者队列
		/// </summary>
		private void beforeStepOne()
		{
			DataSet ds = this.m_dataSvc.GetBookCurrentShareInfo(this.m_authTicket,this.m_curBookInfo.ID);

			this.dgQueue_First.TableStyles.Clear();
			this.dgQueue_First.TableStyles.Add(TableStyleGenerator.GetStyleForShareInfo());
			this.dgQueue_First.DataSource = ds.Tables[0].DefaultView;
		
			this.lblBookNameChn_First.Text = this.m_curBookInfo.BookNameChn;
			this.lblBookNameEng_First.Text = this.m_curBookInfo.BookNameEng;
			if(ds.Tables[0].Rows.Count>0)
			{
				this.lblOwner_First.Text = ds.Tables[0].Rows[0]["ShareFrom"].ToString();
				this.lblStatus_First.Text = this.m_curBookInfo.Status;
			}
			else
			{
				DataSetUserInfo dsUserInfo = this.m_dataSvc.GetUserDetailInfo(this.m_authTicket,this.m_curBookInfo.Owner);
				this.lblOwner_First.Text = dsUserInfo.USER_INFO[0].RealName;
				this.lblStatus_First.Text = "空闲";
				this.dgQueue_First.Visible = false;
				// the label whose content is "申请借阅列表"
				this.label4.Visible = false;
			}
		}
		private string generateText(string owner, string me, string bookchnn, string bookeng, string msg, string startDate, string returnDate)
		{
			string original = "Dear [@owner]：\r\n"
				+"    您好！\r\n"
				+"我是 [@me] 网友，我希望在[@startDate]到[@returnDate]能够借阅您的书籍：\r\n"
				+"《 [@bookchnn]([@bookeng]) 》\r\n"
				+"[@msg]\r\n感谢您对社区作出的贡献！\r\n谢谢！\r\nYours,\r\n[@me]";

			original = original.Replace("[@owner]",owner);
			original = original.Replace("[@me]",me);
			original = original.Replace("[@bookchnn]",bookchnn);
			original = original.Replace("[@bookeng]",bookeng);
			original = original.Replace("[@msg]",msg);
			original = original.Replace("[@startDate]",startDate);
			original = original.Replace("[@returnDate]",returnDate);

			return original;
		}
		/// <summary>
		/// 填充与选择个人信息，并生成申请函
		/// </summary>
		private void beforeStepTwo()
		{
			this.cbbAddress_Second.Items.AddRange(new object[]{
																  this.m_curUserInfo.Address
																  ,this.m_curUserInfo.CompanyAddress
															  });
			this.cbbEmail_Second.Items.Add(this.m_curUserInfo.Email);
			this.cbbMobile_Second.Items.AddRange(new object[]{
																 this.m_curUserInfo.MobilePhone
																 ,this.m_curUserInfo.HomePhone
																 ,this.m_curUserInfo.WorkPhone
															 });

			this.cbbAddress_Second.SelectedIndex = 0;
			this.cbbEmail_Second.SelectedIndex = 0;
			this.cbbMobile_Second.SelectedIndex = 0;

			//this.tbxMessage_Second.Text = 
			this.tbxRealName_Second.Text = this.m_curUserInfo.RealName;
			this.tbxUserName_Second.Text = this.m_curUserInfo.UserName;
		}
		/// <summary>
		/// 生成申请函的最后预览
		/// </summary>
		private void generateFinalPreview()
		{
			string content = this.tbxPreview_Second.Text;
			content+="\r\n"+"----------------"
				+"\r\n"+"申请人信息:"
				+"\r\n"+"RealName："+this.m_curUserInfo.RealName
				+"\r\n"+"UserName："+this.m_curUserInfo.UserName
				+"\r\n"+"Address："+this.m_curUserInfo.Address
				+"\r\n"+"CompanyAddress："+this.m_curUserInfo.CompanyAddress
				+"\r\n"+"HomePhone："+this.m_curUserInfo.HomePhone
				+"\r\n"+"Credit：("+this.m_curUserInfo.Credit+"/5)";

			this.rtbMail.Text = content;
		}
		#endregion

		private void btnCancel_Click(object sender, System.EventArgs e)
		{
			//关闭窗口
			this.Close();
		}

		private void btnNext_Click(object sender, System.EventArgs e)
		{
			switch(this.stage)
			{
				case 0://pnlHome->pnlFirst
					this.btnPrev.Enabled = true;
					this.panel_switch(this.pnlFirst, this.pnlHome);
					this.stage = 1;
					break;
				case 1://pnlFirst->pnlSecond
					this.panel_switch(this.pnlSecond, this.pnlFirst);
					this.stage = 2;
					preview_gen(this.tbxPreview_Second);
					break;
				case 2://pnlSecond->pnlThird
					if(this.dtpPlanEndDate_Second.Value < this.dtpPlanBeginDate_Second.Value)
					{
						MessageBox.Show("请注意，归还日期应该晚于借阅日期","数据填写有误");
						return;
					}
					preview_gen(this.tbxPreview_Second);
					this.panel_switch(this.pnlThird, this.pnlSecond);
					this.btnNext.Visible = false;
					this.btnSend.Visible = true;
					this.stage = 3;

					//在rtbMail中生成最终有图片的申请函
					generateFinalPreview();

					break;
			}
					
		}

		private void btnPrev_Click(object sender, System.EventArgs e)
		{
			switch(this.stage)
			{
				case 1://pnlHome<-pnlFirst
					this.btnPrev.Enabled = false;
					this.panel_switch(this.pnlHome, this.pnlFirst);
					this.stage = 0;
					break;
				case 2://pnlFirst<-pnlSecond
					this.panel_switch(this.pnlFirst, this.pnlSecond);
					this.stage = 1;
					break;
				case 3://pnlSecond<-pnlThird
					this.panel_switch(this.pnlSecond, this.pnlThird);
					this.btnNext.Visible = true;
					this.btnSend.Visible = false;
					this.stage = 2;
					break;
			}
		
		}

		private void llbEdit_Second_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
		{
			//调整linklabel的可用性
			this.llbEdit_Second.Enabled = false;
			this.llbSave_Second.Enabled = true;

			//使tbsPreview可编辑
			this.tbxPreview_Second.ReadOnly = false;
		}

		private void llbSave_Second_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
		{
			//调整linklabel的可用性
			this.llbSave_Second.Enabled = false;			
			this.llbEdit_Second.Enabled = true;

			//使tbsPreview不可编辑
			this.tbxPreview_Second.ReadOnly = true;
		}

		private void llbRestore_Second_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
		{
			//调整linklabel的可用性
			this.llbSave_Second.Enabled = false;			
			this.llbEdit_Second.Enabled = true;

			//重新生成tbsPreview.text
			this.preview_gen(this.tbxPreview_Second);
		}

		private void tbcMain_Second_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			//当选中preview页，则生成申请函
			if(this.tbcMain_Second.SelectedIndex == 1)
			{
				//如果tbxPreview已有内容，则说明用户已作过修改，那么不再重新生成
				if(this.tbxPreview_Second.Text==null || this.tbxPreview_Second.Text=="")
				{
					this.preview_gen(this.tbxPreview_Second);
				}
			}
		
		}

		private void btnSend_Click(object sender, System.EventArgs e)
		{
			//加入SHARE_INFO
			DataSetShareInfo.SHARE_INFORow rowInfo = m_dsShareInfo.SHARE_INFO.NewSHARE_INFORow();
			rowInfo.Book = this.m_curBookInfo.ID;
			rowInfo.PlanBeginDate = this.dtpPlanBeginDate_Second.Value;
			rowInfo.PlanEndDate = this.dtpPlanEndDate_Second.Value;
			rowInfo.ShareFrom = this.m_curBookInfo.Owner;
			rowInfo.ShareTo = this.m_curUserInfo.ID;
			rowInfo.Status = Enum.GetName(typeof(ShareInfoStatusTypeEnum),ShareInfoStatusTypeEnum.REQUEST);

			//这里设置一个随机数，然后赋值给message，在主窗口的后台数据库更新工作线程将会将两者绑定。
			Random random = new Random();
			rowInfo.ID = -random.Next();

			m_dsShareInfo.SHARE_INFO.AddSHARE_INFORow(rowInfo);

			//投递申请函
			DataSetMessage.MESSAGE_INFORow row = this.m_dsMessage.MESSAGE_INFO.NewMESSAGE_INFORow();
			row.Body = this.rtbMail.Text;
			row.MessageFrom = this.m_curUserInfo.ID;
			row.MessageTo = this.m_curBookInfo.Owner;
			row.MessageType = Enum.GetName(typeof(MessageTypeEnum),MessageTypeEnum.REQUEST);
			row.Title = "申请借阅"+this.m_curBookInfo.BookNameChn+"("+this.m_curBookInfo.BookNameEng+")";
			row.HasRead = 0;
			row.SendDate = DateTime.Today;
			row.ShareInfo = rowInfo.ID;

			this.m_dsMessage.MESSAGE_INFO.AddMESSAGE_INFORow(row);
			
			//转到完成页面
			this.panel_switch(this.pnlFinish, this.pnlThird);
			this.btnPrev.Visible = false;
			this.btnSend.Visible = false;
			this.btnCancel.Visible = false;
			this.btnFinish.Visible = true;
			this.stage = 4;
		}

		private void btnFinish_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void RequestFrm_Load(object sender, System.EventArgs e)
		{
			this.btnNext.Enabled = false;
			initStep();
			this.btnNext.Enabled = true;
		}


	}
}
