Ejemplo n.º 1
0
        private ChildYingyanggeanRecordObj getyingyangrecordObj()
        {
            ChildYingyanggeanRecordObj yingyangrecordobj = new ChildYingyanggeanRecordObj();

            yingyangrecordobj.id      = _checkobj.yingyangrecordobj.id;
            yingyangrecordobj.checkid = _checkobj.Id;
            yingyangrecordobj.childId = _checkobj.ChildId;

            yingyangrecordobj.pinggu  = textBoxX12.Text;
            yingyangrecordobj.problem = textBoxX6.Text;
            yingyangrecordobj.zhidao  = textBoxX2.Text;
            return(yingyangrecordobj);
        }
Ejemplo n.º 2
0
        private void buttonX4_Click(object sender, EventArgs e)
        {
            ChildYingyanggeanRecordObj yingyangrecordobj = getyingyangrecordObj();

            if (yingyangrecordbll.saveYingyanggeanrecord(yingyangrecordobj))
            {
                MessageBox.Show("保存成功!");
                this.Close();
                _yingyangzhuananpanel.refreshRecordList();
            }
            else
            {
                MessageBox.Show("保存失败!请联系管理员");
            }
        }
        public bool savejibingguanlirecord(ChildYingyanggeanRecordObj yingyangrecordobj)
        {
            try
            {
                string sqls = "";
                if (yingyangrecordobj.id != 0)
                {
                    sqls = "update child_jibingguanli_record set "
                           + " childId = " + yingyangrecordobj.childId
                           + " ,checkid = " + yingyangrecordobj.checkid
                           + " ,pinggu = '" + yingyangrecordobj.pinggu + "'"
                           + " ,problem = '" + yingyangrecordobj.problem + "'"
                           + " ,zhidao = '" + yingyangrecordobj.zhidao + "'"
                           + " where id= " + yingyangrecordobj.id;
                }
                else
                {
                    sqls = "insert into child_jibingguanli_record ("
                           + "childId"
                           + ",checkid"
                           + ",pinggu"
                           + ",problem"
                           + ",zhidao"
                           + " ) values ( "
                           + "" + yingyangrecordobj.childId + ""
                           + "," + yingyangrecordobj.checkid + ""
                           + ",'" + yingyangrecordobj.pinggu + "'"
                           + ",'" + yingyangrecordobj.problem + "'"
                           + ",'" + yingyangrecordobj.zhidao + "'"
                           + ")";
                }

                if (dg.executeupdate(sqls) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败", "软件提示");
                throw ex;
            }
        }