billdailyform.cs

来自「《C#和.NET第一步》中的财务系统 利用三层结构做的」· CS 代码 · 共 62 行

CS
62
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Common;
namespace HomeMoney
{
	public partial class BillDailyForm : Form
	{
		private DataSet dsCurrent ;
		private BillDaily billCurrent = new BillDaily();
		private bool formEnable = false;

		public bool FormEnable
		{
			get { return formEnable; }
			set { formEnable = value; }
		}

		public BillDaily BillCurrent
		{
			get { return billCurrent; }
		}
		public BillDailyForm()
		{
			InitializeComponent();
		}

		private void btnOk_Click(object sender, EventArgs e)
		{
			BillCurrent.BDDate = this.dtBDDate.Value;
			BillCurrent.BDRemarks = this.txtRemark.Text;
			BillCurrent.BDItem = this.cbBDItem.SelectedValue.ToString();
			BillCurrent.BDINMoney = 0;
			BillCurrent.BDOUTMoney = 0;
			if (rbIN.Checked)
				BillCurrent.BDINMoney = Convert.ToSingle(this.txtMoney.Text);
			else
				BillCurrent.BDOUTMoney = Convert.ToSingle(this.txtMoney.Text);
			this.formEnable = true;
			this.Close();
		}

		private void BillDailyForm_Load(object sender, EventArgs e)
		{
			dsCurrent = new Business.ClassInfoManager().GetClassInfos();
			DataView dw = dsCurrent.Tables[0].DefaultView;
			dw.RowFilter = "LEN(CBDItem)>0";
			this.cbBDItem.DataSource = dw;
			this.cbBDItem.ValueMember="CBDItem";
		}

		private void btnCancel_Click(object sender, EventArgs e)
		{
			this.formEnable = false;
			this.Close();
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?