Пример #1
0
 public frmEmpMoney_Add(decimal id)
 {
     InitializeComponent();
     this._Id          = id;
     this._objEmpMoney = new EmpMoney(this._Id);
     this._iEmpId      = this._objEmpMoney.EmpId;
 }
Пример #2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            EmpMoney objEmpMoney = new EmpMoney();

            objEmpMoney.EmpId  = this._iEmpId;
            objEmpMoney.Date   = this.dtpDate.Value;
            objEmpMoney.Money  = this.numMoney.Value;
            objEmpMoney.Remark = this.txtRemark.Text.Trim();
            objEmpMoney.Type   = 0;//扣
            if (this.radYes.Checked)
            {
                objEmpMoney.Type = 1;
            }
            if (objEmpMoney.Money > 0)
            {
                if (this._Id > 0)
                {
                    objEmpMoney.ID = this._Id;
                    objEmpMoney.Update();
                }
                else
                {
                    objEmpMoney.Insert();
                }
            }
            DialogResult = DialogResult.OK;
            this.Close();
        }
        private void LoadEmployeeMoneyList()
        {
            int             iYear       = int.Parse(this.cboYear.Text);
            int             iMonth      = int.Parse(this.cboMonth.Text);
            List <EmpMoney> lstEmpMoney = new EmpMoney().SelectList(this._iEmpId, iYear, iMonth);

            this.dgvEmpMoney.AutoGenerateColumns = false;
            this.dgvEmpMoney.Rows.Clear();
            decimal dNo  = 0; //扣款
            decimal dYes = 0; //奖金

            foreach (EmpMoney objEmpMoney in lstEmpMoney)
            {
                if (objEmpMoney.Type == 0)
                {
                    dNo += objEmpMoney.Money;
                }
                else
                {
                    dYes += objEmpMoney.Money;
                }
                this.dgvEmpMoney.Rows.Add(new object[] { objEmpMoney.ID, objEmpMoney.Date, objEmpMoney.Money, objEmpMoney.TypeText, objEmpMoney.Remark });
            }
            this.lblNo.Text  = "扣款总额:¥" + dNo.ToString("f2");
            this.lblYes.Text = "奖金总额:¥" + dYes.ToString("f2");
        }
Пример #4
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            EmpMoney EmpMoney = new EmpMoney();

            if (EmpMoney.CheckPass(txtUserID.Text, txtPass.Text) == true)
            {
                this.Visible = false;

                frmMain frmMain = new frmMain();
                frmMain.Show();
            }
            else
            {
                MessageBox.Show("用户名或密码输入不正确,请重输!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Пример #5
0
        private void btnChangePass_Click(object sender, EventArgs e)
        {
            if (txtUserID.Text.Trim() == "")
            {
                MessageBox.Show("请重输入用户名!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }


            if (txtOldPass.Text.Trim() == "")
            {
                MessageBox.Show("请重输入原密码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }


            if (txtnewpass.Text.Trim() == "")
            {
                MessageBox.Show("请重输入新密码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            EmpMoney EmpMoney = new EmpMoney();


            if (EmpMoney.CheckPass(txtUserID.Text, txtOldPass.Text) == true)
            {
                EmpMoney.ChangePass(txtUserID.Text, txtOldPass.Text, txtnewpass.Text);

                MessageBox.Show("密码修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("用户名或密码输入不正确,请重输!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }