yangle
2022-08-16 1cbc6c9bee7048d3546adebe87d96715630e7d59
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
 
namespace PayM
{
    public partial class Pay_MonthSubsidyEntryBillAdd : Form
    {
        public Pay_MonthSubsidyEntryBillAdd()
        {
            InitializeComponent();
        }
 
        private void cmdHEmpID_Click(object sender, EventArgs e)
        {
            DAL.ClsGy_Employee_View oEmp = new DAL.ClsGy_Employee_View();
            if (oEmp.RefreshView())
            {
                this.txtHEmpID.Text = oEmp.oModel.HName;
                this.txtHEmpNumber.Text = oEmp.oModel.HNumber;
                this.txtHEmpID.Tag = oEmp.oModel.HItemID.ToString();
            }
            else
            {
                this.txtHEmpID.Text = "";
                this.txtHEmpNumber.Text = "";
            }
        }
 
        private void txtHEmpID_TextChanged(object sender, EventArgs e)
        {
            if (txtHEmpID.Text.Trim() == "")
            {
                txtHEmpID.Tag = "0";
                this.txtHEmpNumber.Text = "";
            }
        }
 
        private void button1_Click(object sender, EventArgs e)
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            oCn.RunProc("insert into Pay_MonthSubsidyEntryBill (HYear,HPeriod"+
                ",HDeptCode,HDate,HMaker,HMakeDate,HRemark,HEmpCode,HExpenseType,HQty,HPrice,HMoney,HEmpName)"+
                "values(" + cmbYear.Text + "," + cmbPeriod.Text + ",'',getdate(),'" + DBUtility.ClsPub.CurUserName + "',getdate(),'','" + txtHEmpNumber.Text + "','手工'," + txtHQty.Text + "," + txtHPrice.Text + "," + txtHMoney.Text + ",'"+ txtHEmpID.Text +"')");
            MessageBox.Show("保存成功!","提示");
            txtHEmpID.Text = "";
            txtHEmpNumber.Text = "";
            txtHMoney.Text = "";
            txtHPrice.Text = "";
            txtHQty.Text = "";
        }
 
        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
 
        private void txtHQty_TextChanged(object sender, EventArgs e)
        {
            txtHMoney.Text =DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isDoule( txtHQty.Text) * DBUtility.ClsPub.isDoule( txtHPrice.Text));
        }
 
        private void txtHPrice_TextChanged(object sender, EventArgs e)
        {
            txtHMoney.Text = DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isDoule(txtHQty.Text) * DBUtility.ClsPub.isDoule(txtHPrice.Text));
        }
    }
}