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

namespace JXC_MIS.UserTier.NewForm
{
	public class frmStore : JXC_MIS.UserTier.BaseForm.frmTreeFlexGrid
	{
		private System.Windows.Forms.ComboBox cbo_FliterValue;
		private System.Windows.Forms.ComboBox cbo_FilterName;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.DateTimePicker dt_End;
		private System.ComponentModel.IContainer components = null;

		public frmStore()
		{
			// 该调用是 Windows 窗体设计器所必需的。
			InitializeComponent();

			// TODO: 在 InitializeComponent 调用后添加任何初始化
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region 设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmStore));
			this.cbo_FliterValue = new System.Windows.Forms.ComboBox();
			this.cbo_FilterName = new System.Windows.Forms.ComboBox();
			this.label1 = new System.Windows.Forms.Label();
			this.dt_End = new System.Windows.Forms.DateTimePicker();
			this.SuspendLayout();
			// 
			// panel1
			// 
			this.panel1.Name = "panel1";
			this.panel1.Size = new System.Drawing.Size(726, 446);
			// 
			// spt_H
			// 
			this.spt_H.Location = new System.Drawing.Point(144, 198);
			this.spt_H.Name = "spt_H";
			this.spt_H.Size = new System.Drawing.Size(582, 4);
			// 
			// spt_V
			// 
			this.spt_V.Location = new System.Drawing.Point(140, 0);
			this.spt_V.Name = "spt_V";
			this.spt_V.Size = new System.Drawing.Size(4, 446);
			// 
			// tv_Tree
			// 
			this.tv_Tree.Name = "tv_Tree";
			this.tv_Tree.Size = new System.Drawing.Size(140, 446);
			// 
			// cbo_SetupName
			// 
			this.cbo_SetupName.Name = "cbo_SetupName";
			this.cbo_SetupName.Size = new System.Drawing.Size(124, 20);
			// 
			// pnl_Filter
			// 
			this.pnl_Filter.Name = "pnl_Filter";
			// 
			// cmd_Cancel
			// 
			this.cmd_Cancel.Name = "cmd_Cancel";
			// 
			// cmd_ExeQuery
			// 
			this.cmd_ExeQuery.Name = "cmd_ExeQuery";
			// 
			// grd_Filter
			// 
			this.grd_Filter.Name = "grd_Filter";
			// 
			// sbr_StatusBar
			// 
			this.sbr_StatusBar.Name = "sbr_StatusBar";
			this.sbr_StatusBar.Size = new System.Drawing.Size(726, 25);
			// 
			// tbr_Toolbar
			// 
			this.tbr_Toolbar.Name = "tbr_Toolbar";
			this.tbr_Toolbar.Size = new System.Drawing.Size(726, 28);
			// 
			// grd_Top
			// 
			this.grd_Top.Location = new System.Drawing.Point(144, 0);
			this.grd_Top.Name = "grd_Top";
			this.grd_Top.Size = new System.Drawing.Size(582, 198);
			// 
			// grd_Bottom
			// 
			this.grd_Bottom.Location = new System.Drawing.Point(144, 202);
			this.grd_Bottom.Name = "grd_Bottom";
			this.grd_Bottom.Size = new System.Drawing.Size(580, 244);
			// 
			// img_ImageList
			// 
			this.img_ImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("img_ImageList.ImageStream")));
			// 
			// cbo_FliterValue
			// 
			this.cbo_FliterValue.Items.AddRange(new object[] {
																 "<全部>"});
			this.cbo_FliterValue.Location = new System.Drawing.Point(394, 4);
			this.cbo_FliterValue.Name = "cbo_FliterValue";
			this.cbo_FliterValue.Size = new System.Drawing.Size(170, 20);
			this.cbo_FliterValue.TabIndex = 25;
			this.cbo_FliterValue.Text = "<全部>";
			// 
			// cbo_FilterName
			// 
			this.cbo_FilterName.Items.AddRange(new object[] {
																"国标型号",
																"国标代码"});
			this.cbo_FilterName.Location = new System.Drawing.Point(278, 2);
			this.cbo_FilterName.Name = "cbo_FilterName";
			this.cbo_FilterName.Size = new System.Drawing.Size(84, 20);
			this.cbo_FilterName.TabIndex = 23;
			this.cbo_FilterName.Text = "国标型号";
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(212, 6);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(442, 12);
			this.label1.TabIndex = 24;
			this.label1.Text = "查询内容：                值：                             截止日期：";
			// 
			// dt_End
			// 
			this.dt_End.Format = System.Windows.Forms.DateTimePickerFormat.Short;
			this.dt_End.Location = new System.Drawing.Point(626, 4);
			this.dt_End.Name = "dt_End";
			this.dt_End.Size = new System.Drawing.Size(102, 21);
			this.dt_End.TabIndex = 26;
			// 
			// frmStore
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(726, 499);
			this.Controls.Add(this.dt_End);
			this.Controls.Add(this.cbo_FliterValue);
			this.Controls.Add(this.cbo_FilterName);
			this.Controls.Add(this.label1);
			this.Name = "frmStore";
			this.Load += new System.EventHandler(this.frmStore_Load);
			this.Controls.SetChildIndex(this.tbr_Toolbar, 0);
			this.Controls.SetChildIndex(this.sbr_StatusBar, 0);
			this.Controls.SetChildIndex(this.panel1, 0);
			this.Controls.SetChildIndex(this.pnl_Filter, 0);
			this.Controls.SetChildIndex(this.label1, 0);
			this.Controls.SetChildIndex(this.cbo_FilterName, 0);
			this.Controls.SetChildIndex(this.cbo_FliterValue, 0);
			this.Controls.SetChildIndex(this.dt_End, 0);
			this.ResumeLayout(false);

		}
		#endregion

		private void frmStore_Load(object sender, System.EventArgs e)
		{

			tv_Tree.Width =140;
			spt_H.Visible =true;
			this.grd_Top.Height =100;
			spt_H.BringToFront() ;
			this.ShowResize();
			this.InitTreeData("SELECT fcCode, fcName, fnGrade FROM I_ProductLevel");
			ShowData(this.grd_Top,"刘金山");

			
		}


		private  void ShowData(ljs.MyFlexGrid p_FlexGrid ,string p_Filter)
		{
			//添加行号
//			p_FlexGrid.Clear();
//			if (p_Filter=="<全部>") { p_Filter="";} 
//			else { p_Filter=cbo_FliterValue.Text;}
//			dst= newADO.GetDataSet("up_ljs_LibStore '"+p_Filter +"'");

			InitData.ShowGridData(p_FlexGrid,"up_ljs_LibStore '"+p_Filter +"'");
//			this.grd_Top.CaptionText="库存查询结果:   共"+rs.ToString()+"行" ;

		}

		private void cbo_FliterValue_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			//			string sFilterValue;

			if (e.KeyChar == (char)13) 
			{	
				ShowData(this.grd_Top,cbo_FliterValue.Text);

			}
		}

		private void grd_Top_DoubleClick(object sender, System.EventArgs e)
		{
//			//"√";
//			int rs=0;
//			if (this.grd_Top[grd_Top.CurrentCell.RowNumber,0].ToString() =="√")
//			{
//				rs=grd_Top.CurrentCell.RowNumber+1;
//				this.grd_Top[grd_Top.CurrentCell.RowNumber ,0]=rs.ToString();
//			}
//			else
//			{
//				this.grd_Top[grd_Top.CurrentCell.RowNumber ,0]="√";
//				dt.Rows.Add(dt.NewRow());
//				int cs=dt.Columns.Count;
//				for (int intColIndex=0;intColIndex<cs;intColIndex++)
//				{
//					dt.Rows[dt.Rows.Count-1][intColIndex]=this.grd_Top[grd_Top.CurrentCell.RowNumber ,intColIndex];
//				}
//				dt.Rows[dt.Rows.Count-1][0]=dt.Rows.Count.ToString();
//				grd_Bottom.DataSource=dt;
//
//			}

            
		}





















	}
}

