using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data ;
using ljs;
using JXC_MIS.MyClass;
using JXC_MIS.DataTier;
using JXC_MIS.UserTier.CommonForm  ;
using JXC_MIS.Interface;

namespace JXC_MIS.UserTier.BaseForm
{
	/// <summary>
	/// frmReceiptBase 业务单据基窗口。
	/// </summary>
	public class frmReceiptBase : System.Windows.Forms.Form
	{
		#region 系统控件定义

		protected TextBox [] ArrCell=null;
		protected TextBox TxtTemp=new TextBox() ;
		protected System.Windows.Forms.StatusBar sbr_statusBar;
		protected System.Windows.Forms.ToolBar tbr_Toolbar;
		protected System.Windows.Forms.ToolBarButton t_Menu;
		public System.Windows.Forms.ToolBarButton t_new;
		protected System.Windows.Forms.ToolBarButton t_Modify;
		protected System.Windows.Forms.ToolBarButton t_Save;
		protected System.Windows.Forms.ToolBarButton t_Cancel;
		private System.Windows.Forms.ToolBarButton t_S3;
		protected System.Windows.Forms.ToolBarButton t_Preview;
		protected System.Windows.Forms.ToolBarButton t_Print;
		private System.Windows.Forms.ToolBarButton T_S1;
		protected System.Windows.Forms.ToolBarButton t_Refresh;
		protected System.Windows.Forms.ToolBarButton t_Find;
		protected System.Windows.Forms.ToolBarButton t_First;
		protected System.Windows.Forms.ToolBarButton t_Up;
		protected System.Windows.Forms.ToolBarButton t_Down;
		protected System.Windows.Forms.ToolBarButton t_Last;
		private System.Windows.Forms.ToolBarButton t_S2;
		protected System.Windows.Forms.ToolBarButton t_Exit;
		private System.Windows.Forms.StatusBarPanel page;
		private System.Windows.Forms.ImageList img_ImageList;
		public System.Windows.Forms.ContextMenu ToolMenu;
		protected System.Windows.Forms.MenuItem mnu_DetailColWidth;
		protected System.Windows.Forms.ToolBarButton t_Menu1;
		private System.Windows.Forms.ToolBarButton t_s4;
		private System.Windows.Forms.MenuItem mnu_CopyReceipt;
		private System.Windows.Forms.StatusBarPanel AccountDate;
		private System.ComponentModel.IContainer components;//null;
		private System.Windows.Forms.MenuItem mnu_PageRefresh;
		private System.Windows.Forms.MenuItem mnu_Locate;
		#endregion

		protected ClsReceiptMethod newR_Method=new ClsReceiptMethod();
		protected ClsCellAttrib newCellAttrib=new ClsCellAttrib();
		protected ClsReceiptAttrib newR_Attrib=new ClsReceiptAttrib();
		protected ClsDataBase newDB=new ClsDataBase() ;
		protected ClsDataBaseAccess newADO=new ClsDataBaseAccess();
		protected string m_RefertoReturnCols  ;		       //参照返回列值
		protected string m_RefertoInputCols  ;			       //目标列对应列
		protected string m_MouseEnterPlace  ;			       //鼠标单击时所在位置 ,主表位置"Master"	明细表位置 "Detail"
		private IReferto  m_IRefertoForm;
		private ToolTip nToolTip=new ToolTip();  //控件提示
		private  bool m_ReceiptNoRule=false ; //单据编号规则     false=统一规则： 首字符 +年 +月份+四位0001顺序号 true=单据编号用统一的GUID编号



		private System.Windows.Forms.GroupBox gpb_Place;
		protected System.Windows.Forms.ComboBox CboReceiptNo;
		private System.Windows.Forms.Button cmd_Close;
		protected System.Windows.Forms.ComboBox cbo_Year;
		protected System.Windows.Forms.ComboBox cbo_Month;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label lbl_FlieNo;
		protected ljs.MyFlexGrid grd_Detail;
		protected ljs.MyGrid grd_Footer;
		protected ljs.MyGrid grd_Other;
		protected System.Windows.Forms.Button btnDown;
		private System.Windows.Forms.PictureBox pic_Image;
		protected ljs.MyGrid grd_Header;
		private System.Windows.Forms.Label lbl_Title2;
		private System.Windows.Forms.Label lbl_Title1;
		private System.Windows.Forms.Label lblBorder;
		protected ljs.MyGrid grd_Bottom;
		protected ljs.MyGrid grd_Top;
		private System.Windows.Forms.Label lbl_Page2;
		private System.Windows.Forms.Label lbl_Page1;
		private System.Windows.Forms.Panel pnl_Page;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Button cmd_AddList;
		protected System.Windows.Forms.Panel pnl_Back;
		private bool m_BorderOther=true;
		#region 定义属性变量

		//		类的属性所对应的变量，采用属性名前加“m_”(我为_)前缀的形式
		private string m_SaveReceiptNo ;			//                   保存上次显示的单号在单据取消时，重新显示
		private bool m_EditFlag=true ;				//                   标志单据是添加还是修改状态
		//private string m_StabarText ;			    //                   保存状态提示
		private int m_WriteYesNo=1  ;			    //                   单据状态是否只读(0-只读 1-可编辑)
		private string m_ReceiptName ="单据名称" ;	//  单据名称
		private string m_QueryWhere="" ;				// 一般为了控制单据权限时用到,传递过滤条件
		private string m_ColExpress;                    //计算列表达式
		private string m_ShowFormat;                    //显示格式
		private string m_ReceiptType="";                //单据类型
		private bool m_Border=true;
		private bool m_BorderTop=false;
		private bool m_BorderHeader=true;
		private bool m_BorderFooter=true;
		private ljs.MyGrid grd_Hide;
		private System.Windows.Forms.PictureBox pictureBox1;
		private bool m_BorderBottom=false;
		private System.Windows.Forms.Label lblDeclare;
		private string  m_OtherFilter;   //参照其他过滤条件

		#endregion

		#region 自定义属性
		
		public IReferto IRefertoForm
		{ 
			set { m_IRefertoForm=value;} 
		} 

		//      设置属性值
		/// <summary>
		/// 单据grd_Top网格是否有可见边框
		/// </summary>
		public bool SetBorderTop
		{ 
			set { m_BorderTop=value;} 
		} 
		/// <summary>
		/// 单据是否有可见边框
		/// </summary>
		public bool SetBorder
		{ 
			set { m_Border =value;}
		}

		/// <summary>
		/// 单据grd_Top网格是否有可见边框
		/// </summary>
		public bool SetBorderHeader
		{ 
			set { m_BorderHeader=value;} 
		} 

		/// <summary>
		/// 单据grd_Top网格是否有可见边框
		/// </summary>
		public bool SetBorderFooter
		{ 
			set { m_BorderFooter=value;} 
		} 

		/// <summary>
		/// 单据grd_Top网格是否有可见边框
		/// </summary>
		public bool SetBorderBottom
		{ 
			set { m_BorderBottom=value;} 
		} 
		/// <summary>
		/// 单据grd_Top网格是否有可见边框
		/// </summary>
		public bool SetBorderOther
		{ 
			set { m_BorderOther=value;} 
		} 
		/// <summary>
		/// 单据状态是否只读(0-只读 1-可编辑)
		/// </summary>
		public int WriteYesNo
		{ 
			get {return m_WriteYesNo;} 
			set { m_WriteYesNo=value;} 
		} 

		/// <summary>
		/// 设置单据名称m_ReceiptType
		/// </summary>
		public string ReceiptName
		{ 
			get {return m_ReceiptName;} 
			set { m_ReceiptName=value;} 
		} 
		/// <summary>
		/// 设置单据类型
		/// </summary>
		public string ReceiptType
		{ 
			get {return m_ReceiptType;} 
			set { m_ReceiptType=value;} 
		} 

	/// <summary>
	/// 参照其他过滤条件
	/// </summary>
	public string OtherFilter
	{ 
		get {return m_OtherFilter;} 
		set { m_OtherFilter=value;} 
	} 

		public ClsReceiptAttrib ReceiptDesc
		{ 
			get {return newR_Attrib;} 
		} 

		#endregion

