Example #1
0
        private void BindEmployeePosTitleInfo()
        {
            _ep = epBll.GetEmployeePosTitle(_id);
            _eId = _ep.EId;
            Employee employee = eBll.GetEmployee(_ep.EId);

            txtEmployee.Text = employee.EName + "(" + employee.Code + ")";
            cbPosTitle.SelectedValue = _ep.PTId;
            dtpObtainDate.Value = _ep.ObtainDate;
            for (int i = 0; i < cbObtainWay.Items.Count; i++)
            {
                if (cbObtainWay.Items[i].ToString() == _ep.ObtainWay)
                {
                    cbObtainWay.SelectedIndex = i;
                    break;
                }
            }
            txtEmployCompany.Text = _ep.EmployCompany;
            cbPosition.SelectedValue = _ep.PId;
            dtpStartDate.Value = _ep.StartDate;
            dtpEndDate.Value = _ep.EndDate;
        }
Example #2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (_eId == 0)
            {
                MessageBox.Show("员工不能为空");
                return;
            }

            if (cbPosTitle.Items.Count == 0)
            {
                MessageBox.Show("请选择职称");
                return;
            }
            if (cbPosition.Items.Count == 0)
            {
                MessageBox.Show("请选择职务");
                return;
            }

            string employCompany = txtEmployCompany.Text.Trim();
            if (employCompany.Length == 0)
            {
                MessageBox.Show("聘用单位不能为空");
                return;
            }

            EmployeePosTitle ep = new EmployeePosTitle();
            ep.EId = _eId;
            ep.PTId = Convert.ToInt32(cbPosTitle.SelectedValue);
            ep.ObtainDate = Convert.ToDateTime(dtpObtainDate.Text);
            ep.ObtainWay = cbObtainWay.SelectedItem.ToString();
            ep.EmployCompany = employCompany;
            ep.PId = Convert.ToInt32(cbPosition.SelectedValue);
            ep.StartDate = Convert.ToDateTime(dtpStartDate.Text);
            ep.EndDate = Convert.ToDateTime(dtpEndDate.Text);

            epBll.Insert(ep);
            MessageBox.Show("添加成功!");
            this.DialogResult = DialogResult.OK;

            this.Close();
        }
Example #3
0
 /// <summary>
 /// 修改职称评定
 /// </summary>
 /// <param name="record">职称评定对象</param>
 /// <returns>影响行数</returns>
 public int Update(EmployeePosTitle record)
 {
     return _dal.Update(record);
 }
Example #4
0
 /// <summary>
 /// 添加职称评定
 /// </summary>
 /// <param name="record">职称评定对象</param>
 /// <returns>ID</returns>
 public int Insert(EmployeePosTitle record)
 {
     return _dal.Insert(record);
 }