private void OK() { IBLL.IPeople bll = new BLL.PeopleBLL(); if (people == null || string.IsNullOrEmpty(people.oper_id)) { //添加 bi_t_people_info peo = new bi_t_people_info() { oper_id = txtOperId.Text, oper_name = txtOperName.Text, oper_status = cbStatus.SelectedValue.ToString(), birthday = dtpBirthday.Value, dept_no = cbDept.SelectedValue.ToString(), in_date = dtpIn.Value, tel = txtTel.Text, }; bll.Add(peo); } else { //修改 people.oper_name = txtOperName.Text; people.tel = txtTel.Text; people.birthday = dtpBirthday.Value; people.in_date = dtpIn.Value; people.oper_status = cbStatus.SelectedValue.ToString(); people.dept_no = cbDept.SelectedValue.ToString(); bll.Update(people); } }
public Model.bi_t_people_info GetItem(string oper_id) { JsonRequest r = new JsonRequest(); r.Write("oper_id", oper_id); r.request("/people?t=get_item"); if (!r.ReadSuccess()) { throw new Exception(r.ReadMessage()); } bi_t_people_info peo = r.GetObject <bi_t_people_info>(); return(peo); }