		public frmReceiptBase()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <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(frmReceiptBase));
			this.sbr_statusBar = new System.Windows.Forms.StatusBar();
			this.page = new System.Windows.Forms.StatusBarPanel();
			this.AccountDate = new System.Windows.Forms.StatusBarPanel();
			this.pnl_Back = new System.Windows.Forms.Panel();
			this.pictureBox1 = new System.Windows.Forms.PictureBox();
			this.tbr_Toolbar = new System.Windows.Forms.ToolBar();
			this.t_Menu = new System.Windows.Forms.ToolBarButton();
			this.t_Menu1 = new System.Windows.Forms.ToolBarButton();
			this.ToolMenu = new System.Windows.Forms.ContextMenu();
			this.mnu_DetailColWidth = new System.Windows.Forms.MenuItem();
			this.mnu_CopyReceipt = new System.Windows.Forms.MenuItem();
			this.mnu_PageRefresh = new System.Windows.Forms.MenuItem();
			this.mnu_Locate = new System.Windows.Forms.MenuItem();
			this.t_s4 = new System.Windows.Forms.ToolBarButton();
			this.t_new = new System.Windows.Forms.ToolBarButton();
			this.t_Modify = new System.Windows.Forms.ToolBarButton();
			this.t_Save = new System.Windows.Forms.ToolBarButton();
			this.t_Cancel = new System.Windows.Forms.ToolBarButton();
			this.t_S3 = new System.Windows.Forms.ToolBarButton();
			this.t_Preview = new System.Windows.Forms.ToolBarButton();
			this.t_Print = new System.Windows.Forms.ToolBarButton();
			this.T_S1 = new System.Windows.Forms.ToolBarButton();
			this.t_Refresh = new System.Windows.Forms.ToolBarButton();
			this.t_Find = new System.Windows.Forms.ToolBarButton();
			this.t_First = new System.Windows.Forms.ToolBarButton();
			this.t_Up = new System.Windows.Forms.ToolBarButton();
			this.t_Down = new System.Windows.Forms.ToolBarButton();
			this.t_Last = new System.Windows.Forms.ToolBarButton();
			this.t_S2 = new System.Windows.Forms.ToolBarButton();
			this.t_Exit = new System.Windows.Forms.ToolBarButton();
			this.img_ImageList = new System.Windows.Forms.ImageList(this.components);
			this.gpb_Place = new System.Windows.Forms.GroupBox();
			this.cmd_AddList = new System.Windows.Forms.Button();
			this.CboReceiptNo = new System.Windows.Forms.ComboBox();
			this.cmd_Close = new System.Windows.Forms.Button();
			this.cbo_Year = new System.Windows.Forms.ComboBox();
			this.cbo_Month = new System.Windows.Forms.ComboBox();
			this.label2 = new System.Windows.Forms.Label();
			this.label1 = new System.Windows.Forms.Label();
			this.lbl_FlieNo = new System.Windows.Forms.Label();
			this.grd_Detail = new ljs.MyFlexGrid();
			this.grd_Footer = new ljs.MyGrid();
			this.grd_Other = new ljs.MyGrid();
			this.btnDown = new System.Windows.Forms.Button();
			this.pic_Image = new System.Windows.Forms.PictureBox();
			this.grd_Header = new ljs.MyGrid();
			this.lbl_Title2 = new System.Windows.Forms.Label();
			this.lbl_Title1 = new System.Windows.Forms.Label();
			this.lblBorder = new System.Windows.Forms.Label();
			this.grd_Bottom = new ljs.MyGrid();
			this.grd_Top = new ljs.MyGrid();
			this.lbl_Page2 = new System.Windows.Forms.Label();
			this.lbl_Page1 = new System.Windows.Forms.Label();
			this.pnl_Page = new System.Windows.Forms.Panel();
			this.grd_Hide = new ljs.MyGrid();
			this.lblDeclare = new System.Windows.Forms.Label();
			((System.ComponentModel.ISupportInitialize)(this.page)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.AccountDate)).BeginInit();
			this.pnl_Back.SuspendLayout();
			this.gpb_Place.SuspendLayout();
			this.pnl_Page.SuspendLayout();
			this.SuspendLayout();
			// 
			// sbr_statusBar
			// 
			this.sbr_statusBar.Location = new System.Drawing.Point(0, 512);
			this.sbr_statusBar.Name = "sbr_statusBar";
			this.sbr_statusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
																							 this.page,
																							 this.AccountDate});
			this.sbr_statusBar.ShowPanels = true;
			this.sbr_statusBar.Size = new System.Drawing.Size(752, 26);
			this.sbr_statusBar.TabIndex = 41;
			this.sbr_statusBar.Text = "就绪...";
			this.sbr_statusBar.PanelClick += new System.Windows.Forms.StatusBarPanelClickEventHandler(this.sbr_statusBar_PanelClick);
			// 
			// page
			// 
			this.page.Icon = ((System.Drawing.Icon)(resources.GetObject("page.Icon")));
			this.page.Text = "第 1 页/共 1 页";
			this.page.Width = 150;
			// 
			// AccountDate
			// 
			this.AccountDate.Text = "帐期:2004/09/01--2004/10/01";
			this.AccountDate.Width = 400;
			// 
			// pnl_Back
			// 
			this.pnl_Back.BackColor = System.Drawing.Color.Transparent;
			this.pnl_Back.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pnl_Back.BackgroundImage")));
			this.pnl_Back.Controls.Add(this.pictureBox1);
			this.pnl_Back.Controls.Add(this.tbr_Toolbar);
			this.pnl_Back.Dock = System.Windows.Forms.DockStyle.Top;
			this.pnl_Back.Location = new System.Drawing.Point(0, 0);
			this.pnl_Back.Name = "pnl_Back";
			this.pnl_Back.Size = new System.Drawing.Size(752, 42);
			this.pnl_Back.TabIndex = 51;
			// 
			// pictureBox1
			// 
			this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
			this.pictureBox1.Location = new System.Drawing.Point(652, 4);
			this.pictureBox1.Name = "pictureBox1";
			this.pictureBox1.Size = new System.Drawing.Size(100, 30);
			this.pictureBox1.TabIndex = 2;
			this.pictureBox1.TabStop = false;
			// 
			// tbr_Toolbar
			// 
			this.tbr_Toolbar.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
			this.tbr_Toolbar.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.tbr_Toolbar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
																						   this.t_Menu,
																						   this.t_Menu1,
																						   this.t_s4,
																						   this.t_new,
																						   this.t_Modify,
																						   this.t_Save,
																						   this.t_Cancel,
																						   this.t_S3,
																						   this.t_Preview,
																						   this.t_Print,
																						   this.T_S1,
																						   this.t_Refresh,
																						   this.t_Find,
																						   this.t_First,
																						   this.t_Up,
																						   this.t_Down,
																						   this.t_Last,
																						   this.t_S2,
																						   this.t_Exit});
			this.tbr_Toolbar.DropDownArrows = true;
			this.tbr_Toolbar.ImageList = this.img_ImageList;
			this.tbr_Toolbar.Location = new System.Drawing.Point(0, 0);
			this.tbr_Toolbar.Name = "tbr_Toolbar";
			this.tbr_Toolbar.ShowToolTips = true;
			this.tbr_Toolbar.Size = new System.Drawing.Size(752, 42);
			this.tbr_Toolbar.TabIndex = 1;
			this.tbr_Toolbar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tbr_Toolbar_ButtonClick);
			// 
			// t_Menu
			// 
			this.t_Menu.ImageIndex = 31;
			this.t_Menu.Style = System.Windows.Forms.ToolBarButtonStyle.DropDownButton;
			this.t_Menu.Tag = "菜单";
			this.t_Menu.Text = "菜单";
			this.t_Menu.ToolTipText = "菜单";
			// 
			// t_Menu1
			// 
			this.t_Menu1.DropDownMenu = this.ToolMenu;
			this.t_Menu1.ImageIndex = 25;
			this.t_Menu1.Style = System.Windows.Forms.ToolBarButtonStyle.DropDownButton;
			this.t_Menu1.Tag = "控制";
			this.t_Menu1.Text = "控制";
			this.t_Menu1.ToolTipText = "控制";
			// 
			// ToolMenu
			// 
			this.ToolMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					 this.mnu_DetailColWidth,
																					 this.mnu_CopyReceipt,
																					 this.mnu_PageRefresh,
																					 this.mnu_Locate});
			// 
			// mnu_DetailColWidth
			// 
			this.mnu_DetailColWidth.Index = 0;
			this.mnu_DetailColWidth.Text = "明细列宽设置";
			this.mnu_DetailColWidth.Click += new System.EventHandler(this.mnu_DetailColWidth_Click);
			// 
			// mnu_CopyReceipt
			// 
			this.mnu_CopyReceipt.Index = 1;
			this.mnu_CopyReceipt.Text = "复制本单据";
			this.mnu_CopyReceipt.Click += new System.EventHandler(this.mnu_CopyReceipt_Click);
			// 
			// mnu_PageRefresh
			// 
			this.mnu_PageRefresh.Index = 2;
			this.mnu_PageRefresh.Text = "页面刷新";
			this.mnu_PageRefresh.Click += new System.EventHandler(this.mnu_PageRefresh_Click);
			// 
			// mnu_Locate
			// 
			this.mnu_Locate.Index = 3;
			this.mnu_Locate.Text = "单据快速定位";
			this.mnu_Locate.Click += new System.EventHandler(this.mnu_Locate_Click);
			// 
			// t_s4
			// 
			this.t_s4.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
			this.t_s4.Tag = "";
			// 
			// t_new
			// 
			this.t_new.ImageIndex = 34;
			this.t_new.Tag = "新增";
			this.t_new.Text = "新增";
			this.t_new.ToolTipText = "新增(F9)";
			// 
			// t_Modify
			// 
			this.t_Modify.ImageIndex = 17;
			this.t_Modify.Tag = "修改";
			this.t_Modify.Text = "修改";
			this.t_Modify.ToolTipText = "修改(F10)";
			// 
			// t_Save
			// 
			this.t_Save.ImageIndex = 8;
			this.t_Save.Tag = "保存";
			this.t_Save.Text = "保存";
			this.t_Save.ToolTipText = "保存(F12)";
			// 
			// t_Cancel
			// 
			this.t_Cancel.ImageIndex = 27;
			this.t_Cancel.Tag = "放弃";
			this.t_Cancel.Text = "放弃";
			this.t_Cancel.ToolTipText = "放弃(ESC)";
			// 
			// t_S3
			// 
			this.t_S3.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
			this.t_S3.Tag = "";
			// 
			// t_Preview
			// 
			this.t_Preview.ImageIndex = 20;
			this.t_Preview.Tag = "预览";
			this.t_Preview.Text = "预览";
			this.t_Preview.ToolTipText = "预览(F6)";
			// 
			// t_Print
			// 
			this.t_Print.ImageIndex = 9;
			this.t_Print.Tag = "打印";
			this.t_Print.Text = "打印";
			this.t_Print.ToolTipText = "打印(Print)";
			// 
			// T_S1
			// 
			this.T_S1.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
			this.T_S1.Tag = "";
			// 
			// t_Refresh
			// 
			this.t_Refresh.ImageIndex = 22;
			this.t_Refresh.Tag = "刷新";
			this.t_Refresh.Text = "刷新";
			this.t_Refresh.ToolTipText = "刷新";
			this.t_Refresh.Visible = false;
			// 
			// t_Find
			// 
			this.t_Find.ImageIndex = 35;
			this.t_Find.Tag = "查询";
			this.t_Find.Text = "查询";
			this.t_Find.ToolTipText = "查询(F3)";
			// 
			// t_First
			// 
			this.t_First.ImageIndex = 10;
			this.t_First.Tag = "首页";
			this.t_First.Text = "首页";
			this.t_First.ToolTipText = "首页(Home)";
			// 
			// t_Up
			// 
			this.t_Up.ImageIndex = 11;
			this.t_Up.Tag = "上页";
			this.t_Up.Text = "上页";
			this.t_Up.ToolTipText = "上页(PageUp)";
			// 
			// t_Down
			// 
			this.t_Down.ImageIndex = 12;
			this.t_Down.Tag = "下页";
			this.t_Down.Text = "下页";
			this.t_Down.ToolTipText = "下页(PageDown)";
			// 
			// t_Last
			// 
			this.t_Last.ImageIndex = 13;
			this.t_Last.Tag = "末页";
			this.t_Last.Text = "末页";
			this.t_Last.ToolTipText = "末页(End)";
			// 
			// t_S2
			// 
			this.t_S2.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
			this.t_S2.Tag = "";
			// 
			// t_Exit
			// 
			this.t_Exit.ImageIndex = 16;
			this.t_Exit.Tag = "退出";
			this.t_Exit.Text = "退出";
			this.t_Exit.ToolTipText = "退出(F4)";
			// 
			// img_ImageList
			// 
			this.img_ImageList.ImageSize = new System.Drawing.Size(16, 16);
			this.img_ImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("img_ImageList.ImageStream")));
			this.img_ImageList.TransparentColor = System.Drawing.Color.Transparent;
			// 
			// gpb_Place
			// 
			this.gpb_Place.BackColor = System.Drawing.Color.Transparent;
			this.gpb_Place.Controls.Add(this.cmd_AddList);
			this.gpb_Place.Controls.Add(this.CboReceiptNo);
			this.gpb_Place.Controls.Add(this.cmd_Close);
			this.gpb_Place.Controls.Add(this.cbo_Year);
			this.gpb_Place.Controls.Add(this.cbo_Month);
			this.gpb_Place.Controls.Add(this.label2);
			this.gpb_Place.Controls.Add(this.label1);
			this.gpb_Place.ForeColor = System.Drawing.Color.Red;
			this.gpb_Place.Location = new System.Drawing.Point(2, 46);
			this.gpb_Place.Name = "gpb_Place";
			this.gpb_Place.Size = new System.Drawing.Size(254, 76);
			this.gpb_Place.TabIndex = 71;
			this.gpb_Place.TabStop = false;
			this.gpb_Place.Text = "单据快速定位";
			this.gpb_Place.Visible = false;
			// 
			// cmd_AddList
			// 
			this.cmd_AddList.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.cmd_AddList.Location = new System.Drawing.Point(144, 16);
			this.cmd_AddList.Name = "cmd_AddList";
			this.cmd_AddList.Size = new System.Drawing.Size(64, 22);
			this.cmd_AddList.TabIndex = 62;
			this.cmd_AddList.Text = "加入列表";
			this.cmd_AddList.Click += new System.EventHandler(this.cmd_AddList_Click);
			// 
			// CboReceiptNo
			// 
			this.CboReceiptNo.Location = new System.Drawing.Point(100, 48);
			this.CboReceiptNo.Name = "CboReceiptNo";
			this.CboReceiptNo.Size = new System.Drawing.Size(150, 20);
			this.CboReceiptNo.TabIndex = 60;
			this.CboReceiptNo.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.CboReceiptNo_KeyPress);
			this.CboReceiptNo.Click += new System.EventHandler(this.CboReceiptNo_Click);
			this.CboReceiptNo.SelectedIndexChanged += new System.EventHandler(this.CboReceiptNo_SelectedIndexChanged);
			// 
			// cmd_Close
			// 
			this.cmd_Close.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.cmd_Close.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.cmd_Close.Location = new System.Drawing.Point(210, 16);
			this.cmd_Close.Name = "cmd_Close";
			this.cmd_Close.Size = new System.Drawing.Size(38, 22);
			this.cmd_Close.TabIndex = 58;
			this.cmd_Close.Text = "关";
			this.cmd_Close.Click += new System.EventHandler(this.cmd_Close_Click);
			// 
			// cbo_Year
			// 
			this.cbo_Year.BackColor = System.Drawing.Color.White;
			this.cbo_Year.Items.AddRange(new object[] {
														  "2000",
														  "2001",
														  "2002",
														  "2003",
														  "2004",
														  "2005",
														  "2006",
														  "2007",
														  "2008",
														  "2009",
														  "2010",
														  "2011",
														  "2012"});
			this.cbo_Year.Location = new System.Drawing.Point(6, 16);
			this.cbo_Year.Name = "cbo_Year";
			this.cbo_Year.Size = new System.Drawing.Size(56, 20);
			this.cbo_Year.TabIndex = 55;
			this.cbo_Year.Text = "2005";
			this.cbo_Year.SelectedIndexChanged += new System.EventHandler(this.cbo_Month_SelectedIndexChanged);
			// 
			// cbo_Month
			// 
			this.cbo_Month.BackColor = System.Drawing.Color.White;
			this.cbo_Month.Items.AddRange(new object[] {
														   "1",
														   "2",
														   "3",
														   "4",
														   "5",
														   "6",
														   "7",
														   "8",
														   "9",
														   "10",
														   "11",
														   "12"});
			this.cbo_Month.Location = new System.Drawing.Point(80, 16);
			this.cbo_Month.Name = "cbo_Month";
			this.cbo_Month.Size = new System.Drawing.Size(44, 20);
			this.cbo_Month.TabIndex = 54;
			this.cbo_Month.Text = "10";
			this.cbo_Month.SelectedIndexChanged += new System.EventHandler(this.cbo_Month_SelectedIndexChanged);
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(0, 20);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(260, 14);
			this.label2.TabIndex = 56;
			this.label2.Text = "          年        月 ";
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(8, 50);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(170, 14);
			this.label1.TabIndex = 61;
			this.label1.Text = "单据编号列表 :";
			// 
			// lbl_FlieNo
			// 
			this.lbl_FlieNo.AutoSize = true;
			this.lbl_FlieNo.BackColor = System.Drawing.Color.White;
			this.lbl_FlieNo.ForeColor = System.Drawing.Color.Navy;
			this.lbl_FlieNo.Location = new System.Drawing.Point(574, 16);
			this.lbl_FlieNo.Name = "lbl_FlieNo";
			this.lbl_FlieNo.Size = new System.Drawing.Size(122, 17);
			this.lbl_FlieNo.TabIndex = 68;
			this.lbl_FlieNo.Text = "文件号：OR/39840934";
			// 
			// grd_Detail
			// 
			this.grd_Detail.BackColorSel = System.Drawing.SystemColors.Highlight;
			this.grd_Detail.BorderStyle = false;
			this.grd_Detail.CellBackColor = System.Drawing.SystemColors.Window;
			this.grd_Detail.CellColLength = 0;
			this.grd_Detail.CellForeColor = System.Drawing.Color.Navy;
			this.grd_Detail.CellMultiLine = false;
			this.grd_Detail.CellRowLength = 0;
			this.grd_Detail.CellTag = null;
			this.grd_Detail.Col = 0;
			this.grd_Detail.ColCommanFormat = null;
			this.grd_Detail.ColLocked = false;
			this.grd_Detail.Cols = 2;
			this.grd_Detail.ColSel = 1;
			this.grd_Detail.DetailFormat = null;
			this.grd_Detail.EnterToTab = true;
			this.grd_Detail.FixedBackColor = System.Drawing.Color.Empty;
			this.grd_Detail.FixedCols = 1;
			this.grd_Detail.FormatString = null;
			this.grd_Detail.FormatString1 = null;
			this.grd_Detail.GridColor = System.Drawing.Color.FromArgb(((System.Byte)(183)), ((System.Byte)(183)), ((System.Byte)(183)));
			this.grd_Detail.GridStyle = true;
			this.grd_Detail.Location = new System.Drawing.Point(32, 108);
			this.grd_Detail.MultiHead = false;
			this.grd_Detail.Name = "grd_Detail";
			this.grd_Detail.OnlyRead = false;
			this.grd_Detail.Row = 0;
			this.grd_Detail.Rows = 2;
			this.grd_Detail.RowSel = 1;
			this.grd_Detail.SetCellWidth = null;
			this.grd_Detail.Size = new System.Drawing.Size(650, 248);
			this.grd_Detail.TabIndex = 69;
			this.grd_Detail.Cell_Leave += new ljs.FlexGridCell_Leave(this.grd_Detail_Cell_Leave);
			this.grd_Detail.Cell_KeyDown += new ljs.FlexGridCell_KeyDown(this.grd_Detail_Cell_KeyDown);
			this.grd_Detail.Cell_KeyPress += new ljs.FlexGridCell_KeyPress(this.grd_Detail_Cell_KeyPress);
			this.grd_Detail.Scroll += new ljs.FlexGrid_Scroll(this.grd_Detail_Scroll);
			this.grd_Detail.Cell_Enter += new ljs.FlexGridCell_Enter(this.grd_Detail_Cell_Enter);
			// 
			// grd_Footer
			// 
			this.grd_Footer.BackColor = System.Drawing.Color.White;
			this.grd_Footer.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("grd_Footer.BackgroundImage")));
			this.grd_Footer.BorderStyle = false;
			this.grd_Footer.BorderWidth = 0;
			this.grd_Footer.CellBackColor = System.Drawing.Color.White;
			this.grd_Footer.CellColLength = -1;
			this.grd_Footer.CellFontSize = 9F;
			this.grd_Footer.CellForeColor = System.Drawing.Color.Black;
			this.grd_Footer.CellHeight = 0;
			this.grd_Footer.CellRowLength = -1;
			this.grd_Footer.CellTag = null;
			this.grd_Footer.Col = 0;
			this.grd_Footer.Cols = 6;
			this.grd_Footer.EnterToTab = true;
			this.grd_Footer.GridStyle = true;
			this.grd_Footer.Location = new System.Drawing.Point(28, 382);
			this.grd_Footer.Name = "grd_Footer";
			this.grd_Footer.ReadCellBackColor = System.Drawing.Color.White;
			this.grd_Footer.ReadCellForeColor = System.Drawing.Color.Black;
			this.grd_Footer.Row = 0;
			this.grd_Footer.RowHeightMin = 20;
			this.grd_Footer.Rows = 2;
			this.grd_Footer.SetCellWidth = "100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100";
			this.grd_Footer.Size = new System.Drawing.Size(674, 20);
			this.grd_Footer.TabIndex = 65;
			this.grd_Footer.Cell_Leave += new ljs.GridCell_Leave(this.grd_Footer_Cell_Leave);
			this.grd_Footer.Cell_KeyDown += new ljs.GridCell_KeyDown(this.grd_Footer_Cell_KeyDown);
			this.grd_Footer.Cell_KeyPress += new ljs.GridCell_KeyPress(this.grd_Footer_Cell_KeyPress);
			this.grd_Footer.Cell_Enter += new ljs.GridCell_Enter(this.grd_Top_Cell_Enter);
			// 
			// grd_Other
			// 
			this.grd_Other.BackColor = System.Drawing.Color.White;
			this.grd_Other.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("grd_Other.BackgroundImage")));
			this.grd_Other.BorderStyle = false;
			this.grd_Other.BorderWidth = 0;
			this.grd_Other.CellBackColor = System.Drawing.Color.White;
			this.grd_Other.CellColLength = -1;
			this.grd_Other.CellFontSize = 9F;
			this.grd_Other.CellForeColor = System.Drawing.Color.Black;
			this.grd_Other.CellHeight = 0;
			this.grd_Other.CellRowLength = -1;
			this.grd_Other.CellTag = null;
			this.grd_Other.Col = 0;
			this.grd_Other.Cols = 6;
			this.grd_Other.EnterToTab = true;
			this.grd_Other.GridStyle = true;
			this.grd_Other.Location = new System.Drawing.Point(28, 358);
			this.grd_Other.Name = "grd_Other";
			this.grd_Other.ReadCellBackColor = System.Drawing.Color.White;
			this.grd_Other.ReadCellForeColor = System.Drawing.Color.Black;
			this.grd_Other.Row = 0;
			this.grd_Other.RowHeightMin = 20;
			this.grd_Other.Rows = 2;
			this.grd_Other.SetCellWidth = "100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100";
			this.grd_Other.Size = new System.Drawing.Size(674, 20);
			this.grd_Other.TabIndex = 70;
			this.grd_Other.Load += new System.EventHandler(this.grd_Other_Load);
			this.grd_Other.Cell_Leave += new ljs.GridCell_Leave(this.grd_Other_Cell_Leave_1);
			this.grd_Other.Cell_KeyDown += new ljs.GridCell_KeyDown(this.grd_Other_Cell_KeyDown);
			this.grd_Other.Cell_KeyPress += new ljs.GridCell_KeyPress(this.grd_Other_Cell_KeyPress);
			this.grd_Other.Cell_Enter += new ljs.GridCell_Enter(this.grd_Top_Cell_Enter);
			// 
			// btnDown
			// 
			this.btnDown.BackColor = System.Drawing.Color.Transparent;
			this.btnDown.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnDown.BackgroundImage")));
			this.btnDown.Font = new System.Drawing.Font("Marlett", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(2)));
			this.btnDown.Location = new System.Drawing.Point(8, 88);
			this.btnDown.Name = "btnDown";
			this.btnDown.Size = new System.Drawing.Size(16, 18);
			this.btnDown.TabIndex = 61;
			this.btnDown.Visible = false;
			this.btnDown.Click += new System.EventHandler(this.btnDown_Click);
			// 
			// pic_Image
			// 
			this.pic_Image.BackColor = System.Drawing.Color.White;
			this.pic_Image.Image = ((System.Drawing.Image)(resources.GetObject("pic_Image.Image")));
			this.pic_Image.Location = new System.Drawing.Point(34, 22);
			this.pic_Image.Name = "pic_Image";
			this.pic_Image.Size = new System.Drawing.Size(52, 32);
			this.pic_Image.TabIndex = 67;
			this.pic_Image.TabStop = false;
			// 
			// grd_Header
			// 
			this.grd_Header.BackColor = System.Drawing.Color.White;
			this.grd_Header.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("grd_Header.BackgroundImage")));
			this.grd_Header.BorderStyle = false;
			this.grd_Header.BorderWidth = 0;
			this.grd_Header.CellBackColor = System.Drawing.Color.White;
			this.grd_Header.CellColLength = -1;
			this.grd_Header.CellFontSize = 9F;
			this.grd_Header.CellForeColor = System.Drawing.Color.Black;
			this.grd_Header.CellHeight = 0;
			this.grd_Header.CellRowLength = -1;
			this.grd_Header.CellTag = null;
			this.grd_Header.Col = 0;
			this.grd_Header.Cols = 6;
			this.grd_Header.EnterToTab = true;
			this.grd_Header.GridStyle = true;
			this.grd_Header.Location = new System.Drawing.Point(28, 82);
			this.grd_Header.Name = "grd_Header";
			this.grd_Header.ReadCellBackColor = System.Drawing.Color.White;
			this.grd_Header.ReadCellForeColor = System.Drawing.Color.Black;
			this.grd_Header.Row = 0;
			this.grd_Header.RowHeightMin = 20;
			this.grd_Header.Rows = 2;
			this.grd_Header.SetCellWidth = "100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100";
			this.grd_Header.Size = new System.Drawing.Size(678, 20);
			this.grd_Header.TabIndex = 64;
			this.grd_Header.Cell_Leave += new ljs.GridCell_Leave(this.grd_Header_Cell_Leave);
			this.grd_Header.Cell_KeyDown += new ljs.GridCell_KeyDown(this.grd_Header_Cell_KeyDown);
			this.grd_Header.Cell_Enter += new ljs.GridCell_Enter(this.grd_Top_Cell_Enter);
			// 
			// lbl_Title2
			// 
			this.lbl_Title2.BackColor = System.Drawing.Color.White;
			this.lbl_Title2.ForeColor = System.Drawing.Color.Red;
			this.lbl_Title2.Location = new System.Drawing.Point(28, 48);
			this.lbl_Title2.Name = "lbl_Title2";
			this.lbl_Title2.Size = new System.Drawing.Size(676, 14);
			this.lbl_Title2.TabIndex = 60;
			this.lbl_Title2.Text = "北京XX科技有限公司（副标题）";
			this.lbl_Title2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// lbl_Title1
			// 
			this.lbl_Title1.BackColor = System.Drawing.Color.White;
			this.lbl_Title1.Font = new System.Drawing.Font("宋体", 20F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.lbl_Title1.ForeColor = System.Drawing.Color.Navy;
			this.lbl_Title1.Location = new System.Drawing.Point(22, 22);
			this.lbl_Title1.Name = "lbl_Title1";
			this.lbl_Title1.Size = new System.Drawing.Size(678, 30);
			this.lbl_Title1.TabIndex = 59;
			this.lbl_Title1.Text = "销售单（主标题）";
			this.lbl_Title1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// lblBorder
			// 
			this.lblBorder.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(192)));
			this.lblBorder.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.lblBorder.ForeColor = System.Drawing.Color.White;
			this.lblBorder.Location = new System.Drawing.Point(58, 14);
			this.lblBorder.Name = "lblBorder";
			this.lblBorder.Size = new System.Drawing.Size(198, 0);
			this.lblBorder.TabIndex = 62;
			this.lblBorder.Text = "label1";
			// 
			// grd_Bottom
			// 
			this.grd_Bottom.BackColor = System.Drawing.Color.White;
			this.grd_Bottom.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("grd_Bottom.BackgroundImage")));
			this.grd_Bottom.BorderStyle = false;
			this.grd_Bottom.BorderWidth = 0;
			this.grd_Bottom.CellBackColor = System.Drawing.Color.White;
			this.grd_Bottom.CellColLength = -1;
			this.grd_Bottom.CellFontSize = 9F;
			this.grd_Bottom.CellForeColor = System.Drawing.Color.Black;
			this.grd_Bottom.CellHeight = 0;
			this.grd_Bottom.CellRowLength = -1;
			this.grd_Bottom.CellTag = null;
			this.grd_Bottom.Col = 0;
			this.grd_Bottom.Cols = 6;
			this.grd_Bottom.EnterToTab = true;
			this.grd_Bottom.GridStyle = true;
			this.grd_Bottom.Location = new System.Drawing.Point(28, 406);
			this.grd_Bottom.Name = "grd_Bottom";
			this.grd_Bottom.ReadCellBackColor = System.Drawing.Color.White;
			this.grd_Bottom.ReadCellForeColor = System.Drawing.Color.Black;
			this.grd_Bottom.Row = 0;
			this.grd_Bottom.RowHeightMin = 20;
			this.grd_Bottom.Rows = 2;
			this.grd_Bottom.SetCellWidth = "100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100";
			this.grd_Bottom.Size = new System.Drawing.Size(672, 20);
			this.grd_Bottom.TabIndex = 66;
			this.grd_Bottom.Cell_Leave += new ljs.GridCell_Leave(this.grd_Bottom_Cell_Leave);
			this.grd_Bottom.Cell_KeyDown += new ljs.GridCell_KeyDown(this.grd_Bottom_Cell_KeyDown);
			this.grd_Bottom.Cell_KeyPress += new ljs.GridCell_KeyPress(this.grd_Bottom_Cell_KeyPress);
			this.grd_Bottom.Cell_Enter += new ljs.GridCell_Enter(this.grd_Top_Cell_Enter);
			// 
			// grd_Top
			// 
			this.grd_Top.BackColor = System.Drawing.Color.White;
			this.grd_Top.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("grd_Top.BackgroundImage")));
			this.grd_Top.BorderStyle = false;
			this.grd_Top.BorderWidth = 0;
			this.grd_Top.CellBackColor = System.Drawing.Color.White;
			this.grd_Top.CellColLength = -1;
			this.grd_Top.CellFontSize = 9F;
			this.grd_Top.CellForeColor = System.Drawing.Color.Black;
			this.grd_Top.CellHeight = 0;
			this.grd_Top.CellRowLength = -1;
			this.grd_Top.CellTag = null;
			this.grd_Top.Col = 0;
			this.grd_Top.Cols = 6;
			this.grd_Top.EnterToTab = true;
			this.grd_Top.GridStyle = true;
			this.grd_Top.Location = new System.Drawing.Point(28, 62);
			this.grd_Top.Name = "grd_Top";
			this.grd_Top.ReadCellBackColor = System.Drawing.Color.White;
			this.grd_Top.ReadCellForeColor = System.Drawing.Color.Black;
			this.grd_Top.Row = 0;
			this.grd_Top.RowHeightMin = 20;
			this.grd_Top.Rows = 2;
			this.grd_Top.SetCellWidth = "100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100";
			this.grd_Top.Size = new System.Drawing.Size(670, 22);
			this.grd_Top.TabIndex = 63;
			this.grd_Top.Cell_Leave += new ljs.GridCell_Leave(this.grd_Top_Cell_Leave);
			this.grd_Top.Cell_KeyDown += new ljs.GridCell_KeyDown(this.grd_Top_Cell_KeyDown);
			this.grd_Top.Cell_Enter += new ljs.GridCell_Enter(this.grd_Top_Cell_Enter);
			// 
			// lbl_Page2
			// 
			this.lbl_Page2.BackColor = System.Drawing.Color.White;
			this.lbl_Page2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.lbl_Page2.Location = new System.Drawing.Point(2, 4);
			this.lbl_Page2.Name = "lbl_Page2";
			this.lbl_Page2.Size = new System.Drawing.Size(700, 464);
			this.lbl_Page2.TabIndex = 72;
			// 
			// lbl_Page1
			// 
			this.lbl_Page1.BackColor = System.Drawing.Color.Black;
			this.lbl_Page1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.lbl_Page1.Location = new System.Drawing.Point(4, 4);
			this.lbl_Page1.Name = "lbl_Page1";
			this.lbl_Page1.Size = new System.Drawing.Size(701, 464);
			this.lbl_Page1.TabIndex = 73;
			// 
			// pnl_Page
			// 
			this.pnl_Page.BackColor = System.Drawing.Color.White;
			this.pnl_Page.Controls.Add(this.lblDeclare);
			this.pnl_Page.Controls.Add(this.lbl_FlieNo);
			this.pnl_Page.Controls.Add(this.grd_Detail);
			this.pnl_Page.Controls.Add(this.grd_Footer);
			this.pnl_Page.Controls.Add(this.grd_Other);
			this.pnl_Page.Controls.Add(this.btnDown);
			this.pnl_Page.Controls.Add(this.pic_Image);
			this.pnl_Page.Controls.Add(this.grd_Header);
			this.pnl_Page.Controls.Add(this.lbl_Title2);
			this.pnl_Page.Controls.Add(this.lbl_Title1);
			this.pnl_Page.Controls.Add(this.lblBorder);
			this.pnl_Page.Controls.Add(this.grd_Bottom);
			this.pnl_Page.Controls.Add(this.grd_Top);
			this.pnl_Page.Controls.Add(this.lbl_Page2);
			this.pnl_Page.Controls.Add(this.lbl_Page1);
			this.pnl_Page.Location = new System.Drawing.Point(32, 52);
			this.pnl_Page.Name = "pnl_Page";
			this.pnl_Page.Size = new System.Drawing.Size(720, 460);
			this.pnl_Page.TabIndex = 60;
			// 
			// grd_Hide
			// 
			this.grd_Hide.BackColor = System.Drawing.Color.White;
			this.grd_Hide.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("grd_Hide.BackgroundImage")));
			this.grd_Hide.BorderStyle = false;
			this.grd_Hide.BorderWidth = 0;
			this.grd_Hide.CellBackColor = System.Drawing.Color.White;
			this.grd_Hide.CellColLength = -1;
			this.grd_Hide.CellFontSize = 9F;
			this.grd_Hide.CellForeColor = System.Drawing.Color.Black;
			this.grd_Hide.CellHeight = 0;
			this.grd_Hide.CellRowLength = -1;
			this.grd_Hide.CellTag = null;
			this.grd_Hide.Col = 0;
			this.grd_Hide.Cols = 6;
			this.grd_Hide.EnterToTab = true;
			this.grd_Hide.GridStyle = true;
			this.grd_Hide.Location = new System.Drawing.Point(6, 126);
			this.grd_Hide.Name = "grd_Hide";
			this.grd_Hide.ReadCellBackColor = System.Drawing.Color.White;
			this.grd_Hide.ReadCellForeColor = System.Drawing.Color.Black;
			this.grd_Hide.Row = 0;
			this.grd_Hide.RowHeightMin = 20;
			this.grd_Hide.Rows = 2;
			this.grd_Hide.SetCellWidth = "100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100";
			this.grd_Hide.Size = new System.Drawing.Size(18, 40);
			this.grd_Hide.TabIndex = 72;
			this.grd_Hide.Visible = false;
			// 
			// lblDeclare
			// 
			this.lblDeclare.BackColor = System.Drawing.Color.Orange;
			this.lblDeclare.Font = new System.Drawing.Font("隶书", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.lblDeclare.ForeColor = System.Drawing.Color.Red;
			this.lblDeclare.Location = new System.Drawing.Point(16, 76);
			this.lblDeclare.Name = "lblDeclare";
			this.lblDeclare.Size = new System.Drawing.Size(520, 166);
			this.lblDeclare.TabIndex = 74;
			this.lblDeclare.Text = "未经作者授权，任何单位和个人不得修改本窗口代码、不得修改本窗口标题和作者信息，无论是运行时还是设计时。";
			this.lblDeclare.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// frmReceiptBase
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.AutoScroll = true;
			this.BackColor = System.Drawing.Color.White;
			this.ClientSize = new System.Drawing.Size(600, 313);
			this.Controls.Add(this.grd_Hide);
			this.Controls.Add(this.gpb_Place);
			this.Controls.Add(this.pnl_Page);
			this.Controls.Add(this.sbr_statusBar);
			this.Controls.Add(this.pnl_Back);
			this.KeyPreview = true;
			this.Name = "frmReceiptBase";
			this.Text = "WebMIS.NET快速开发平台（作者：长江支流、流金岁月 免费下载：www.webmis.net.cn）";
			this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.frmReceiptBase_KeyDown);
			this.Resize += new System.EventHandler(this.frmReceiptBase_Resize);
			this.Closing += new System.ComponentModel.CancelEventHandler(this.frmReceiptBase_Closing);
			this.Load += new System.EventHandler(this.frmReceiptBase_Load);
			this.Activated += new System.EventHandler(this.frmReceiptBase_Activated);
			((System.ComponentModel.ISupportInitialize)(this.page)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.AccountDate)).EndInit();
			this.pnl_Back.ResumeLayout(false);
			this.gpb_Place.ResumeLayout(false);
			this.pnl_Page.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion
		
		private void frmReceiptBase_Load(object sender, System.EventArgs e)
		{
			//未经作者授权，任何单位和个人不得修改本窗口代码、不得修改本窗口标题和作者信息，无论是运行时还是设计时。
			lblDeclare.Visible = false;
		}

		/// <summary>
		/// 将界面中指定网格单元格对象添加到控件数组中。
		/// </summary>
		private int ArrayIndex(MyGrid p_Grid ,int p_Index)
		{
			int rows;
			int cols;
			if (p_Grid.Visible ==true)
			{
				rows=p_Grid.Rows ;
				cols=p_Grid.Cols;
				for (int r=0;r<rows;r++)
				{
					for (int c=0;c<cols;c++)
					{
						//将单元格对象添加到控件数组中
						p_Grid.GridCell(r,c).TabIndex  =p_Index;
						ArrCell[p_Index]=p_Grid.GridCell(r,c);
						p_Index++;
					}
				}
			}
			return p_Index;

		}
		/// <summary>
		/// 将界面中所有单元格对象添加到控件数组中。
		/// </summary>
		private void AddArray()
		{
			int j=0;
			if (grd_Top.Visible ==true)
			{
				j+=grd_Top.Cols*grd_Top.Rows;
			}
			if (grd_Header.Visible ==true)
			{
				j+=grd_Header.Cols*grd_Header.Rows;
			}
			if (grd_Other.Visible ==true)
			{
				j+=grd_Other.Cols*grd_Other.Rows;
			}

			if (grd_Footer.Visible ==true)
			{
				j+=grd_Footer.Cols*grd_Footer.Rows;
			}
			if (grd_Bottom.Visible ==true)
			{
				j+=grd_Bottom.Cols*grd_Bottom.Rows;
			}
			ArrCell=new TextBox[j];

			int i=0;
			int k=0;
			i=ArrayIndex(grd_Top,i);
			k=ArrayIndex(grd_Header,i);
			i=ArrayIndex(grd_Other,k);
			k=ArrayIndex(grd_Footer,i);
			i=ArrayIndex(grd_Bottom,k);
			//			i=ArrayIndex(grd_Top,i);
			//			k=ArrayIndex(grd_Header,i);
			//			i=ArrayIndex(grd_Footer,k);
			//			k=ArrayIndex(grd_Bottom,i);

		}
		/// <summary>
		/// 单据界面初始化
		/// </summary>
		public void InitInterface()
		{
			cbo_Year.Text =System.DateTime.Now.Year.ToString() ;
			cbo_Month.Text =System.DateTime.Now.Month.ToString();
			if (m_WriteYesNo==1)
			{
				ToolEnabled(false,false);
			}
			else
			{
				ToolEnabled(false,true);
			}

			this.Cursor = Cursors.WaitCursor;

			frmProgressShow f= new frmProgressShow();
			f.ShowDialog (this);
			lblBorder.Visible=m_Border;
			newR_Attrib.LoadData(m_ReceiptName) ;

			//*特别申明：未经作者授权，任何单位和个人不得修改本窗口代码、不得修改本窗口标题和作者信息，无论是运行时还是设计时。
			this.Text ="WebMIS.NET快速开发平台（作者：长江支流、流金岁月 免费下载：www.webmis.net.cn）-" + newR_Attrib.ReceiptTitle1;

			lbl_FlieNo.Text =newR_Attrib.FileNO ;
			lbl_Title1.Text =newR_Attrib.ReceiptTitle1;
			lbl_Title2.Text =newR_Attrib.ReceiptTitle2;
			//初始主表界面数据
			newR_Method.SetInterface(grd_Hide,newR_Attrib.HideFiledsDetail,"",false,false);

			newR_Method.SetInterface(grd_Top,newR_Attrib.PageTopFormat,newR_Attrib.PageTopColWidth,m_BorderTop,m_BorderTop);
			newR_Method.SetInterface(grd_Header,newR_Attrib.PageHeaderFormat,newR_Attrib.PageHeaderColWidth,m_BorderHeader,m_BorderHeader);
			newR_Method.SetInterface(grd_Other,newR_Attrib.PageOtherFormat,newR_Attrib.PageOtherColWidth,m_BorderOther,false);
			newR_Method.SetInterface(grd_Footer,newR_Attrib.PageFooterFormat,newR_Attrib.PageFooterColWidth,m_BorderFooter,m_BorderFooter);
			newR_Method.SetInterface(grd_Bottom,newR_Attrib.PageBottomFormat,newR_Attrib.PageBottomColWidth,m_BorderBottom,m_BorderBottom);
			//单据页面定位指示CboReceiptNo
//			CboReceiptNo.Text=grd_Top.CellText(0,grd_Top.Cols-1);
			//			grd_Detail.Rows=15;
			//初始明细表界面数据
			if (newR_Attrib.PageCaptionFormat1==null || newR_Attrib.PageCaptionFormat1=="")
			{
				grd_Detail.Visible =false;
				grd_Detail.Height =0;
			}
			else
			{
				grd_Detail.FormatString =newR_Attrib.PageCaptionFormat1;//"0序号|1产品代码|2产品名称|3产品型号|4需方型号|5包装形式|6最小包装量|7单位|8仓库|入库|入库|入库|入库|出库|出库|出库|库存数量|17平均单价|18金额|19备注|20备注|21备注|22备注|23备注|24备注|25备注|26备注|27备注";
				grd_Detail.FormatString1 =newR_Attrib.PageCaptionFormat2;//"0序号|1产品代码|2产品名称|3产品型号|4需方型号|5包装形式|6最小包装量|7单位|8仓库|9入库日期|10入库数量|11入库单价|12入库金额|13出库数量|14出库单价|15出库金额|16库存数量|17平均单价|18金额|19备注|20备注|21备注|22备注|23备注|24备注|25备注|26备注|27备注";
				grd_Detail.SetCellWidth =newR_Attrib.PageDetailColWidth;
				grd_Detail.ColCommanFormat= newR_Attrib.PageDetailFormat;
				grd_Detail.Height =newR_Attrib.DetailHeight;
				grd_Detail.Visible =true;
				grd_Detail.SetRowNo();

			}
			//把grd_Top、grd_Header、grd_Bottom、grd_Footer网格控件统一加入数组等同数组控件
			AddArray();

			grd_Detail.Width=newR_Attrib.ReceiptWidth;
			lbl_Title1.Width =grd_Detail.Width ;
			lbl_Title2.Width=grd_Detail.Width ;
			grd_Header.Width=grd_Detail.Width ;
			grd_Bottom.Width=grd_Detail.Width ;
			grd_Footer.Width=grd_Detail.Width ;
			lblBorder.Width=grd_Detail.Width+4;
			//设置左边距
			SetPageLeft(grd_Top.Left);
			if (grd_Top.Visible ==true)
			{
				grd_Header.Top=grd_Top.Top +grd_Top.Height+2 ;
			}
			else
			{
				grd_Header.Top=grd_Top.Top+2;
			}

			if (grd_Header.Visible ==true)
			{
				grd_Detail.Top=grd_Header.Top +grd_Header.Height+1 ;
				grd_Detail.Top=grd_Header.Top +grd_Header.Height+1 ;
				lblBorder.Top=grd_Header.Top -2 ;
			}
			else
			{
				grd_Detail.Top=grd_Top.Top +grd_Top.Height+1 ;
				lblBorder.Top=grd_Detail.Top -2 ;
			}
			if (grd_Detail.Visible ==false)
			{
				grd_Detail.Top=grd_Header.Top +grd_Header.Height ;
			}


			if (grd_Other.Visible ==true)
			{
				grd_Other.Top=grd_Detail.Top +grd_Detail.Height+1 ;
				grd_Footer.Top=grd_Other.Top +grd_Other.Height-1;//+1 ;
				grd_Bottom.Top=grd_Footer.Top +grd_Footer.Height+4 ;
				lblBorder.Height=grd_Footer.Top-lblBorder.Top+4 ;
				grd_Other.BringToFront();

			}
			else
			{
				grd_Other.Top=grd_Detail.Top +grd_Detail.Height+1 ;
				grd_Footer.Top=grd_Detail.Top +grd_Detail.Height+1 ;
				grd_Bottom.Top=grd_Footer.Top +grd_Footer.Height+4 ;
				lblBorder.Height=grd_Footer.Top-lblBorder.Top+4 ;
			}

			if (grd_Footer.Visible ==true ) //&& m_BorderFooter==true
			{
				lblBorder.Height=grd_Footer.Top+grd_Footer.Height -lblBorder.Top+2 ;
			}
			else
			{
				grd_Bottom.Top=grd_Footer.Top+4 ;
				lblBorder.Height=grd_Bottom.Top-lblBorder.Top ;
			}			
			if (grd_Other.Visible ==false && grd_Footer.Visible ==false)
			{
				lblBorder.Height=grd_Detail.Height +grd_Detail.Top-lblBorder.Top+2 ;
			}
			if (grd_Bottom.Visible ==false)
			{
				grd_Bottom.Top =grd_Footer.Top ;
				grd_Bottom.Height  =grd_Footer.Height  ;
			}
			//设置单据背景阴影
			lbl_Page2.Height =grd_Bottom.Top+grd_Bottom.Height+30;//this.sbr_statusBar.Top-this.tbr_Toolbar.Height-15;
			lbl_Page1.Height=lbl_Page2.Height;
			lbl_Page2.Width =lblBorder.Width+35;
			lbl_Page1.Width =lbl_Page2.Width;
			lbl_Page2.Top =1;
			lbl_Page1.Top =3;
			pnl_Page.Top =this.tbr_Toolbar.Height+2;
			pnl_Page.Height =lbl_Page1.Top+lbl_Page1.Height+1;
			pnl_Page.Width =lblBorder.Width +70;
			this.Height =pnl_Page.Top+pnl_Page.Height +this.sbr_statusBar.Height*3;
			this.Width =lblBorder.Width +85;//lblBorder.Left*4;//
			grd_Detail.FixedBackColor =System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));//Color.White ;
			//单据编号列表初始
			InitReceiptList();
			f.Close();//进度条关闭

			this.Cursor = Cursors.Default ;

		}
		/// <summary>
		/// 窗体大小尺寸调整
		/// </summary>
		private void FormResize()
		{
			//			SetPageLeft(this.Width -lbl_Page1.Width );

			//			this.pic_Face.Top=0;
			//			this.pic_Face.Left =0;
			//			this.pic_Face.Width =this.Width;
			//			this.pic_Face.Height =this.Height ;
			pnl_Page.Left =(this.Width -pnl_Page.Width )/2;

		}
		/// <summary>
		/// 单据左边距离
		/// </summary>
		protected virtual void SetPageLeft(int p_Left) 
		{
			lbl_Title1.Left=p_Left ;
			lbl_Title2.Left=p_Left ;
			lblBorder.Left=p_Left-2 ;
			lbl_FlieNo.Left=lbl_Title1.Left+lbl_Title1.Width-lbl_FlieNo.Width ;
			grd_Header.Left=p_Left;
			grd_Detail.Left=p_Left ;
			grd_Bottom.Left=p_Left ;
			grd_Footer.Left=p_Left ;
			grd_Other.Left=p_Left ;
			grd_Top.Left=p_Left ;
			lbl_Page2.Left=p_Left-21;
			lbl_Page1.Left =p_Left-19;
			pic_Image.Left=p_Left-2 ; 

		}


		/// <summary>
		/// 单据数据初始
		/// </summary>
		protected virtual void InitReceiptData(string strReceiptNO) 
		{
			//定义数据集对象
			if (strReceiptNO=="" || strReceiptNO==null){return;}
			int rs=0;
			int cs=0;
			string strErrInfo="";
			string sReceiptNO=strReceiptNO;
			string MasterTableName=newR_Attrib.MasterTableName;
			string DetailTableName=newR_Attrib.DetailTableName;
			if (MasterTableName==null || MasterTableName=="") {MasterTableName="";}
			if (DetailTableName==null || DetailTableName=="") {DetailTableName="";}
			if (MasterTableName=="" && DetailTableName=="") {return;}
			try
			{
				string MasterSql=newR_Attrib.MasterViewFeildName;
				string DetailSql=newR_Attrib.DetailViewFeildName;
				//替换主从SQL语句中的单据编号变量
				if (MasterTableName!="") MasterSql=MasterSql.ToLower().Replace("@receiptno",sReceiptNO);
				if (DetailTableName!="") DetailSql=DetailSql.ToLower().Replace("@receiptno",sReceiptNO);
//				newADO.Open();
				System.Data.DataSet dst = new System.Data.DataSet();
				dst=newDB.GetDataSet(MasterSql,DetailSql);//同时打开主从表
				System.Data.DataRow dr =null;
				//判断首尾
				ReceiptPageMove(CboReceiptNo);
				//填充主表
				if (dst.Tables[0]!=null && dst.Tables[0].Rows.Count!=0)
				{
					dr = dst.Tables[0].Rows[0];
					cs=ArrCell.Length ;
					int cn=dr.Table.Columns.Count; //列数
					int j=0;
					for (int i=0;i<cs;i++)
					{
						if (i%2!=0)
						{
							if (j>=cn) break;
							if (ArrCell[i].Tag!=null) newCellAttrib.FormatString =ArrCell[i].Tag.ToString();
							if (newCellAttrib.NoDataBind==false)  //判断是否绑定数据 false=绑定
							{
								ArrCell[i].Text =dr[j].ToString();
								j++;
							}
						}
					}
				}

			//填充明细表数据
				grd_Detail.Clear() ;
				if (dst.Tables.Count>1 && dst.Tables[1]!=null && dst.Tables[1].Rows.Count!=0)
				{
					grd_Detail.Rows=3;
					rs=dst.Tables[1].Rows.Count+1;
					cs=grd_Detail.Cols ;
					grd_Detail.Rows=rs+3;

					for (int r=1;r<rs;r++)
					{
						dr = dst.Tables[1].Rows[r-1];

						grd_Detail.SetRowHeight(r,300);
						grd_Detail.SetCellText(r,0,r.ToString());//行号
						for (int c=1;c<cs;c++)
						{
							grd_Detail.SetCellText(r,c,dr[c-1].ToString() );
						}
					}

					//计算指定列的合计
					if (newR_Attrib.DetailColSumNo!="" || newR_Attrib.DetailColSumNo!=null)  //如果设置属性DetailColSumNo的值
					{
						AutoGridColSum(newR_Attrib.DetailColSumNo,m_ShowFormat);} 
					else      //如果没有设置属性DetailColSumNo的值、则从命令集中搜索生成列求和的字符串
					{
						AutoGridColSum(newR_Method.GetDetailColSumNo(newR_Attrib.PageDetailFormat),m_ShowFormat);
					}
				}
				dst=null;
			}
			catch(System.Exception ex)
			{
				strErrInfo="错误提示：加载数据失败！" + "\n" + ex.Message;
			}
			finally
			{
				if (strErrInfo!="")
					System.Windows.Forms.MessageBox.Show(strErrInfo,"提示",System.Windows.Forms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Warning);
			}
//			newADO.Close();
		}
		/// <summary>
		/// 单据数据复制
		/// </summary>
		protected virtual void ReceiptCopy() 
		{
			ReceiptDefault(false);

		}

		/// <summary>
		/// 单据数据新增
		/// </summary>
		protected virtual void ReceiptAdd() 
		{
			ReceiptDefault(true);
		}
		/// <summary>
		/// 单据新增或复制时初始缺省值
		/// </summary>
		/// <param name="p_Bool">true=新增 false=复制 </param>
		protected virtual void ReceiptDefault(bool p_Bool) 
		{
			try
			{
				//初始默认值
				int j=ArrCell.GetUpperBound(0)+1;
				string v=null;
				for (int i=0 ;i<j;i++)
				{
					if (i%2!=0)
					{
						if (p_Bool==true) ArrCell[i].Text ="";
						if (ArrCell[i].Tag!=null) newCellAttrib.FormatString =ArrCell[i].Tag.ToString();
						v=newCellAttrib.TextDefault ; 
						if (v!=null)
						{
							//静态默认值
							ArrCell[i].Text =v;

							//单据类型
							if (v.ToLower()=="type" || v.ToLower()=="@type")
							{
								ArrCell[i].Text =m_ReceiptType;
							}

							//判断动态始默认值 当前日期 
							if (v.ToLower()=="date" || v.ToLower()=="@sysdate")
							{
								ArrCell[i].Text =GlobalData.LoginDate;
							}
							//当前操作员
							if (v.ToLower()=="operator" || v.ToLower()=="@operator") 
							{
								ArrCell[i].Text =GlobalData.Operator;; 
							}
							//统一的GUID编号
							if (v.ToLower()=="guid" || v.ToLower()=="@guid")        
							{
								ArrCell[i].Text =System.Guid.NewGuid().ToString() ;
							}
							//统一规则： 首字符 +年 +月份+四位0001顺序号
							if (v.ToLower()=="receiptno" || v.ToLower()=="@receiptno")		
							{
								CboReceiptNo.Text =newR_Method.GetReceiptNo(newR_Attrib.MasterTableName,newR_Attrib.KeyFieldName,newR_Attrib.FirstChar);
								ArrCell[i].Text=CboReceiptNo.Text ;
								m_ReceiptNoRule=false;
							}
							//单据编号用统一的GUID编号
							if (v.ToLower()=="guidreceptno" || v.ToLower()=="@guidreceptno")   
							{
								CboReceiptNo.Text =System.Guid.NewGuid().ToString() ;
								ArrCell[i].Text=CboReceiptNo.Text ;
								m_ReceiptNoRule=true;
							}
						}
					}
				}

				ToolEnabled(true,false);
				m_EditFlag=false;
				if (p_Bool==true)
				{
					grd_Detail.Clear();
				    grd_Detail.Rows =3;
				}
				m_SaveReceiptNo=CboReceiptNo.Text ;//  保存上次显示的单号在单据取消时，重新显示
				//				CboReceiptNo.Text =newR_Method.GetReceiptNo(newR_Attrib.MasterTableName,newR_Attrib.KeyFieldName,newR_Attrib.FirstChar);
				//				grd_Top.CellText(0,grd_Top.Cols-1,CboReceiptNo.Text);
			}
			catch(System.Exception ex)
			{
				System.Windows.Forms.MessageBox.Show(ex.Message,"提示",System.Windows.Forms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Warning);
			}

		}

		/// <summary>
		/// 单据数据保存
		/// </summary>
		public void ReceiptSave() 
		{
			string [,] TempArrCell=null;
			string sReceiptNo;
			try
			{
				newADO.BeginTrans(); //事务开始
				if (m_EditFlag==true)
				{
					if (newR_Attrib.MasterTableName!="") newADO.ExeSql("Delete From "+newR_Attrib.MasterTableName+" Where "+newR_Attrib.KeyFieldName+"='"+CboReceiptNo.Text +"'"); 
					if (newR_Attrib.DetailTableName!="") newADO.ExeSql("Delete From "+newR_Attrib.DetailTableName+" Where "+newR_Attrib.KeyFieldName+"='"+CboReceiptNo.Text +"'"); 
				}
				else
				{
					if (m_ReceiptNoRule==false)
					{
						CboReceiptNo.Text =newR_Method.GetReceiptNo(newR_Attrib.MasterTableName,newR_Attrib.KeyFieldName,newR_Attrib.FirstChar);
					}
				}
				sReceiptNo=CboReceiptNo.Text;

				//主表数据保存
				int j=ArrCell.GetUpperBound(0)+1;
				int n=0;			//数组计数器
				string sCurColCommand;//当前列控制字符
				string[] tempArr=null;//临时数组

				if (j>1)     //如果主表无数据信息则不保存主表数据
				{
					tempArr=newR_Attrib.MasterFeildName.Split(',');
					TempArrCell=new string[tempArr.Length,2];
//					int k=0;// 隐藏字段的保存
//					if (grd_Hide.Visible ==true)
//					{
//						k=grd_Hide.Cols/2*grd_Hide.Rows;
//						TempArrCell=new string[tempArr.Length+k,2];
//						
//						TempArrCell[n,0]=grd_Hide.GridCell(r,c).Text ;
//						TempArrCell[n,1] =grd_Hide.GridCell(r,c).Tag  ;
//					}
//					else
//					{
//						TempArrCell=new string[tempArr.Length,2];
//					}
					for (int i=0;i<j;i++)
					{
						if (i%2!=0)
						{
							sCurColCommand=ArrCell[i].Tag.ToString();		//列控制字符命令
							newCellAttrib.FormatString =sCurColCommand;     //解析列控制字符
							if (newCellAttrib.NotSave==false)			    //是否保存
							{
								TempArrCell[n,0]=ArrCell[i].Text;
								TempArrCell[n,1] =sCurColCommand;
								n++;
							}
						}
					}
					string sSQL=newR_Method.GetInsertSQL(newR_Attrib.MasterTableName,newR_Attrib.MasterFeildName,TempArrCell);
					if (newADO.ExeSql(sSQL)<0)
					{
						newADO.Rollback() ;        //事务回滚
						return ;
					}
				}
				//明细表数据保存
				if (grd_Detail.Visible ==true)     //如果明细网格不可见则不保存网格数据
				{
					TempArrCell=null;
					tempArr=null;
					string sSQL1="";
					int cs=grd_Detail.Cols;
					int rs=grd_Detail.Rows;
					tempArr=newR_Attrib.DetailFeildName.Split(',');
					TempArrCell=new string[tempArr.Length+1,2];

					for (int r=1;r<rs;r++)
					{
						if (grd_Detail.GetCellText(r,1)!="")
						{
							n=1;
							TempArrCell[0,0]=sReceiptNo;
							TempArrCell[0,1] ="";
			
							for (int c=0;c<cs;c++)
							{
								sCurColCommand=grd_Detail.GetCurColCommand(c);//列控制字符命令
								newCellAttrib.FormatString =sCurColCommand;   //解析列控制字符
								if (newCellAttrib.NotSave==false)			  //是否保存
								{
									TempArrCell[n,0]=grd_Detail.GetCellText(r,c);
									TempArrCell[n,1] =sCurColCommand;
									n++;
								}
							}
							sSQL1=newR_Method.GetInsertSQL(newR_Attrib.DetailTableName,newR_Attrib.KeyFieldName+","+newR_Attrib.DetailFeildName,TempArrCell);
							if (newADO.ExeSql(sSQL1)<0)
							{
								newADO.Rollback() ;  //事务回滚
								return ;
							}
						}

					}
				}
				newADO.Commit();					  //事务提交
				TempArrCell=null;
			}
			catch(System.Exception ex)
			{
				System.Windows.Forms.MessageBox.Show(ex.Message,"保存提示",System.Windows.Forms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Warning);
				newADO.Rollback() ;        //事务回滚
				return ;
			}

			ToolEnabled(false,false);
			//单据编号列表重新初始
			InitReceiptList();
		}


		/// <summary>
		/// 单据数据修改
		/// </summary>
		public void ReceiptModify() 
		{
			ToolEnabled(true,false);
			m_EditFlag=true;
			 m_SaveReceiptNo=CboReceiptNo.Text;//  保存上次显示的单号在单据取消时，重新显示
		}
		/// <summary>
		/// 单据删除
		/// </summary>
		public void ReceiptDel() 
		{
		
		}
		/// <summary>
		/// 单据取消放弃
		/// </summary>
		public void ReceiptCancel() 
		{
			CboReceiptNo.Text=m_SaveReceiptNo;//  在单据取消时，重新显示上次保存显示的单号
			InitReceiptData(CboReceiptNo.Text);
			ToolEnabled(false,false);
		}
		/// <summary>
		/// 单据刷新
		/// </summary>
		public void ReceiptRefresh() 
		{
			ToolEnabled(false,false);
			InitReceiptData(CboReceiptNo.Text);
		}
		/// <summary>
		/// 单据查询
		/// </summary>
		public void ReceiptFind() 
		{
			string s=newR_Attrib.FilterField;
			frmReceiptFind f=new frmReceiptFind();
			f.SetFeilds =s;
			f.SetTableName =newR_Attrib.MasterTableName;
//			f.MdiParent=new frmMain();
			f.ShowDialog() ;
//			f.Show();
			InitReceiptData(f.GetReceiptNo);
		}
		/// <summary>
		/// 单据首页
		/// </summary>
		public void FirstPage() 
		{
			if (CboReceiptNo.Items.Count >0 )
			{
				this.CboReceiptNo.SelectedIndex=0;
			}
			ReceiptPageMove(this.CboReceiptNo);	
			InitReceiptData(CboReceiptNo.Text);

		}
		/// <summary>
		/// 单据上一页
		/// </summary>
		public void UpPage() 
		{
			if (CboReceiptNo.SelectedIndex > 0 )
			{
				this.CboReceiptNo.SelectedIndex=this.CboReceiptNo.SelectedIndex-1;
			}
			ReceiptPageMove(this.CboReceiptNo);	
		}

		/// <summary>
		/// 单据下一页
		/// </summary>
		public void DownPage() 
		{
			if (CboReceiptNo.SelectedIndex < CboReceiptNo.Items.Count -1 )
			{
				this.CboReceiptNo.SelectedIndex=this.CboReceiptNo.SelectedIndex+1;
			}
			ReceiptPageMove(this.CboReceiptNo);	
		}

		/// <summary>
		/// 单据末页
		/// </summary>
		public void LastPage() 
		{
			if (CboReceiptNo.SelectedIndex < CboReceiptNo.Items.Count -1 )
			{
				this.CboReceiptNo.SelectedIndex=this.CboReceiptNo.Items.Count -1;
			}
			ReceiptPageMove(this.CboReceiptNo);
		}

		/// <summary>
		/// 单据完整性验证：  True 验证成功可以保存单据 false 验证不成功不可以保存
		/// </summary>
		protected virtual bool ReceiptCheck() 
		{
			bool returnValue;
			string sCheckType;
			int j=ArrCell.GetUpperBound(0)+1;
			for (int i=0 ;i<j;i++)
			{
				if (i%2!=0)
				{
					newCellAttrib.FormatString =ArrCell[i].Tag.ToString();
					sCheckType=newCellAttrib.CheckType ; 
					returnValue=newR_Method.ReceiptCheck(ArrCell[i-1].Text.ToString(),ArrCell[i].Text.ToString(),sCheckType);
					if (returnValue==false)
					{return returnValue;}
				}
			}
			if (grd_Detail.Visible ==true && grd_Detail.GetCellText(1,1)=="" )
			{
				System.Windows.Forms.MessageBox.Show("明细数据不能空！","提示",System.Windows.Forms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Warning);
				return false;
			}
			return true;

		}
		/// <summary>
		/// 单据打印
		/// </summary>
		public void ReceiptPrint() 
		{
		
		}
		/// <summary>
		/// 打印预览
		/// </summary>
		public void ReceiptPreview() 
		{
		
		}
		private void CboReceiptNo_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			ReceiptRefresh();
		}
		private void CboReceiptNo_Click(object sender, System.EventArgs e)
		{
		}
		/// <summary>
		/// 单据编号列表初始
		/// </summary>
		public void InitReceiptList()//System.Windows.Forms.ComboBox p_ComboBox 
		{
			string Sql;
			string MasterTableName=newR_Attrib.MasterTableName;
			string BrowseFilter=newR_Attrib.BrowseFilter ;
			if (BrowseFilter!="")
			{
				//替换年变量
				cbo_Year.Text =DateTime.Parse(GlobalData.LoginDate).Year.ToString();
				cbo_Month.Text =DateTime.Parse(GlobalData.LoginDate).Month.ToString();
				InitReceiptList(cbo_Year.Text,cbo_Month.Text);
			}
			else
			{
				if (MasterTableName==null || MasterTableName==""){return;}

				Sql="Select "+newR_Attrib.KeyFieldName+" From "+newR_Attrib.MasterTableName;

				if (m_QueryWhere!="" && m_QueryWhere!=null)
				{
					Sql=Sql+" Where "+m_QueryWhere;
				}
				Sql=Sql+" Order By "+newR_Attrib.KeyFieldName;
				newDB.InitComboBox(CboReceiptNo,Sql);
				CboReceiptNo.SelectedIndex =CboReceiptNo.Items.Count-1;
				GetReceiptPage(CboReceiptNo);
			}
		}
		public void InitReceiptList(string p_Year,string p_Month)
		{
			string Sql;
			string BrowseFilter=newR_Attrib.BrowseFilter ;
			if (BrowseFilter!="" && BrowseFilter!=null)
			{
				//替换年变量
				string sFilter=p_Year;
				BrowseFilter=BrowseFilter.ToLower().Replace("@year",sFilter);
				//替换月变量
				sFilter=p_Month;
				BrowseFilter=BrowseFilter.ToLower().Replace("@month",sFilter);
				//替换操作员变量
				sFilter=GlobalData.Operator;
				BrowseFilter=BrowseFilter.ToLower().Replace("@operator",sFilter);
				//替换单据类型变量
				sFilter=m_ReceiptType ;
				BrowseFilter=BrowseFilter.ToLower().Replace("@type",sFilter);
				Sql=BrowseFilter;
				newDB.InitComboBox(CboReceiptNo,Sql);
				CboReceiptNo.SelectedIndex =CboReceiptNo.Items.Count-1;
				GetReceiptPage(CboReceiptNo);
			}
		}

		/// <summary>
		/// 功能： 在报表窗体中前、后、首、末单击事件  (通用)
		/// </summary>
		public void ReceiptPageMove(ComboBox CboNo)
		{
			try
			{
				sbr_statusBar.Panels[0].Text =GetReceiptPage(CboReceiptNo);

				//没有数据记录
				if (CboNo.SelectedIndex <= 0 )
				{
					this.t_First.Enabled =false;
					this.t_Up.Enabled =false;
					this.t_Down.Enabled =false;
					this.t_Last.Enabled =false;
//					return;
				}
				//判断记录首尾位置,控制是否按钮可用
				if (CboNo.SelectedIndex > 0 && CboNo.SelectedIndex < CboNo.Items.Count -1 )
				{
					this.t_First.Enabled =true;
					this.t_Up.Enabled =true;
					this.t_Down.Enabled =true;
					this.t_Last.Enabled =true;
					return;
				}
				if (CboNo.SelectedIndex == 0 )
				{
					this.t_First.Enabled =false;
					this.t_Up.Enabled =false;
					this.t_Down.Enabled =true;
					this.t_Last.Enabled =true;
					
					return;
				}
				if (CboNo.SelectedIndex == CboNo.Items.Count -1 )
				{
					this.t_First.Enabled =true;
					this.t_Up.Enabled =true;
					this.t_Down.Enabled =false;
					this.t_Last.Enabled =false;
					return;
				}

				if (CboNo.Items.Count <= 0 )
				{
					this.t_First.Enabled =false;
					this.t_Up.Enabled =false;
					this.t_Down.Enabled =true;
					this.t_Last.Enabled =false;
					return;
				}

			}
			catch
			{
			
			}

		}
		/// <summary>
		/// 功能： 判断工具条项目是否可用 BlnQueryTag:控制工具条 添加、修改、等功能不可用
		/// </summary>
		public void ToolEnabled(bool YesNo ,bool BlnQueryTag)
		{
			try
			{

				this.t_Menu.Enabled =! YesNo;
				this.t_new.Enabled =! YesNo;
				this.t_Modify.Enabled =! YesNo;
				this.t_Save.Enabled = YesNo;
				this.t_Cancel.Enabled = YesNo;
				this.t_Preview.Enabled =! YesNo;
				this.t_Print.Enabled =! YesNo;
				this.t_Refresh.Enabled =! YesNo;
				this.t_Find.Enabled =! YesNo;
				this.t_First.Enabled =! YesNo;
				this.t_Up.Enabled =! YesNo;
				this.t_Down.Enabled =! YesNo;
				this.t_Last.Enabled =! YesNo;
				this.t_Exit.Enabled =! YesNo;
				if (BlnQueryTag ==true) 
				{
					//单据查询时控制工具条 添加、修改、等功能不可用
					this.t_new.Enabled = YesNo;
					this.t_Modify.Enabled = YesNo;
				}
				else
				{
					this.t_new.Enabled =! YesNo;
					this.t_Modify.Enabled =! YesNo;
				}
			}
			catch
			{
			
			}
		}
		//
		//'-----------------自动计算当前列的和-----------------------------
		public void AutoGridColSum(string p_ColsNo,string p_Format )
		{
			newR_Method.GetGridColSum(grd_Detail,p_ColsNo,p_Format);

		}

		//
		//-----------------自动计算当前列和其他列之间的计算表达式-----------------------------
		public void AutoComputeCol(string p_ColExpressValue,string p_Format )
		{
			newR_Method.AutoCompute(grd_Detail,p_ColExpressValue,p_Format);
		}	
		//-----------------自动计算主表单元格之间的计算表达式-----------------------------
		public void AutoComputeCell(string p_ColExpressValue,string p_Format )
		{
			newR_Method.AutoCompute(ArrCell,p_ColExpressValue,p_Format);
		}	
	

		//		-----------------自动设置当前单据的页数以及所在页码-----------------------------
		public string GetReceiptPage(ComboBox CboReceiptNo )
		{
			int i=CboReceiptNo.SelectedIndex  + 1;
			int j=CboReceiptNo.Items.Count ;
			string p = "第" + i.ToString() + "页/共" + j.ToString()+ "页";
			return p;
		}	


		
		protected virtual void grd_Top_Cell_Enter(object sender, System.EventArgs e)
		{
			try
			{
				TextBox control = (TextBox) sender ; 
				TxtTemp =control;
				CellMouseDown(control);
				m_MouseEnterPlace="Master";
				nToolTip.SetToolTip(control,"索引位置："+control.TabIndex.ToString());
			}
			catch
			{
				return;
			}
		}
		protected virtual void grd_Detail_Cell_Enter(object sender, System.EventArgs e)
		{
			if (this.t_Save.Enabled ==false)  
			{
				grd_Detail.GetEditCell.Visible=false;
				return ;
			}
			TextBox control = (TextBox) sender ;
			TxtTemp =control;
			TxtTemp.Tag =grd_Detail.GetCurColCommand(grd_Detail.Col);//'   grd_Detail.GetCellText(0,grd_Detail.Col);
			//			grd_Detail.SetCellText(3,grd_Detail.Col,grd_Detail.GetCellText(0,grd_Detail.Col));
			newCellAttrib.FormatString =TxtTemp.Tag.ToString();   //解析列控制字符
			if (newCellAttrib.ReadOnly ==true)   //是否保存
			{
				grd_Detail.GetEditCell.ReadOnly=true;
			}
			else
			{
				grd_Detail.GetEditCell.ReadOnly=false;

			}
			CellMouseDown(control);
			m_MouseEnterPlace="Detail";

		}
		/// <summary>
		/// 设置参照按钮
		/// </summary>
		private void CellMouseDown(TextBox sender)
		{
			try
			{
				m_ColExpress=null;
				newCellAttrib.FormatString =sender.Tag.ToString();
				m_ColExpress=newCellAttrib.ColExpress ;
				m_ShowFormat=newCellAttrib.ShowFormat ;
				if (newCellAttrib.RefertoType=="" || newCellAttrib.RefertoType==null)
				{
					btnDown.Visible =false;
				}
				else
				{
					btnDown.Top  =sender.Top+sender.Parent.Top+1 ;
					btnDown.Left  =sender.Left+sender.Parent.Left +sender.Width -btnDown.Width  ;
					btnDown.Height   =sender.Height-1 ;
					btnDown.Visible =true;
					btnDown.BringToFront() ;
				}
			}
			catch
			{
				return;
			}
		}
		/// <summary>
		/// 显示参照
		/// </summary>
		protected virtual void ShowReferto(int p_RefertoType)
		{  
			IReferto f=null; 
			f= new frmReferto();
			f.DataSource =newCellAttrib.RefertoDataSource ;
			f.OtherFilter=m_OtherFilter;//参照其他过滤条件

			f.Location = new Point(this.btnDown.Left + this.Left-TxtTemp.Width ,this.btnDown.Height*2+this.tbr_Toolbar.Height*2 +this.btnDown.Top + this.Top);
			f.DefaultValue=TxtTemp.Text ;
			f.RefertoType =p_RefertoType ;
			m_RefertoReturnCols=newCellAttrib.RefertoReturnCols   ;		       //参照返回列值
			m_RefertoInputCols=newCellAttrib.RefertoInputCols   ;			       //目标列对应列

			f.ShowDialog();
			System.Collections.Hashtable ReturnValues= f.GetReturnHashtable();
			if (ReturnValues==null  || ReturnValues.Count==0) return;
			TxtTemp.Text =ReturnValues[0].ToString().Trim() ;

			if (ReturnValues!=null && m_RefertoReturnCols!="")
			{
				string[] ArrTemp=null;
				string[] ArrTemp1=null;
				ArrTemp=m_RefertoReturnCols.Split(':');
				ArrTemp1=m_RefertoInputCols.Split(':');
				int a=ArrTemp.Length ;
				int b=ArrTemp1.Length ;
				if (a==b && a!=0)
				{
					for (int r=0;r<a;r++)
					{
						if (m_MouseEnterPlace=="Master")
						{
							ArrCell[int.Parse(ArrTemp1[r])].Text=ReturnValues[int.Parse(ArrTemp[r])].ToString ();
						}
						if (m_MouseEnterPlace=="Detail")
						{
							grd_Detail.SetCellText(grd_Detail.Row,int.Parse(ArrTemp1[r]),ReturnValues[int.Parse(ArrTemp[r])].ToString ());
						}
					}
				}
			}
			this.TxtTemp.Focus();
			f=null;
		}
		/// <summary>
		/// 显示其他参照
		/// </summary>
		protected virtual void ShowOtherReferto()
		{
			IReferto f=null; 
			 
			if (m_IRefertoForm==null)
			{
				f= new frmRefertoList();
			}
			else
			{
				f=m_IRefertoForm;
			}


			f.DataSource =newCellAttrib.RefertoDataSource ;

			f.DefaultValue=TxtTemp.Text ;
			m_RefertoReturnCols=newCellAttrib.RefertoReturnCols   ;		       //参照返回列值
			m_RefertoInputCols=newCellAttrib.RefertoInputCols   ;			       //目标列对应列

			f.ShowDialog();
			System.Data.DataTable dt= f.GetReturnDataTable();
			if (dt!=null && m_RefertoReturnCols!="")
			{
				string[] ArrTemp=null;
				string[] ArrTemp1=null;
				ArrTemp=m_RefertoReturnCols.Split(':');
				ArrTemp1=m_RefertoInputCols.Split(':');
				int a=ArrTemp.Length ;
				int b=ArrTemp1.Length ;
				int rs=dt.Rows.Count ;
				int n=grd_Detail.Rows-grd_Detail.Row-1;//计算有限行数
				if (n<rs)
				{
				   grd_Detail.RowInsert("",grd_Detail.Row,rs-n);
						grd_Detail.SetRowNo();
				
				}
				if (a==b && a!=0)
				{
					for (int r=0;r<rs;r++)
					{
						for (int c=0;c<a;c++)
						{
							grd_Detail.SetCellText(grd_Detail.Row+r,int.Parse(ArrTemp1[c]),dt.Rows[r][int.Parse(ArrTemp[c])].ToString ());
						}
					}
				}
			}
			f=null;								
			this.TxtTemp.Focus();
		}
		private void LoadReferto()
		{
			try
			{
				int T=0;
				newCellAttrib.FormatString =TxtTemp.Tag.ToString();
				T=int.Parse(newCellAttrib.RefertoType);
				if (T>10)
				{
					ShowOtherReferto();

				}
				else
				{
					ShowReferto(T)	;
				}
			}
			catch(System.Exception ex)
			{
				System.Windows.Forms.MessageBox.Show(ex.Message,"提示",System.Windows.Forms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Warning);
				return;
			}
		
		}
		protected virtual void btnDown_Click(object sender, System.EventArgs e)
		{
			LoadReferto();
		}

		
		private void grd_Detail_Scroll(object sender, System.EventArgs e)
		{
			btnDown.Visible =false;
		}
		private void frmReceiptBase_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			DoButtonClick(e.KeyCode.ToString());
