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>
	/// UserDetailFrm 的摘要说明。
	/// </summary>
	public class UserDetailFrm : System.Windows.Forms.Form
	{
		private System.ComponentModel.IContainer components;
		private System.Windows.Forms.ToolBar tbrMain;
		private System.Windows.Forms.ToolBarButton tbbCancel;
		internal System.Windows.Forms.ImageList ilToolbar;
		private System.Windows.Forms.Label lblCompany_UserDetail;
		private System.Windows.Forms.Label lblCompanyAddress_UserDetail;
		private System.Windows.Forms.Label lblHomePhone_UserDetail;
		private System.Windows.Forms.Label lblWorkPhone_UserDetail;
		private System.Windows.Forms.Label lblMobilePhone_UserDetail;
		private System.Windows.Forms.Label label10;
		private System.Windows.Forms.Label label9;
		private System.Windows.Forms.Label label8;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.ImageList ilRatingIcon;
		private System.Windows.Forms.Label lblRealName_UserDetail;
		private System.Windows.Forms.Label lblUserName_UserDetail;
		private System.Windows.Forms.Label lblAddress_UserDetail;
		private System.Windows.Forms.Label lblEmail_UserDetail;
		private System.Windows.Forms.PictureBox pbxCredit;

		#region 自定义字段
		private MainFrm frmMain;
		private int CurrentSelectedID;
		#endregion

		#region 窗体的创建和销毁

		public UserDetailFrm(MainFrm form, int id)
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
			this.frmMain = form;
			this.CurrentSelectedID = id;
		}
		/// <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()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(UserDetailFrm));
			this.tbrMain = new System.Windows.Forms.ToolBar();
			this.tbbCancel = new System.Windows.Forms.ToolBarButton();
			this.ilToolbar = new System.Windows.Forms.ImageList(this.components);
			this.lblCompany_UserDetail = new System.Windows.Forms.Label();
			this.lblRealName_UserDetail = new System.Windows.Forms.Label();
			this.lblUserName_UserDetail = new System.Windows.Forms.Label();
			this.lblAddress_UserDetail = new System.Windows.Forms.Label();
			this.lblCompanyAddress_UserDetail = new System.Windows.Forms.Label();
			this.lblHomePhone_UserDetail = new System.Windows.Forms.Label();
			this.lblWorkPhone_UserDetail = new System.Windows.Forms.Label();
			this.lblMobilePhone_UserDetail = new System.Windows.Forms.Label();
			this.lblEmail_UserDetail = new System.Windows.Forms.Label();
			this.pbxCredit = new System.Windows.Forms.PictureBox();
			this.label10 = new System.Windows.Forms.Label();
			this.label9 = new System.Windows.Forms.Label();
			this.label8 = new System.Windows.Forms.Label();
			this.label4 = new System.Windows.Forms.Label();
			this.label7 = new System.Windows.Forms.Label();
			this.label6 = new System.Windows.Forms.Label();
			this.label5 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.label1 = new System.Windows.Forms.Label();
			this.ilRatingIcon = new System.Windows.Forms.ImageList(this.components);
			this.SuspendLayout();
			// 
			// tbrMain
			// 
			this.tbrMain.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
			this.tbrMain.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
																					   this.tbbCancel});
			this.tbrMain.ButtonSize = new System.Drawing.Size(53, 22);
			this.tbrMain.DropDownArrows = true;
			this.tbrMain.ImageList = this.ilToolbar;
			this.tbrMain.Location = new System.Drawing.Point(0, 0);
			this.tbrMain.Name = "tbrMain";
			this.tbrMain.ShowToolTips = true;
			this.tbrMain.Size = new System.Drawing.Size(536, 36);
			this.tbrMain.TabIndex = 6;
			this.tbrMain.TextAlign = System.Windows.Forms.ToolBarTextAlign.Right;
			this.tbrMain.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tbrMain_ButtonClick);
			// 
			// tbbCancel
			// 
			this.tbbCancel.ImageIndex = 0;
			this.tbbCancel.Text = "关闭";
			// 
			// ilToolbar
			// 
			this.ilToolbar.ImageSize = new System.Drawing.Size(24, 24);
			this.ilToolbar.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ilToolbar.ImageStream")));
			this.ilToolbar.TransparentColor = System.Drawing.Color.White;
			// 
			// lblCompany_UserDetail
			// 
			this.lblCompany_UserDetail.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.lblCompany_UserDetail.Location = new System.Drawing.Point(80, 176);
			this.lblCompany_UserDetail.Name = "lblCompany_UserDetail";
			this.lblCompany_UserDetail.Size = new System.Drawing.Size(136, 16);
			this.lblCompany_UserDetail.TabIndex = 54;
			this.lblCompany_UserDetail.Text = "Company";
			this.lblCompany_UserDetail.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// lblRealName_UserDetail
			// 
			this.lblRealName_UserDetail.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.lblRealName_UserDetail.Location = new System.Drawing.Point(80, 80);
			this.lblRealName_UserDetail.Name = "lblRealName_UserDetail";
			this.lblRealName_UserDetail.Size = new System.Drawing.Size(136, 16);
			this.lblRealName_UserDetail.TabIndex = 53;
			this.lblRealName_UserDetail.Text = "RealName";
			this.lblRealName_UserDetail.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// lblUserName_UserDetail
			// 
			this.lblUserName_UserDetail.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.lblUserName_UserDetail.Location = new System.Drawing.Point(80, 56);
			this.lblUserName_UserDetail.Name = "lblUserName_UserDetail";
			this.lblUserName_UserDetail.Size = new System.Drawing.Size(136, 16);
			this.lblUserName_UserDetail.TabIndex = 52;
			this.lblUserName_UserDetail.Text = "UserName";
			this.lblUserName_UserDetail.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// lblAddress_UserDetail
			// 
			this.lblAddress_UserDetail.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.lblAddress_UserDetail.Location = new System.Drawing.Point(80, 128);
			this.lblAddress_UserDetail.Name = "lblAddress_UserDetail";
			this.lblAddress_UserDetail.Size = new System.Drawing.Size(440, 16);
			this.lblAddress_UserDetail.TabIndex = 51;
			this.lblAddress_UserDetail.Text = "Address";
			this.lblAddress_UserDetail.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// lblCompanyAddress_UserDetail
			// 
			this.lblCompanyAddress_UserDetail.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.lblCompanyAddress_UserDetail.Location = new System.Drawing.Point(80, 192);
			this.lblCompanyAddress_UserDetail.Name = "lblCompanyAddress_UserDetail";
			this.lblCompanyAddress_UserDetail.Size = new System.Drawing.Size(440, 16);
			this.lblCompanyAddress_UserDetail.TabIndex = 50;
			this.lblCompanyAddress_UserDetail.Text = "CompanyAddress";
			this.lblCompanyAddress_UserDetail.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// lblHomePhone_UserDetail
			// 
			this.lblHomePhone_UserDetail.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.lblHomePhone_UserDetail.Location = new System.Drawing.Point(80, 144);
			this.lblHomePhone_UserDetail.Name = "lblHomePhone_UserDetail";
			this.lblHomePhone_UserDetail.Size = new System.Drawing.Size(136, 16);
			this.lblHomePhone_UserDetail.TabIndex = 49;
			this.lblHomePhone_UserDetail.Text = "HomePhone";
			this.lblHomePhone_UserDetail.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// lblWorkPhone_UserDetail
			// 
			this.lblWorkPhone_UserDetail.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.lblWorkPhone_UserDetail.Location = new System.Drawing.Point(80, 208);
			this.lblWorkPhone_UserDetail.Name = "lblWorkPhone_UserDetail";
			this.lblWorkPhone_UserDetail.Size = new System.Drawing.Size(224, 16);
			this.lblWorkPhone_UserDetail.TabIndex = 48;
			this.lblWorkPhone_UserDetail.Text = "WorkPhone";
			this.lblWorkPhone_UserDetail.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// lblMobilePhone_UserDetail
			// 
			this.lblMobilePhone_UserDetail.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.lblMobilePhone_UserDetail.Location = new System.Drawing.Point(80, 96);
			this.lblMobilePhone_UserDetail.Name = "lblMobilePhone_UserDetail";
			this.lblMobilePhone_UserDetail.Size = new System.Drawing.Size(232, 16);
			this.lblMobilePhone_UserDetail.TabIndex = 47;
			this.lblMobilePhone_UserDetail.Text = "MobilePhone";
			this.lblMobilePhone_UserDetail.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// lblEmail_UserDetail
			// 
			this.lblEmail_UserDetail.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.lblEmail_UserDetail.Location = new System.Drawing.Point(376, 96);
			this.lblEmail_UserDetail.Name = "lblEmail_UserDetail";
			this.lblEmail_UserDetail.Size = new System.Drawing.Size(144, 16);
			this.lblEmail_UserDetail.TabIndex = 46;
			this.lblEmail_UserDetail.Text = "Email";
			this.lblEmail_UserDetail.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// pbxCredit
			// 
			this.pbxCredit.Location = new System.Drawing.Point(368, 56);
			this.pbxCredit.Name = "pbxCredit";
			this.pbxCredit.Size = new System.Drawing.Size(64, 12);
			this.pbxCredit.TabIndex = 45;
			this.pbxCredit.TabStop = false;
			// 
			// label10
			// 
			this.label10.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label10.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label10.Location = new System.Drawing.Point(312, 56);
			this.label10.Name = "label10";
			this.label10.Size = new System.Drawing.Size(48, 17);
			this.label10.TabIndex = 44;
			this.label10.Text = "信用度:";
			this.label10.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.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label9.Location = new System.Drawing.Point(16, 192);
			this.label9.Name = "label9";
			this.label9.Size = new System.Drawing.Size(60, 17);
			this.label9.TabIndex = 43;
			this.label9.Text = "公司地址:";
			this.label9.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.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label8.Location = new System.Drawing.Point(16, 176);
			this.label8.Name = "label8";
			this.label8.Size = new System.Drawing.Size(48, 17);
			this.label8.TabIndex = 42;
			this.label8.Text = "公司:";
			this.label8.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(312, 96);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(60, 17);
			this.label4.TabIndex = 41;
			this.label4.Text = "电子邮件:";
			this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// 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(16, 208);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(60, 17);
			this.label7.TabIndex = 40;
			this.label7.Text = "工作电话:";
			this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label6
			// 
			this.label6.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label6.Location = new System.Drawing.Point(16, 144);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(60, 17);
			this.label6.TabIndex = 39;
			this.label6.Text = "家庭电话:";
			this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// 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, 128);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(48, 17);
			this.label5.TabIndex = 38;
			this.label5.Text = "地址:";
			this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label3
			// 
			this.label3.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label3.Location = new System.Drawing.Point(16, 80);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(60, 17);
			this.label3.TabIndex = 37;
			this.label3.Text = "真实姓名:";
			this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// 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, 96);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(60, 17);
			this.label2.TabIndex = 36;
			this.label2.Text = "移动电话:";
			this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// 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(16, 56);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(48, 17);
			this.label1.TabIndex = 35;
			this.label1.Text = "用户名:";
			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// ilRatingIcon
			// 
			this.ilRatingIcon.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
			this.ilRatingIcon.ImageSize = new System.Drawing.Size(64, 12);
			this.ilRatingIcon.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ilRatingIcon.ImageStream")));
			this.ilRatingIcon.TransparentColor = System.Drawing.Color.Transparent;
			// 
			// UserDetailFrm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(216)), ((System.Byte)(228)), ((System.Byte)(248)));
			this.ClientSize = new System.Drawing.Size(536, 366);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.label7);
			this.Controls.Add(this.lblCompany_UserDetail);
			this.Controls.Add(this.lblRealName_UserDetail);
			this.Controls.Add(this.lblUserName_UserDetail);
			this.Controls.Add(this.lblAddress_UserDetail);
			this.Controls.Add(this.lblCompanyAddress_UserDetail);
			this.Controls.Add(this.lblHomePhone_UserDetail);
			this.Controls.Add(this.lblWorkPhone_UserDetail);
			this.Controls.Add(this.lblMobilePhone_UserDetail);
			this.Controls.Add(this.lblEmail_UserDetail);
			this.Controls.Add(this.pbxCredit);
			this.Controls.Add(this.label10);
			this.Controls.Add(this.label9);
			this.Controls.Add(this.label8);
			this.Controls.Add(this.label4);
			this.Controls.Add(this.label6);
			this.Controls.Add(this.label5);
			this.Controls.Add(this.label3);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.tbrMain);
			this.Name = "UserDetailFrm";
			this.Text = "UserDetailFrm";
			this.Load += new System.EventHandler(this.UserDetailFrm_Load);
			this.ResumeLayout(false);

		}
		#endregion

		#endregion

		#region 自定义方法
		#endregion

		private void tbrMain_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
		{
			switch(this.tbrMain.Buttons.IndexOf(e.Button))
			{
				case 0://关闭
					this.Close();
					break;
			}
		}

		private void UserDetailFrm_Load(object sender, System.EventArgs e)
		{
			DataSetUserInfo.USER_INFORow row = this.frmMain.DsUserInfo.USER_INFO.FindByID(this.CurrentSelectedID);
			if(row == null)
				return;//error!

			this.lblAddress_UserDetail.Text = row["Address"] as string;
			this.lblCompany_UserDetail.Text = row["Company"] as string;
			this.lblCompanyAddress_UserDetail.Text = row["CompanyAddress"] as string;
			this.lblEmail_UserDetail.Text = row["Email"] as string;
			this.lblHomePhone_UserDetail.Text = row["HomePhone"] as string;
			this.lblMobilePhone_UserDetail.Text = row["MobilePhone"] as string;
			this.lblRealName_UserDetail.Text = row["RealName"] as string;
			this.lblUserName_UserDetail.Text = row["UserName"] as string;
			this.lblWorkPhone_UserDetail.Text = row["WorkPhone"] as string;

			this.pbxCredit.Image = this.ilRatingIcon.Images[row.Credit-1];
		}
	}
}
