コード例 #1
0
        private void btnSure_Click(object sender, EventArgs e)
        {
            if (dateTimePicker_Select.Value.Date > Convert.ToDateTime(endDate) ||
                dateTimePicker_Select.Value.Date < Convert.ToDateTime(startDate))
            {
                App.MsgWaring("选择的时间不正确,必选择给定的时间段范围之内的时间!");
                return;
            }


            string time = SelectTime.ToString("yyyy-MM-dd");

            DBControl.IsClear_ChildTemperasure(time, this.pid_ids); //根据时间清除数据
            string title = string.Format("查询时间[{0}]-病人主键[{1}]-病人编号[{2}]-病人姓名[{3}]-床号[{4}]-科室[{5}]-", time, pid_ids, pid, userName, bed_no, section);

            if (Excute() && DBControl.InsertTempers_Others(ExcuteTemperOther()))                      //重新插入数据Remove
            {
                if (Erm != "")
                {
                    DBControl.ErrorLog("体温单保存成功: 操作用户:" + App.UserAccount.UserInfo.User_name, title + Erm);
                }
                App.Msg("数据保存成功");
                list.Clear();
            }
            else
            {
                if (Erm != "")
                {
                    DBControl.ErrorLog("体温单保存失败: 操作用户:" + App.UserAccount.UserInfo.User_name, title + Erm);
                }
                App.Msg("数据保存失败");
                list.Clear();
            }

            //保存页眉信息
            if (this.txtBedNo.Text.Trim().Length > 0)
            {
                string        bedno         = this.txtBedNo.Text.Trim();
                string        diagnose      = string.Empty;
                string        diagnosecount = string.Empty;
                List <string> HeadInfo      = new List <string>();
                string        sql           = string.Empty;
                sql = "delete from t_temperature_pageinfo a where a.patient_id='" + this.pid_ids + "' and pageindex='" + pageindex + "'";
                HeadInfo.Add(sql);
                sql = " insert into t_temperature_pageinfo(id,pageindex,bedno,diagnose,diagnose_count,patient_id)values('" + App.GenId().ToString() + "','" + pageindex + "','" + bedno + "','" + diagnose + "','" + diagnosecount + "','" + pid_ids + "')";
                HeadInfo.Add(sql);
                int count = 0;
                App.ExecuteBatch(HeadInfo.ToArray());
            }
            this.Close();
        }
コード例 #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            /*
             * 相关的操作代码 和 愿体温单录入的操作差不多
             */

            if (dateTimePicker_Select.Value.Date > Convert.ToDateTime(endDate) ||
                dateTimePicker_Select.Value.Date < Convert.ToDateTime(startDate))
            {
                App.MsgWaring("选择的时间不正确,必选择给定的时间段范围之内的时间!");
                return;
            }

            //if (rbEnema.Checked)
            //{
            //    if (txtEnemaCount.Text.Trim() == "")
            //    {
            //        App.Msg("选择灌肠,灌肠次数不能为空!");
            //        return;
            //    }
            //    if (txtEnemaCount.Text.Trim() == "0")
            //    {
            //        App.Msg("选择灌肠,灌肠次数不能为0!");
            //        return;
            //    }
            //    if (txtAfterEnemaShitCount.Text.Trim().Length == 0)
            //    {
            //        App.Msg("选择灌肠,大便次数不能为空!");
            //        return;
            //    }
            //}
            if (rbEnema2.Checked)
            {
                int iEnema = 0;
                int.TryParse(this.cmbEnema.Text.Trim(), out iEnema);
                if (iEnema < 1)
                {
                    App.Msg("选择灌肠,灌肠次数不能小于1");
                    return;
                }
            }

            string time = dateTimePicker_Select.Value.ToString("yyyy-MM-dd");

            DBControl.IsClear_Others(time, this.pid_ids); //根据时间清除数据
            string title = string.Format("查询时间[{0}]-病人主键[{1}]-病人编号[{2}]-病人姓名[{3}]-床号[{4}]-科室[{5}]-", time, pid_ids, pid, "", bed_no, "");

            //list.Add(this.GetTempers(this.pid, this.bed_no, dateTimePicker_Select.Value.ToString("yyyy-MM-dd"), this.pid_ids));


            if (DBControl.InsertTempers_Others(ExcuteTemperOther()))                      //重新插入数据Remove
            {
                if (Erm != "")
                {
                    DBControl.ErrorLog("体温单保存成功: 操作用户:" + App.UserAccount.UserInfo.User_name, title + Erm);
                }
                App.Msg("数据保存成功");
            }
            else
            {
                if (Erm != "")
                {
                    DBControl.ErrorLog("体温单保存失败: 操作用户:" + App.UserAccount.UserInfo.User_name, title + Erm);
                }
                App.Msg("数据保存失败");
            }
            this.Close();
        }
コード例 #3
0
ファイル: PacketException.cs プロジェクト: dongeui/PushServer
        public PacketException(string msg, string e)
        {
            DBControl dbc = new DBControl();

            dbc.ErrorLog(msg, e.ToString());
        }
コード例 #4
0
ファイル: PacketException.cs プロジェクト: dongeui/PushServer
        public PacketException(Packet packet, string msg, System.Exception e)
        {
            DBControl dbc = new DBControl();

            dbc.ErrorLog(packet.CustomerID, msg, e.ToString(), packet.PhoneNum);
        }
