public int UpdataEmpInfo(EmpPostModel empPostModel) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@CodeSenderAddress",SqlDbType.Int), new SqlParameter("@TerritorialID",SqlDbType.Int), new SqlParameter("@WorkTime",SqlDbType.Int), new SqlParameter("@Remark",SqlDbType.NVarChar,200) }; para[0].Value = empPostModel.CodeSenderAddress; para[1].Value = empPostModel.TerritorialID; para[2].Value = empPostModel.WorkTime; para[3].Value = empPostModel.Remark; return dbacc.ExecuteSql("zjw_EmpPost_UpData", para); }
private void btnAddOrModify_Click(object sender, EventArgs e) { if (ValidateEmp()) { EmpPostModel empPostModel = new EmpPostModel(); int intWorkTime; try { empPostModel.CodeSenderAddress = Convert.ToInt32(txt_CodeSenderAddress.Text.Trim()); empPostModel.TerritorialID = Convert.ToInt32(ddlAreaNameAdd.SelectedValue.ToString()); } catch { return; } try { intWorkTime = Convert.ToInt32(txt_Hour.Text.Trim()) * 3600 + Convert.ToInt32(txt_Minute.Text.Trim()) * 60 + Convert.ToInt32(txt_Second.Text.Trim()); } catch { intWorkTime = 3600; } empPostModel.WorkTime = intWorkTime; empPostModel.Remark = txtRemark.Text.Trim(); if (PanelModify.CaptionTitle.Equals("添加员工岗位信息")) //添加 { if (epbll.InsertEmpInfo(empPostModel) > 0) { MessageBox.Show("添加成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); if (!New_DBAcess.IsDouble) { GetEmpPostInfo(); } else { timer1.Stop(); timer1.Start(); } } else { MessageBox.Show("添加失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } else //修改 { if (epbll.UpDataEmpInfo(empPostModel) > 0) { MessageBox.Show("修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); if (!New_DBAcess.IsDouble) { GetEmpPostInfo(); } else { timer1.Stop(); timer1.Start(); } } else { MessageBox.Show("修改失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } } }
public int UpDataEmpInfo(EmpPostModel empPostModel) { return epdal.UpdataEmpInfo(empPostModel); }
public int InsertEmpInfo(EmpPostModel empPostModel) { return epdal.InsertEmpInfo(empPostModel); }