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 HRManagerSystem.Bll;
namespace HRManagerSystem
{
    public partial class UpdateFuLiForm : Form
    {
        public UpdateFuLiForm()
        {
            InitializeComponent();
        }
        T_FuLi fuli1 = new T_FuLi();
        T_StaffRecords staff1 = new T_StaffRecords();
        DataDataContext ddt = new DataDataContext();
        FuLi fu = new FuLi();
        
        public UpdateFuLiForm(T_FuLi fuli, T_StaffRecords staff)
        {
            InitializeComponent();
            this.fuli1 = fuli;
            this.staff1 = staff;
    
        }
        
        private void UpdateFuLiForm_Load(object sender, EventArgs e)
        {
          
            txt_cause.Text = fuli1.FL_Cause;
            txt_money.Text = fuli1.FL_Money.ToString();
            combo_name.Text=staff1.Staff_Name;
            dtpicker_time.Value = (DateTime)fuli1.FL_Time;
            combo_name.Enabled = false;
            //绑定数据源
            fu.Reflush(dataGridView1);
            
        }
       
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            
            //重新修改数据
           
                if (DialogResult.OK == MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK))
                {
                     try
                 {
               
                   fuli1.FL_Cause=txt_cause.Text;
                   fuli1.FL_Money = Convert.ToDecimal(txt_money.Text);
                   fuli1.FL_Time = dtpicker_time.Value;
                 }
                     catch
                     {
                         MessageBox.Show("字符串转化不正确！");
                     }
                }
     
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            //清空文本框中数据
            txt_money.Clear();
            txt_cause.Clear();
        }

        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            //退出
            this.Close();
        }
    }
}