コード例 #5
0
ファイル: ucTemperWrite.cs プロジェクト: zh7262703/Emr_MySql
        private void btnSure_Click(object sender, EventArgs e)
        {
            if (dateTimePicker_Select.Value.Date > sysTime.Date || dateTimePicker_Select.Value.Date > Convert.ToDateTime(endDate) ||
                dateTimePicker_Select.Value.Date < Convert.ToDateTime(startDate))
            {
                App.MsgWaring("选择的日期不正确,只能选择当前页七天的日期范围,并且不能超过当前日期,否则无法保存!");
                return;
            }

            string   time   = SelectTime.ToString("yyyy-MM-dd");
            DateTime dtTime = SelectTime;

            //体温根据时间点段 前2小时,后1小时59分 清除数据
            DBControl.IsClear_Temperasure_Time(SelectTime, this.pid_ids);
            DBControl.IsClear_Others(time, this.pid_ids);
            string title = string.Format("查询时间[{0}]-病人主键[{1}]-病人编号[{2}]-病人姓名[{3}]-床号[{4}]-科室[{5}]-", time, pid_ids, pid, userName, bed_no, section);

            if (Excute() && DBControl.InsertTempers_Others(ExcuteTemperOther()) && PageInfoRefresh())                      //重新插入数据Remove
            {
                if (Erm != "")
                {
                    DBControl.ErrorLog("体温单保存成功: 操作用户:" + App.UserAccount.UserInfo.User_name, title + Erm);
                }
                App.Msg("数据保存成功");
                list.Clear();
            }
            else
            {
                if (Erm != "")
                {
                    DBControl.ErrorLog("体温单保存失败: 操作用户:" + App.UserAccount.UserInfo.User_name, title + Erm);
                }
                App.Msg("数据保存失败");
                list.Clear();
            }


            //刷新体温单
            if (A_RefleshTemprature != null)
            {
                A_RefleshTemprature(sender, e);
                setOldDateTime(dtTime);
            }

            //保存页眉信息
            //if (this.txtbedno.Text.Trim().Length > 0 || txtDiagnose.Text.Trim().Length > 0)
            //{
            //    string bedno = this.txtbedno.Text.Trim();
            //    string section_name = string.Empty;
            //    //section_name = cmbSection.SelectedValue.ToString();
            //    //section_name = txtSection.Text;
            //    string diag = txtDiagnose.Text.Trim();
            //    List<string> HeadInfo = new List<string>();
            //    string sql = string.Empty;
            //    sql = "delete from t_temperature_pageinfo a where a.patient_id='" + this.pid_ids + "' and pageindex='" + pageindex + "'";
            //    HeadInfo.Add(sql);
            //    sql = " insert into t_temperature_pageinfo(id,pageindex,bedno,diagnose,diagnose_count,section_name,patient_id)values('" + App.GenId().ToString() + "','" + pageindex + "','" + bedno + "','" + diag + "','" + DiagnoseCount + "','" + section_name + "','" + pid_ids + "')";
            //    HeadInfo.Add(sql);
            //    int count = 0;
            //    if (App.ExecuteBatch(HeadInfo.ToArray()) > 0)
            //    {
            //        ucTempratureEdit.RefreshHeader(this.pid_ids, pageindex,Convert.ToDateTime(startDate), Convert.ToDateTime(endDate));
            //    }
            //}

            #region 手术质控信息
            List <string> Operations = new List <string>();
            if (this.oldOperations.Count > 0 || this.newOperations.Count > 0)
            {
                string beforeOperation = "";
                string afterOperation  = "";
                if (string.IsNullOrEmpty(age))
                {
                    age = App.ReadSqlVal("select age from t_in_patient where id='" + pid_ids + "'", 0, "age");
                }
                foreach (string var in this.oldOperations)
                {
                    if (newOperations.Exists(delegate(string s) { return(s == var); }))
                    {
                        continue;
                    }
                    else
                    {
                        beforeOperation = "insert into t_job_temp(PID,OPERATE_TYPE,OPERATE_TIME,PATIENT_ID,age,EVENT_TYPE,ywcstate) values('" + pid + "','术前',to_timestamp('" + var.Split(',')[0] + "','syyyy-mm-dd hh24:mi:ss')," + pid_ids + ",'" + age + "','-','1')";
                        afterOperation  = "insert into t_job_temp(PID,OPERATE_TYPE,OPERATE_TIME,PATIENT_ID,age,EVENT_TYPE,ywcstate) values('" + pid + "','术后',to_timestamp('" + var.Split(',')[1] + "','syyyy-mm-dd hh24:mi:ss')," + pid_ids + ",'" + age + "','-','1')";
                        Operations.Add(beforeOperation);
                        Operations.Add(afterOperation);
                    }
                }

                foreach (string var in newOperations)
                {
                    if (oldOperations.Exists(delegate(string s) { return(s == var); }))
                    {
                        continue;
                    }
                    else
                    {
                        beforeOperation = "insert into t_job_temp(PID,OPERATE_TYPE,OPERATE_TIME,PATIENT_ID,age,EVENT_TYPE,ywcstate) values('" + pid + "','术前',to_timestamp('" + var.Split(',')[0] + "','syyyy-mm-dd hh24:mi:ss')," + pid_ids + ",'" + age + "','','1')";
                        afterOperation  = "insert into t_job_temp(PID,OPERATE_TYPE,OPERATE_TIME,PATIENT_ID,age,EVENT_TYPE,ywcstate) values('" + pid + "','术后',to_timestamp('" + var.Split(',')[1] + "','syyyy-mm-dd hh24:mi:ss')," + pid_ids + ",'" + age + "','','1')";
                        Operations.Add(beforeOperation);
                        Operations.Add(afterOperation);
                    }
                }

                if (Operations.Count > 0)
                {
                    App.ExecuteBatch(Operations.ToArray());
                }
            }

            #endregion
        }