//保存
        public bool saveGaoweigeanrecord(ChildGaoweigeanRecordObj gaoweirecordobj)
        {
            try
            {
                string sqls = "";
                if (gaoweirecordobj.id != 0)
                {
                    sqls = "update child_gaoweigean_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_gaoweigean_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;
            }
        }
Exemple #2
0
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOk_Click(object sender, EventArgs e)
        {
            string strSql = "";
            int    premax = 0;

            if (String.IsNullOrEmpty(pre_max.Text))
            {
                MessageBox.Show("请填写后再保存!", "软件提示");
                return;
            }

            if (!Int32.TryParse(pre_max.Text, out premax))
            {
                MessageBox.Show("只能为数字!", "软件提示");
                return;
            }

            strSql = "Update tb_users Set pre_max = '" + pre_max.Text + "' Where user_code = '" +
                     globalInfoClass.UserCode + "'";

            int i = dg.executeupdate(strSql);

            if (i > 0)
            {
                globalInfoClass.Pre_Max = premax;
                MessageBox.Show("修改成功!", "软件提示");
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                return;
            }
            else
            {
                MessageBox.Show("修改失败", "软件提示");
            }
        }
        //保存
        public bool saveYingyanggeanrecord(ChildYingyanggeanRecordObj yingyangrecordobj)
        {
            try
            {
                string sqls = "";
                if (yingyangrecordobj.id != 0)
                {
                    sqls = "update child_yingyanggean_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_yingyanggean_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;
            }
        }
Exemple #4
0
        //保存
        public bool savePinxuegeanrecord(ChildPinxuegeanRecordObj pinxuerecordobj)
        {
            try
            {
                string sqls = "";
                if (pinxuerecordobj.id != 0)
                {
                    sqls = "update child_pinxuegean_record set "
                           + " childId = " + pinxuerecordobj.childId
                           + " ,checkid = " + pinxuerecordobj.checkid
                           + " ,hb = '" + pinxuerecordobj.hb + "'"
                           + " ,problem = '" + pinxuerecordobj.problem + "'"
                           + " ,zhiliao = '" + pinxuerecordobj.zhiliao + "'"
                           + " ,yaowu = '" + pinxuerecordobj.yaowu + "'"
                           + " ,jiliang = '" + pinxuerecordobj.jiliang + "'"
                           + " ,zhidao = '" + pinxuerecordobj.zhidao + "'"
                           + " where id= " + pinxuerecordobj.id;
                }
                else
                {
                    sqls = "insert into child_pinxuegean_record ("
                           + "childId"
                           + ",checkid"
                           + ",hb"
                           + ",problem"
                           + ",zhiliao"
                           + ",yaowu"
                           + ",jiliang"
                           + ",zhidao"
                           + " ) values ( "
                           + "" + pinxuerecordobj.childId + ""
                           + "," + pinxuerecordobj.checkid + ""
                           + ",'" + pinxuerecordobj.hb + "'"
                           + ",'" + pinxuerecordobj.problem + "'"
                           + ",'" + pinxuerecordobj.zhiliao + "'"
                           + ",'" + pinxuerecordobj.yaowu + "'"
                           + ",'" + pinxuerecordobj.jiliang + "'"
                           + ",'" + pinxuerecordobj.zhidao + "'"
                           + ")";
                }

                if (dg.executeupdate(sqls) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败", "软件提示");
                throw ex;
            }
        }
        //保存
        public bool saveGoulougeanrecord(ChildGoulougeanRecordObj goulourecordobj)
        {
            try
            {
                string sqls = "";
                if (goulourecordobj.id != 0)
                {
                    sqls = "update child_goulougean_record set "
                           + " childId = " + goulourecordobj.childId
                           + " ,checkid = " + goulourecordobj.checkid
                           + " ,huwai = '" + goulourecordobj.huwai + "'"
                           + " ,problem = '" + goulourecordobj.problem + "'"
                           + " ,vitdname = '" + goulourecordobj.vitdname + "'"
                           + " ,vitdliang = '" + goulourecordobj.vitdliang + "'"
                           + " ,zhidao = '" + goulourecordobj.zhidao + "'"
                           + " where id= " + goulourecordobj.id;
                }
                else
                {
                    sqls = "insert into child_goulougean_record ("
                           + "childId"
                           + ",checkid"
                           + ",huwai"
                           + ",problem"
                           + ",vitdname"
                           + ",vitdliang"
                           + ",zhidao"
                           + " ) values ( "
                           + "" + goulourecordobj.childId + ""
                           + "," + goulourecordobj.checkid + ""
                           + ",'" + goulourecordobj.huwai + "'"
                           + ",'" + goulourecordobj.problem + "'"
                           + ",'" + goulourecordobj.vitdname + "'"
                           + ",'" + goulourecordobj.vitdliang + "'"
                           + ",'" + goulourecordobj.zhidao + "'"
                           + ")";
                }

                if (dg.executeupdate(sqls) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败", "软件提示");
                throw ex;
            }
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="sqls"></param>
        /// <returns></returns>
        public int deleterecord(string sqls)
        {
            DateLogic dg = new DateLogic();

            try
            {
                return(dg.executeupdate(sqls));
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败", "软件提示");
                throw ex;
            }
        }
        //保存
        public bool saveMoban(mobanManageObj mobanobj)
        {
            try
            {
                string sqls = "";
                if (mobanobj.id != 0)
                {
                    sqls = "update tb_moban set "
                           + " m_name = '" + mobanobj.m_name + "'"
                           + " ,m_type = '" + mobanobj.m_type + "'"
                           + " ,m_content = N'" + mobanobj.m_content + "'"
                           + " ,yf = '" + mobanobj.yf + "'"
                           + " ,yfend = '" + mobanobj.yfend + "'"
                           + " where id= " + mobanobj.id;
                }
                else
                {
                    sqls = "insert into tb_moban ("
                           + "m_name"
                           + ",m_type"
                           + ",m_content"
                           + ",yf"
                           + ",yfend"
                           + " ) values ( "
                           + "'" + mobanobj.m_name + "'"
                           + ",'" + mobanobj.m_type + "'"
                           + ",N'" + mobanobj.m_content + "'"
                           + ",'" + mobanobj.yf + "'"
                           + ",'" + mobanobj.yfend + "'"
                           + ")";
                }

                if (dg.executeupdate(sqls) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败", "软件提示");
                throw ex;
            }
        }
 //保存
 public bool saverecord(string sqls)
 {
     try
     {
         if (dg.executeupdate(sqls) > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("保存失败", "软件提示");
         throw ex;
     }
 }
Exemple #9
0
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOk_Click(object sender, EventArgs e)
        {
            string strSql = "";

            if (String.IsNullOrEmpty(txt_oldPwd.Text) || String.IsNullOrEmpty(txt_newPwd.Text) || String.IsNullOrEmpty(txt_okNewPwd.Text))
            {
                MessageBox.Show("请填写完整!", "软件提示");
                return;
            }
            if (txt_oldPwd.Text != globalInfoClass.PassWord)
            {
                MessageBox.Show("原密码输入错误!", "软件提示");
                this.txt_oldPwd.Focus();
                return;
            }
            if (txt_newPwd.Text != txt_okNewPwd.Text)
            {
                MessageBox.Show("新密码输入不一致!", "软件提示");
                this.txt_okNewPwd.Focus();
                return;
            }

            strSql = "Update SYS_USERS Set PassWord = '******' Where user_code = '" +
                     globalInfoClass.UserCode + "'";

            int i = dg.executeupdate(strSql);

            if (i > 0)
            {
                MessageBox.Show("修改密码成功!", "软件提示");
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                return;
            }
            else
            {
                MessageBox.Show("修改密码失败", "软件提示");
            }
        }
        //保存
        public void saveOrdeleteGaowei(string gaoweistr, string gaoweitime)
        {
            if (!String.IsNullOrEmpty(gaoweistr))
            {
                try
                {
                    string        delsqlstr = "select * from tb_gaowei where gaoweiyinsu not in(" + gaoweistr + ") and childId= " + globalInfoClass.Wm_Index;
                    SqlDataReader sdr       = dg.executequery(delsqlstr);
                    if (sdr.HasRows)
                    {
                        string delstr = "delete from tb_gaowei where gaoweiyinsu not in(" + gaoweistr + ") and childId= " + globalInfoClass.Wm_Index;
                        while (sdr.Read())
                        {
                            string insertrecordsql = "insert into tb_gaowei_record ("
                                                     + "childId"
                                                     + ",gaoweiyinsu"
                                                     + ",recordtime"
                                                     + ",status"
                                                     + ",doctorName"
                                                     + " ) values ( "
                                                     + "," + globalInfoClass.Wm_Index + ""
                                                     + ",'" + sdr["gaoweiyinsu"] + "'"
                                                     + ",'" + gaoweitime + "'"
                                                     + ",'取消'"
                                                     + ",'" + globalInfoClass.UserName + "'"
                                                     + ")";
                            dg.executeupdate(insertrecordsql);
                        }
                    }

                    string[] gaoweistrargs = gaoweistr.Split(',');
                    for (int i = 0; i < gaoweistrargs.Length; i++)
                    {
                        string selstr = "select * from tb_gaowei where gaoweiyinsu ='" + gaoweistrargs[i] + "' and childId= " + globalInfoClass.Wm_Index;
                        if (ifhascount(selstr))
                        {
                            string insertsql = "insert into tb_gaowei ("
                                               + "childId"
                                               + ",gaoweiyinsu"
                                               + ",recordtime"
                                               + ",type"
                                               + ",doctorName"
                                               + " ) values ( "
                                               + "," + globalInfoClass.Wm_Index + ""
                                               + ",'" + gaoweistrargs[i] + "'"
                                               + ",'" + gaoweitime + "'"
                                               + ",'" + getgaoweitype(gaoweistrargs[i]) + "'"
                                               + ",'" + globalInfoClass.UserName + "'"
                                               + ")";
                            dg.executeupdate(insertsql);
                            string insertrecordsql = "insert into tb_gaowei_record ("
                                                     + "childId"
                                                     + ",gaoweiyinsu"
                                                     + ",recordtime"
                                                     + ",status"
                                                     + ",doctorName"
                                                     + " ) values ( "
                                                     + "," + globalInfoClass.Wm_Index + ""
                                                     + ",'" + gaoweistrargs[i] + "'"
                                                     + ",'" + gaoweitime + "'"
                                                     + ",'新增'"
                                                     + ",'" + globalInfoClass.UserName + "'"
                                                     + ")";
                            dg.executeupdate(insertrecordsql);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("保存失败", "软件提示");
                    throw ex;
                }
            }
        }
Exemple #11
0
        //保存
        public bool saveYingyanggeanObj(ChildYingyanggeanObj yingyanggeanobj)
        {
            try
            {
                string selstr = "select * from child_yingyanggean where childid=" + yingyanggeanobj.childId;
                string sqls   = "";
                if (ifhascount(selstr))
                {
                    sqls = "insert into child_yingyanggean ("
                           + "childId"
                           + ",jiwangshi"
                           + ",endtime"
                           + ",managetime"
                           + ",zhuangui"
                           + ",chushengshi"
                           + ",weiyangshi"
                           + ",foodchange"

                           + ",yunzhou"
                           + ",yuntian"
                           + ",hb"
                           + ",tieji"
                           + ",yaowu"
                           + ",jiliang"
                           + ",liaocheng"
                           + ",muru"
                           + ",foodage"

                           + ",buruqi"
                           + ",childvitd"
                           + ",startvitdmonth"
                           + ",startvitdday"
                           + ",vitdname"
                           + ",vitdliang"
                           + ",tizheng"
                           + ",xuegai"
                           + ",xuelin"
                           + ",xueakp"
                           + ",xueoh"
                           + ",xjiancha"

                           + ",recordtime"
                           + ",recordname"
                           + " ) values ( "
                           + "" + yingyanggeanobj.childId + ""
                           + ",'" + yingyanggeanobj.jiwangshi + "'"
                           + ",'" + yingyanggeanobj.endtime + "'"
                           + ",'" + yingyanggeanobj.managetime + "'"
                           + ",'" + yingyanggeanobj.zhuangui + "'"
                           + ",'" + yingyanggeanobj.chushengshi + "'"
                           + ",'" + yingyanggeanobj.weiyangshi + "'"
                           + ",'" + yingyanggeanobj.foodchange + "'"

                           + ",'" + yingyanggeanobj.yunzhou + "'"
                           + ",'" + yingyanggeanobj.yuntian + "'"
                           + ",'" + yingyanggeanobj.hb + "'"
                           + ",'" + yingyanggeanobj.tieji + "'"
                           + ",'" + yingyanggeanobj.yaowu + "'"
                           + ",'" + yingyanggeanobj.jiliang + "'"
                           + ",'" + yingyanggeanobj.liaocheng + "'"
                           + ",'" + yingyanggeanobj.muru + "'"
                           + ",'" + yingyanggeanobj.foodage + "'"

                           + ",'" + yingyanggeanobj.buruqi + "'"
                           + ",'" + yingyanggeanobj.childvitd + "'"
                           + ",'" + yingyanggeanobj.startvitdmonth + "'"
                           + ",'" + yingyanggeanobj.startvitdday + "'"
                           + ",'" + yingyanggeanobj.vitdname + "'"
                           + ",'" + yingyanggeanobj.vitdliang + "'"
                           + ",'" + yingyanggeanobj.tizheng + "'"
                           + ",'" + yingyanggeanobj.xuegai + "'"
                           + ",'" + yingyanggeanobj.xuelin + "'"
                           + ",'" + yingyanggeanobj.xueakp + "'"
                           + ",'" + yingyanggeanobj.xueoh + "'"
                           + ",'" + yingyanggeanobj.xjiancha + "'"

                           + ",'" + yingyanggeanobj.recordtime + "'"
                           + ",'" + yingyanggeanobj.recordname + "'"
                           + ")";
                }
                else
                {
                    sqls = "update child_yingyanggean set "
                           + " jiwangshi = '" + yingyanggeanobj.jiwangshi + "'"
                           + " ,endtime = '" + yingyanggeanobj.endtime + "'"
                           + " ,managetime = '" + yingyanggeanobj.managetime + "'"
                           + " ,zhuangui = '" + yingyanggeanobj.zhuangui + "'"
                           + " ,chushengshi = '" + yingyanggeanobj.chushengshi + "'"
                           + " ,weiyangshi = '" + yingyanggeanobj.weiyangshi + "'"
                           + " ,foodchange = '" + yingyanggeanobj.foodchange + "'"

                           + " ,yunzhou = '" + yingyanggeanobj.yunzhou + "'"
                           + " ,yuntian = '" + yingyanggeanobj.yuntian + "'"
                           + " ,hb = '" + yingyanggeanobj.hb + "'"
                           + " ,tieji = '" + yingyanggeanobj.tieji + "'"
                           + " ,yaowu = '" + yingyanggeanobj.yaowu + "'"
                           + " ,jiliang = '" + yingyanggeanobj.jiliang + "'"
                           + " ,liaocheng = '" + yingyanggeanobj.liaocheng + "'"
                           + " ,muru = '" + yingyanggeanobj.muru + "'"
                           + " ,foodage = '" + yingyanggeanobj.foodage + "'"

                           + " ,buruqi = '" + yingyanggeanobj.buruqi + "'"
                           + " ,childvitd = '" + yingyanggeanobj.childvitd + "'"
                           + " ,startvitdmonth = '" + yingyanggeanobj.startvitdmonth + "'"
                           + " ,startvitdday = '" + yingyanggeanobj.startvitdday + "'"
                           + " ,vitdname = '" + yingyanggeanobj.vitdname + "'"
                           + " ,vitdliang = '" + yingyanggeanobj.vitdliang + "'"
                           + " ,tizheng = '" + yingyanggeanobj.tizheng + "'"
                           + " ,xuegai = '" + yingyanggeanobj.xuegai + "'"
                           + " ,xuelin = '" + yingyanggeanobj.xuelin + "'"
                           + " ,xueakp = '" + yingyanggeanobj.xueakp + "'"
                           + " ,xueoh = '" + yingyanggeanobj.xueoh + "'"
                           + " ,xjiancha = '" + yingyanggeanobj.xjiancha + "'"

                           + " ,recordtime = '" + yingyanggeanobj.recordtime + "'"
                           + " ,recordname = '" + yingyanggeanobj.recordname + "'"
                           + " where childId= " + yingyanggeanobj.childId;
                }

                if (dg.executeupdate(sqls) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败", "软件提示");
                throw ex;
            }
        }
Exemple #12
0
        private void button1_Click(object sender, EventArgs e)
        {
            string        sqls = "select * from temp1 ";
            DateLogic     dg   = new DateLogic();
            SqlDataReader sdr  = dg.executequery(sqls);

            if (sdr.HasRows)
            {
                while (sdr.Read())
                {
                    string[] bb = sdr["aaaa"].ToString().Split(' ');
                    string[] dd = new string[20];
                    int      j  = 0;
                    for (int i = 0; i < bb.Length; i++)
                    {
                        if (!String.IsNullOrEmpty(bb[i]))
                        {
                            dd[j] = bb[i];
                            j++;
                        }
                    }
                    string insertsql = "insert into who_childstand_day ("
                                       + " tian "
                                       + " ,l "
                                       + " ,m "
                                       + " ,s "
                                       + " ,p01 "
                                       + " ,p1 "
                                       + " ,p3 "
                                       + " ,p5 "
                                       + " ,p10 "
                                       + " ,p15 "
                                       + " ,p25 "
                                       + " ,p50 "
                                       + " ,p75 "
                                       + " ,p85 "
                                       + " ,p90 "
                                       + " ,p95 "
                                       + " ,p97 "
                                       + " ,p99 "
                                       + " ,p999 "
                                       + " ,sex "
                                       + " ,ptype "
                                       + " ) values ("
                                       + "'" + dd[0] + "'"
                                       + ",'" + dd[1] + "'"
                                       + ",'" + dd[2] + "'"
                                       + ",'" + dd[3] + "'"
                                       + ",'" + dd[4] + "'"
                                       + ",'" + dd[5] + "'"
                                       + ",'" + dd[6] + "'"
                                       + ",'" + dd[7] + "'"
                                       + ",'" + dd[8] + "'"
                                       + ",'" + dd[9] + "'"
                                       + ",'" + dd[10] + "'"
                                       + ",'" + dd[11] + "'"
                                       + ",'" + dd[12] + "'"
                                       + ",'" + dd[13] + "'"
                                       + ",'" + dd[14] + "'"
                                       + ",'" + dd[15] + "'"
                                       + ",'" + dd[16] + "'"
                                       + ",'" + dd[17] + "'"
                                       + ",'" + dd[18] + "'"
                                       + ",'" + textBox1.Text + "'"
                                       + ",'" + textBox2.Text + "'"
                                       + ")";
                    dg.executeupdate(insertsql);
                }
            }
            MessageBox.Show("转换完成");
            //string aa = "24      1       87.1161 0.03507 3.0551  77.7    80      81.4    82.1    83.2    83.9    85.1    87.1    89.2    90.3    91      92.1    92.9    94.2    ";
        }