MainForm.cs
(开头部分) 19KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;
namespace FamilyFinance
{
public partial class MainForm : Form
{
DBhelper dbh = new DBhelper();
private int formHeight = 0;//保存当前窗口的高度
DataSet dsDb;
public MainForm()
{
InitializeComponent();
}
private void MainForm_Load(object sender, EventArgs e)
{
//string sql = "SELECT id as 流水号,consumptDate as 日期,[type] as 类别,category as 收支项目, consumptMoney as 金额,description as 备注 FROM Consumption";
//dgvHome.DataSource = dbh.ReturnDataTableResults(sql); //调用Dbhelp类中的返回数据表集合方法,MySelf code
BindData(string.Empty);
/*
DataSet ds = new DataSet();
DataTable dt;
SqlDataAdapter sd = new SqlDataAdapter();
SqlCommand sqlCmd = new SqlCommand(sql, DBhelper.sqlConn);
sqlCmd.CommandText = sql;
sd.SelectCommand = sqlCmd;
DBhelper.sqlConn.Open();
sd.Fill(ds, "FamilyFinance");
DataTable Consumption;
Consumption =ds.Tables["FamilyFinance"];
dgvHome.DataSource = Consumption;
DBhelper.sqlConn.Close();
*/
cboDir.SelectedIndex = 0; //默认选中第一项
cboSort.SelectedIndex = 0; //默认选中第一项
DateTime dtime = DateTime.Now; //窗体一加载,立刻显示时间,将与下Time控件显示时间的方法连接起来
string date = dtime.ToLongDateString(); //长日期格式的日期部分
string time = dtime.ToLongTimeString();//长日期格式的时间部分
lblTime.Text = date + time;
//加载类型,收支项目初始值
cmbCategory.Items.Add("收入");
cmbCategory.Items.Add("支出");
cmbCategory.SelectedIndex = 0;
后面还有 471 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
