private ChildGaoweigeanRecordObj getgaoweirecordObj() { ChildGaoweigeanRecordObj gaoweirecordobj = new ChildGaoweigeanRecordObj(); gaoweirecordobj.id = _checkobj.gaoweirecordobj.id; gaoweirecordobj.checkid = _checkobj.Id; gaoweirecordobj.childId = _checkobj.ChildId; gaoweirecordobj.pingufangfa = textBoxX12.Text; gaoweirecordobj.pingujieguo = textBoxX1.Text; gaoweirecordobj.zhidao = textBoxX2.Text; gaoweirecordobj.chuli = textBoxX3.Text; return(gaoweirecordobj); }
public bool saveXinlixingweirecord(ChildGaoweigeanRecordObj gaoweirecordobj) { try { string sqls = ""; if (gaoweirecordobj.id != 0) { sqls = "update child_xinlixingwei_record set " + " childId = " + gaoweirecordobj.childId + " ,checkid = " + gaoweirecordobj.checkid + " ,pingufangfa = '" + gaoweirecordobj.pingufangfa + "'" + " ,pingujieguo = '" + gaoweirecordobj.pingujieguo + "'" + " ,zhidao = '" + gaoweirecordobj.zhidao + "'" + " ,chuli = '" + gaoweirecordobj.chuli + "'" + " where id= " + gaoweirecordobj.id; } else { sqls = "insert into child_xinlixingwei_record (" + "childId" + ",checkid" + ",pingufangfa" + ",pingujieguo" + ",zhidao" + ",chuli" + " ) values ( " + "" + gaoweirecordobj.childId + "" + "," + gaoweirecordobj.checkid + "" + ",'" + gaoweirecordobj.pingufangfa + "'" + ",'" + gaoweirecordobj.pingujieguo + "'" + ",'" + gaoweirecordobj.zhidao + "'" + ",'" + gaoweirecordobj.chuli + "'" + ")"; } if (dg.executeupdate(sqls) > 0) { return(true); } else { return(false); } } catch (Exception ex) { MessageBox.Show("保存失败", "软件提示"); throw ex; } }
private void buttonX4_Click(object sender, EventArgs e) { ChildGaoweigeanRecordObj gaoweirecordobj = getgaoweirecordObj(); if (gaoweirecordbll.saveGaoweigeanrecord(gaoweirecordobj)) { MessageBox.Show("保存成功!"); this.Close(); _gaoweizhuananpanel.refreshRecordList(); } else { MessageBox.Show("保存失败!请联系管理员"); } }