7日站立会议
public Form每月结算()
{
InitializeComponent();
}
bool flag = false;
private void Form每月结算_Load(object sender, EventArgs e)
{
Bitmap b = new Bitmap(300, 20);
Graphics g = Graphics.FromImage(b);
g.DrawLine(new Pen(Brushes.Blue), new Point(5, 5), new Point(300, 5));
pictureBox1.Image = b;
}
private void button1_Click(object sender, EventArgs e)
{
Test._f.Close();
}
private void button2_Click(object sender, EventArgs e)
{
Form功能选择 f = new Form功能选择();
f.Show();
flag = true;
this.Close();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
string dp = Test.path + @"\文本数据\" + numericUpDown1.Value.ToString() + @"年" + comboBox1.Text;
if (Directory.Exists(dp))
{
string[] fArr = Directory.GetFiles(dp);
label3.Text = "这个月共记录了" + fArr.Length + "天的账目";
foreach (string f in fArr)
{
string str=null;
using (FileStream fs = new FileStream(f, FileMode.OpenOrCreate, FileAccess.Read))
{
byte[] buffer = new byte[1024 * 1024 * 5];
int x = fs.Read(buffer, 0, buffer.Length);
str = Encoding.Default.GetString(buffer, 0, x);
}
if (str == null)
{
continue;
}
else
{
string[] sArr = str.Split(Environment.NewLine.ToCharArray());
foreach (string s in sArr)
{
if (s == "")
{
continue;
}
string[] text = s.Split('\t');
if (text[1] == "日常用品")
{
textBox1.Text = (Convert.ToDouble(textBox1.Text) + Convert.ToDouble(text[2])).ToString();
}
else if (text[1] == "学习用品")
{
textBox2.Text = (Convert.ToDouble(textBox2.Text) + Convert.ToDouble(text[2])).ToString();
}
else if (text[1] == "话费")
{
textBox3.Text = (Convert.ToDouble(textBox3.Text) + Convert.ToDouble(text[2])).ToString();
}
else if (text[1] == "饮食")
{
textBox4.Text = (Convert.ToDouble(textBox4.Text) + Convert.ToDouble(text[2])).ToString();
}
else if (text[1] == "衣服")
{
textBox5.Text = (Convert.ToDouble(textBox5.Text) + Convert.ToDouble(text[2])).ToString();
}
else if (text[1] == "其他")
{
textBox6.Text = (Convert.ToDouble(textBox6.Text) + Convert.ToDouble(text[2])).ToString();
}
}
}
}