Exemple #1
0
 private void SetFieldValues(biyeshejiDataSet.gongzibiaoALLRow row)
 {
     row.员工编号 = this.txtID.Text.Trim();
     row.姓名   = this.txtName.Text.Trim();
     row.基本工资 = Convert.ToDouble(this.txtBasicSalary.Text.Trim());
     row.工龄工资 = Convert.ToDouble(this.txtYearSalary.Text.Trim());
     row.奖金   = Convert.ToDouble(this.txtBonus.Text.Trim());
     row.扣除   = Convert.ToDouble(this.txtDeduct.Text.Trim());
     row.合计   = row.基本工资 + row.工龄工资 + row.奖金 - row.扣除;
     row.年月   = DateTime.Now.Date;
 }
Exemple #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var selRow = this.GetSelectedRowByID();

            if (selRow == null)
            {
                biyeshejiDataSet.gongzibiaoALLRow row = this.dt.NewgongzibiaoALLRow();
                this.SetFieldValues(row);
                this.dt.Rows.Add(row);
            }
            else
            {
                MessageBox.Show("已有ID对应的数据,一个员工一个天只能添加一次!");
            }
        }
Exemple #3
0
 private void RefreshSelectRowToTextBoxes(biyeshejiDataSet.gongzibiaoALLRow row)
 {
     this.txtID.Text          = row.员工编号;
     this.txtName.Text        = row.姓名;
     this.txtBasicSalary.Text = row.基本工资.ToString();
     this.txtYearSalary.Text  = row.工龄工资.ToString();
     if (row["奖金"] == DBNull.Value)
     {
         this.txtBonus.Text = "0";
     }
     else
     {
         this.txtBonus.Text = row.奖金.ToString();
     }
     //this.txtBonus.Text = row["奖金"].ToString();
     if (row["扣除"] == DBNull.Value)
     {
         this.txtDeduct.Text = "0";
     }
     else
     {
         this.txtDeduct.Text = row.扣除.ToString();
     }
 }