//			Keys.Print 
		}
		protected virtual void tbr_Toolbar_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
		{
			DoButtonClick(e.Button.Tag.ToString());
		}
		/// <summary>
		/// 控制功能按钮
		/// </summary>
		/// <param name="p_Text"></param>
		protected virtual void DoButtonClick(string p_Text)
		{
			if (p_Text=="新增" || p_Text=="F9")	ReceiptAdd();
			if (p_Text=="修改" || p_Text=="F10")	ReceiptModify();
			if (p_Text=="保存" || p_Text=="F12")	
			{
				if (ReceiptCheck()==false) {return ;}
				ReceiptSave();
			}
			if (p_Text=="放弃" || p_Text=="Escape")	ReceiptCancel();
			if (p_Text=="预览" || p_Text=="F6")	ReceiptPreview();
			if (p_Text=="打印" || p_Text=="Print")	ReceiptPrint();
			if (p_Text=="刷新" || p_Text=="F2")	ReceiptRefresh();
			if (p_Text=="查询" || p_Text=="F3")	ReceiptFind();
			if (p_Text=="首页" || p_Text=="Home")	FirstPage();
			if (p_Text=="上页" || p_Text=="PageUp")	UpPage();
			if (p_Text=="下页" || p_Text=="PageDown")	DownPage();
			if (p_Text=="末页" || p_Text=="End")	LastPage();
			if (p_Text=="退出" || p_Text=="F4")	this.Close();

		}
		/// <summary>
		/// 工具条外观样式  p_Type=true 带文字显示   p_Type=false不带文字显示 只有图标
		/// </summary>
		/// <param name="p_Type"></param>
		public void ToolBarType(bool p_Type)
		{
			this.newR_Method.ToolBarType(this.tbr_Toolbar, p_Type); 
			this.pnl_Back.Height =this.tbr_Toolbar.Height ;

		}
		protected virtual void frmReceiptBase_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{
			MessageBoxButtons buttons = MessageBoxButtons.YesNo;
			DialogResult result;
//			result = MessageBox.Show(this, message, caption, buttons,
//				MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, 
//				MessageBoxOptions.RightAlign);

			if (t_Save.Enabled==true)
			{
				result = MessageBox.Show("数据还没有保存,是否立即退出?", "提示", buttons , System.Windows.Forms.MessageBoxIcon.Question  );
				if(result == DialogResult.No)
				{
					e.Cancel =true;
				    return;
				}
			}
			newADO.Close();

			int j=this.Height ;
			for (int i=0;i<j;i++)
			{
				if (this.Height<20){ return;}
				this.Height=this.Height-30;
			}
		}

		private void grd_Header_Load(object sender, System.EventArgs e)
		{
		
		}
		
		private void frmReceiptBase_Resize(object sender, System.EventArgs e)
		{
			FormResize();
		}

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


		}

		protected virtual void grd_Detail_Cell_Leave(object sender, System.EventArgs e)
		{
			if (t_Save.Enabled==true)
			{
				if (grd_Detail.Col==1)  grd_Detail.SetRowNo() ;
				AutoComputeCol(m_ColExpress,m_ShowFormat);
				AutoGridColSum(newR_Attrib.DetailColSumNo,m_ShowFormat);
			}

		}

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

		protected virtual void grd_Top_Cell_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
				if (e.KeyCode ==Keys.Down || e.KeyCode ==Keys.Up )
			{
				if (btnDown.Visible ==true) LoadReferto();
			}

		}

		protected virtual void grd_Header_Cell_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			grd_Top_Cell_KeyDown(sender,e);
		}

		protected virtual void grd_Detail_Cell_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			grd_Top_Cell_KeyDown(sender,e);
		}

		protected virtual void grd_Detail_Cell_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if (e.KeyChar == (char)13) 
			{	
				if (grd_Detail.Col<grd_Detail.Cols-1)// && grd_Detail.Row<grd_Detail.Rows-1)
				{
							if (grd_Detail.ColWidth(grd_Detail.Col+1)==0)
								{
									grd_Detail.Col=grd_Detail.Col+1;
									grd_Detail_Cell_KeyPress(sender,e);
								}
							else
								{
									if (grd_Detail.Col<grd_Detail.Cols-1)
									{
										grd_Detail.Col=grd_Detail.Col+1;
										grd_Detail.SetCellFocus(grd_Detail.Row,grd_Detail.Col);
									}
								}
				}
				else
				{
					if (grd_Detail.Row<grd_Detail.Rows-1)
					{
						grd_Detail.Row=grd_Detail.Row+1;
						grd_Detail.Col=1;
						grd_Detail.SetCellFocus(grd_Detail.Row,grd_Detail.Col);
					}
					else
					{
						grd_Detail.Row=1;
						grd_Detail.Col=1;
						grd_Detail.SetCellFocus(grd_Detail.Row,grd_Detail.Col);
					}
				}

			}
		}

		protected virtual void grd_Other_Cell_Enter(object sender, System.EventArgs e)
		{
		
		}

		protected virtual void grd_Other_Cell_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			grd_Top_Cell_KeyDown(sender,e);
		}

		protected virtual void grd_Other_Cell_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
		
		}

		protected virtual void grd_Bottom_Cell_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			grd_Top_Cell_KeyDown(sender,e);
		}

		protected virtual void grd_Bottom_Cell_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
		
		}

		protected virtual void grd_Footer_Cell_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			grd_Top_Cell_KeyDown(sender,e);
		}

		protected virtual void grd_Footer_Cell_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
		
		}

		protected virtual void grd_Footer_Cell_Leave(object sender, System.EventArgs e)
		{
			grd_Header_Cell_Leave(sender,e);

		}

		protected virtual void grd_Other_Cell_Leave(object sender, System.EventArgs e)
		{
		
		}

		private void mnu_DetailColWidth_Click(object sender, System.EventArgs e)
		{
			frmColWidthSetup f=new frmColWidthSetup();
			f.GridSource=this.grd_Detail ;
			f.ReceiptName =newR_Attrib.ReceiptName ; 
			f.Show();

		}

		private void mnu_CopyReceipt_Click(object sender, System.EventArgs e)
		{
			ReceiptCopy();
		}

		private void mnu_PageRefresh_Click(object sender, System.EventArgs e)
		{
			InitInterface();
		}

		private void sbr_statusBar_PanelClick(object sender, System.Windows.Forms.StatusBarPanelClickEventArgs e)
		{
		}

		private void cmd_Close_Click(object sender, System.EventArgs e)
		{
			gpb_Place.Visible =false;
		}

		private void mnu_Locate_Click(object sender, System.EventArgs e)
		{
			gpb_Place.Visible =true;
		}

		protected virtual void button1_Click(object sender, System.EventArgs e)
		{

		}

		protected virtual void grd_Bottom_Cell_Leave(object sender, System.EventArgs e)
		{
			grd_Header_Cell_Leave(sender,e);

		}

		private void CboReceiptNo_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
		
			if (e.KeyChar == (char)13) 
			{
					newR_Method.ComboListSearch(CboReceiptNo);
			}
			
		}




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

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

		private void cmd_AddList_Click(object sender, System.EventArgs e)
		{
			InitReceiptList(cbo_Year.Text,cbo_Month.Text);

		}

		private void grd_Header_Cell_Leave(object sender, System.EventArgs e)
		{
			if (t_Save.Enabled==true)
			{
				AutoComputeCell(m_ColExpress,m_ShowFormat);
			}
		}

		private void grd_Top_Cell_Leave(object sender, System.EventArgs e)
		{
			grd_Header_Cell_Leave(sender,e);

		}

		private void grd_Other_Cell_Leave_1(object sender, System.EventArgs e)
		{
			grd_Header_Cell_Leave(sender,e);

		}

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



	


	




















