using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using ljs;
using JXC_MIS.MyClass ;
using JXC_MIS.DataTier ;
using JXC_MIS.UserTier.BaseForm ;



namespace JXC_MIS.UserTier.NewForm
{
	public class frmSellReceive : JXC_MIS.UserTier.BaseForm.frmReceiptBase
	{
		private System.ComponentModel.IContainer components = null;
		private System.Windows.Forms.MenuItem menuItem1;
		private System.Windows.Forms.MenuItem mnu_AutoForMoney;
		private System.Windows.Forms.MenuItem mnu_QueryPrepay;
		private System.Windows.Forms.MenuItem mnu_AutoForPrepay;
//		ClsReceiptMethod newReceipt=new ClsReceiptMethod();
//		ClsCellAttrib newCellAttrib=new ClsCellAttrib();
		private string _ReceiptType="";                //单据类型
		/// <summary>
		/// 设置单据类型
		/// </summary>
		public string SetReceiptType
		{ 
			set { _ReceiptType=value;} 
		} 
		public frmSellReceive()
		{
			// 该调用是 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()
		{
			this.menuItem1 = new System.Windows.Forms.MenuItem();
			this.mnu_AutoForMoney = new System.Windows.Forms.MenuItem();
			this.mnu_QueryPrepay = new System.Windows.Forms.MenuItem();
			this.mnu_AutoForPrepay = new System.Windows.Forms.MenuItem();
			// 
			// TxtTemp
			// 
			this.TxtTemp.Name = "TxtTemp";
			// 
			// sbr_statusBar
			// 
			this.sbr_statusBar.Location = new System.Drawing.Point(0, 527);
			this.sbr_statusBar.Name = "sbr_statusBar";
			this.sbr_statusBar.Size = new System.Drawing.Size(792, 26);
			// 
			// tbr_Toolbar
			// 
			this.tbr_Toolbar.Name = "tbr_Toolbar";
			this.tbr_Toolbar.Size = new System.Drawing.Size(792, 42);
			// 
			// ToolMenu
			// 
			this.ToolMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					 this.menuItem1,
																					 this.mnu_QueryPrepay,
																					 this.mnu_AutoForMoney,
																					 this.mnu_AutoForPrepay});
			// 
			// CboReceiptNo
			// 
			this.CboReceiptNo.Name = "CboReceiptNo";
			this.CboReceiptNo.Size = new System.Drawing.Size(150, 20);
			// 
			// cbo_Year
			// 
			this.cbo_Year.Name = "cbo_Year";
			this.cbo_Year.Size = new System.Drawing.Size(56, 20);
			// 
			// cbo_Month
			// 
			this.cbo_Month.Name = "cbo_Month";
			this.cbo_Month.Size = new System.Drawing.Size(44, 20);
			// 
			// grd_Detail
			// 
			this.grd_Detail.Name = "grd_Detail";
			// 
			// grd_Footer
			// 
			this.grd_Footer.Name = "grd_Footer";
			// 
			// grd_Other
			// 
			this.grd_Other.Name = "grd_Other";
			// 
			// btnDown
			// 
			this.btnDown.Name = "btnDown";
			// 
			// grd_Header
			// 
			this.grd_Header.Name = "grd_Header";
			// 
			// grd_Bottom
			// 
			this.grd_Bottom.Name = "grd_Bottom";
			// 
			// grd_Top
			// 
			this.grd_Top.Name = "grd_Top";
			// 
			// pnl_Back
			// 
			this.pnl_Back.Name = "pnl_Back";
			this.pnl_Back.Size = new System.Drawing.Size(792, 42);
			// 
			// menuItem1
			// 
			this.menuItem1.Index = 4;
			this.menuItem1.Text = "-";
			// 
			// mnu_AutoForMoney
			// 
			this.mnu_AutoForMoney.Index = 6;
			this.mnu_AutoForMoney.Text = "设定金额自动收款";
			this.mnu_AutoForMoney.Click += new System.EventHandler(this.mnu_AutoForMoney_Click);
			// 
			// mnu_QueryPrepay
			// 
			this.mnu_QueryPrepay.Index = 5;
			this.mnu_QueryPrepay.Text = "查预收款余额";
			// 
			// mnu_AutoForPrepay
			// 
			this.mnu_AutoForPrepay.Index = 7;
			this.mnu_AutoForPrepay.Text = "用预收款自动收款";
			// 
			// frmSellReceive
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(792, 553);
			this.Name = "frmSellReceive";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "单据名称";
			this.Load += new System.EventHandler(this.frmSellReceive_Load);

		}
		#endregion

		private void frmSellReceive_Load(object sender, System.EventArgs e)
		{
//			this.newReceipt.LoadFormData(this,"销售收款单");
			this.ReceiptName="销售收款单";   //frmReceiptBase
			this.ReceiptType=_ReceiptType;
			this.InitInterface();	
			this.ReceiptAdd();
			
	}

		private void mnu_AutoForMoney_Click(object sender, System.EventArgs e)
		{
//			if (this.ArrCell[49].Text =="") 
//			{
//				MessageBox.Show("这张销售单还没有备货,不能核对！", "提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information );
//				return;
//			}
//			if (this.ArrCell[51].Text!="") 
//			{
//				MessageBoxButtons buttons = MessageBoxButtons.YesNo;
//				//				DialogResult result;
//
//				if (MessageBox.Show("这张销售单已经核对了,是否继续核对？", "提示", buttons , System.Windows.Forms.MessageBoxIcon.Information)==DialogResult.No )
//				{
//					return;
//				}
//			}

			frmInputBox f=new frmInputBox();
			f.Prompt ="请输入本次收款额：";
			f.Title ="收款金额设定";
			f.Default ="";
			f.ShowDialog();
			string sName=f.GetInputText();
//			if (sName!="")
//			{
//				newADO.BeginTrans(); //事务开始
//				newADO.ExeSql("Update "+newR_Attrib.MasterTableName+" Set fcCheck='"+sName+"' Where "+newR_Attrib.KeyFieldName+"='"+CboReceiptNo.Text +"'"); 
//				newADO.Commit();					  //事务提交
//
//				this.ArrCell[51].Text =sName;
//			}
		}

		

	}
}

