예제 #1
0
        /// <summary>
        /// 查询儿童体检情况基本信息
        /// </summary>
        /// <param name="sqls"></param>
        /// <returns></returns>
        public ProjectGaoweiobj getprojectobj(string sqls)
        {
            DateLogic     dg  = new DateLogic();
            SqlDataReader sdr = null;

            try
            {
                sdr = dg.executequery(sqls);
                ProjectGaoweiobj obj = null;
                if (!sdr.HasRows)
                {
                    return(null);
                }
                else
                {
                    sdr.Read();//读取第一行数据记录
                    obj      = new ProjectGaoweiobj();
                    obj.id   = Convert.ToInt32(sdr["id"]);
                    obj.type = sdr["type"].ToString();
                }
                return(obj);
            }
            catch (Exception ex)
            {
                MessageBox.Show("系统异常,请联系管理员", "软件提示");
                throw ex;
            }
        }
예제 #2
0
        public ArrayList getContentlist(int p_id)
        {
            string        sqls      = "select * from tb_gaoweicontent where p_id=" + p_id;
            DateLogic     dg        = new DateLogic();
            SqlDataReader sdr       = null;
            ArrayList     arraylist = new ArrayList();

            try
            {
                sdr = dg.executequery(sqls);
                ProjectGaoweiobj obj = null;
                while (sdr.Read())
                {
                    obj         = new ProjectGaoweiobj();
                    obj.id      = Convert.ToInt32(sdr["id"]);
                    obj.type    = sdr["p_id"].ToString();
                    obj.content = sdr["content"].ToString();
                    arraylist.Add(obj);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("系统异常,请联系管理员", "软件提示");
                throw ex;
            }

            return(arraylist);
        }
예제 #3
0
        private string Update()
        {
            StringBuilder    buid = new StringBuilder();
            ProjectGaoweiobj obj1 = new ProjectGaoweiobj();

            obj1.content = this.textBoxX1.Text.Trim();
            buid.Append("update tb_gaoweicontent set ");
            buid.Append("content='" + obj1.content + "'");
            buid.Append(" where id=" + _id);
            return(buid.ToString());
        }
예제 #4
0
        private string Add()
        {
            StringBuilder    buid = new StringBuilder();
            ProjectGaoweiobj obj1 = new ProjectGaoweiobj();

            obj1.p_id    = _p_id;
            obj1.cid     = _cid;
            obj1.content = this.textBoxX1.Text.Trim();
            buid.Append("insert into tb_gaoweicontent (");
            buid.Append("p_id");
            //buid.Append(",cid");
            buid.Append(",content");
            buid.Append(") values (");
            buid.Append("" + obj1.p_id + "");
            //buid.Append("" + obj1.cid + "");
            buid.Append(",'" + obj1.content + "')");
            return(buid.ToString());
        }