////
////		'====================================个人简历===============================================================================
////
////		'姓名：刘金山  性别：男   出生日期：1977-2-11  专业：计算机    学历：大专
////		'工作：5年     专长：企业管理信息系统（MIS）的需求调研\设计分析\软件开发 以及ERP\CRM\MRPII等方面的软件开发
////		'开发工具：VB ,VC++,VB.Net,C#.Net,Asp.Net,SQL Server2000,Access 等
////		'联系方式：Gold_Mountain@163.com
////
////		'工作经历：
////		'1999年9月：加盟北京快威科技有限公司,亲自主抓并成立软件开发部，主要从事中小型企业的管理信息系统（Mis）的开发,
////		'本人担任部门主管，主要负责软件的开发计划，需求调查分析，开发进度和人员安排以及程序编写等工作。
////		'2000年4月：通用标准版进销存管理软件《快为企管专家》开发完成并推向市场，此软件由本人独立完成。
////		'在2000年5月 到 2002年3月：其间独立完成了《潞安石油销售管理》,《北京佳能OA客户管理》,《北京巡警总队枪械管理系统》,
////		'           《华光电器城手机选号系统》,《昆仑饭店MIS管理》,《国家安全监察管理局触摸屏查询系统》等一些客户定制软件
////		'2002年3月 到 2002年10月：与另外一开发人员合作开发《北京电子元件六厂科技有限公司管理信息系统》
////		'2002年11月 到 2003年6月：与另外一开发人员合作开发《河南省舞钢市钢铁公司原料供应部管理信息系统》
////
////		'6.2003年6月 到 2003年8月 《河南省舞钢市钢铁公司炼钢厂管理信息系统》需求调研。
////		'6.2004年6月 到 2004年11月 《河南省舞钢市钢铁公司炼钢计划管理信息系统》系统开发。


	}
}
