Exemplo n.º 1
0
        private void 修改ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            updateFlag = true;

            Con_ClearCntrValue.ClearCntrValue(this.gpbFixTime, true);

            if (lvwQualitys.SelectedItems.Count > 0)
            {
                Class_Quality_HLB_View q = (Class_Quality_HLB_View)lvwQualitys.SelectedItems[0].Tag;
                chp.Id              = q.Id;
                cboTextKind.Text    = q.Document_Type;        //文书类型
                cboMonitoring.Text  = q.Sub_Item;             //监控子项
                cboMonitorType.Text = q.Inpatient_Type;       //患者类型
                txtExceTimes.Text   = q.ExceTimes.ToString(); //执行次数
                cboCKTime.Text      = q.Base_Time;            //参考时间
                txtExecCycles.Text  = q.Runcycle.ToString();  //执行周期
                cboCyclesUnit.Text  = q.Runcycleunit;         //执行周期单位
                txtItemMax.Text     = q.Item_Max.ToString();  //项目最大值
                txtItemMin.Text     = q.Item_Min.ToString();  //项目最小值

                if (q.Isprealert == "是")
                {
                    rdoIsOverAlert.Checked  = true;
                    rdoIsOverAlertF.Checked = false;
                    txtPrealertTime.Text    = q.Prealerttime.ToString(); //预警时间
                    cboPrealertUnit.Text    = q.Pretimeunit;             //单位
                }
                else
                {
                    rdoIsOverAlert.Checked  = false;
                    rdoIsOverAlertF.Checked = true;
                }

                if (q.Is_Renew == "是")
                {
                    rdoIsMend.Checked  = true;
                    rdoIsMendF.Checked = false;
                    txtDeduction.Text  = q.Take_Grade.ToString();//扣分值
                }
                else
                {
                    rdoIsMend.Checked  = false;
                    rdoIsMendF.Checked = true;
                }

                if (q.Is_Notice == "是")
                {
                    rdoIsNotice.Checked = true;//是否提醒
                }
                else
                {
                    rdoIsNotice.Checked = false;
                }


                if (q.Istoday == "是")
                {
                    rdoIsCheck.Checked = true;//是否当天检查一次
                }
                else
                {
                    rdoIsCheck.Checked = false;
                }

                if (txtExceTimes.Text != "")
                {
                    txtExceTimes.Enabled = true;
                }

                Con_CheckBoxListUtil.SetCheck(gpbFixTime, q.Fix_Time);
            }
            else
            {
                App.MsgErr("请选择一条修改的记录");
                ResetAll();
            }
        }
Exemplo n.º 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (chkSectionListBox.CheckedItems.Count <= 0)
            {
                //老代码注释掉
                //App.MsgErr("请选择科室");
                //return;

                #region 消息提醒使用
                if (strT_Msg_Setting == 3)
                {
                    App.MsgErr("请选择病区");
                    return;
                }
                else
                {
                    App.MsgErr("请选择科室");
                    return;
                }
                #endregion
            }

            if (id != null)
            {
                ywcSectionID = Con_CheckBoxListUtil.GetCheckedItems(chkSectionListBox);
                string tempUpdate = "update t_quality_var_ywc t set t.effect_section='" + ywcSectionID + "' where t.id=" + id;

                int          i            = 0;
                DialogResult resultUpdate = MessageBox.Show("确认要保存已修改的数据?", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                if (resultUpdate == DialogResult.OK)
                {
                    i = App.ExecuteSQL(tempUpdate);
                }
                else
                {
                    return;
                }

                if (i > 0)
                {
                    App.Msg("数据修改成功!");
                    ShowUpdate(true);
                    this.Close();
                    return;
                }
                else
                {
                    App.MsgErr("数据修改失败!");
                    return;
                }
            }
            else
            {
                DialogResult resultInsert = MessageBox.Show("确认要保存数据?", "消息", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (resultInsert == DialogResult.OK)
                {
                    //老代码注释掉
                    //ywcSectionID = Con_CheckBoxListUtil.GetCheckedItems(chkSectionListBox);
                    //ywcSectionName = Con_CheckBoxListUtil.GetCheckedItemsValue(chkSectionListBox);
                    //ShowTextBoxValue();
                    //this.Close();
                    #region  消息提醒使用
                    flag = true;//消息提醒
                    if (strT_Msg_Setting != 1 && strT_Msg_Setting != 2 && strT_Msg_Setting != 3)
                    {
                        ywcSectionID   = Con_CheckBoxListUtil.GetCheckedItems(chkSectionListBox);
                        ywcSectionName = Con_CheckBoxListUtil.GetCheckedItemsValue(chkSectionListBox);
                        ShowTextBoxValue();
                        this.Close();
                    }
                    else//消息提醒使用
                    {
                        ywcSectionID   = Con_CheckBoxListUtil.GetCheckedItems(chkSectionListBox);
                        ywcSectionName = Con_CheckBoxListUtil.GetCheckedItemsValue(chkSectionListBox);
                        this.Close();
                    }

                    #endregion
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 保存参数设置
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!updateFlag)
            {
                ////ID自增设置
                chp.Id = App.GenId("T_QUALITY_VAR_HLB", "ID");
            }

            //文书类型
            if (cboTextKind.SelectedIndex != 0)
            {
                chp.Document_Type = Convert.ToInt32(this.cboTextKind.SelectedValue.ToString());
            }
            else
            {
                App.MsgErr("请选择文书类型");
                return;
            }

            //监控子项
            if (this.cboMonitoring.Enabled == false)
            {
                chp.Sub_Item = 0;
            }
            else
            {
                chp.Sub_Item = Convert.ToInt32(this.cboMonitoring.SelectedValue.ToString());
            }

            //监控患者类型
            if (cboMonitorType.SelectedIndex != 0)
            {
                chp.Inpatient_Type = Convert.ToInt32(this.cboMonitorType.SelectedValue.ToString());
            }
            else
            {
                App.MsgErr("请选择监控患者类型");
                return;
            }

            //执行周期
            if (txtExecCycles.Enabled == true && cboCyclesUnit.Enabled == true)
            {
                if (txtExecCycles.Text == "" || txtExecCycles.Text == null || cboCyclesUnit.SelectedItem.ToString() == "" || cboCyclesUnit.SelectedItem.ToString() == null)
                {
                    App.MsgErr("请输入执行周期");
                    return;
                }
                chp.Runcycle     = Convert.ToInt32(txtExecCycles.Text);
                chp.Runcycleunit = cboCyclesUnit.SelectedItem.ToString();
            }
            else
            {
                chp.Runcycle     = 0;
                chp.Runcycleunit = "";
            }

            //参考时间
            if (cboCKTime.SelectedIndex != 0)
            {
                chp.Base_Time = Convert.ToInt32(this.cboCKTime.SelectedValue.ToString());
            }
            else
            {
                App.MsgErr("请选择参考时间");
                return;
            }


            //是否预警
            if (this.rdoIsOverAlert.Checked == true)
            {
                chp.Isprealert = 'Y';
            }
            else
            {
                chp.Isprealert = 'N';
            }


            //超时补上是否扣分
            if (this.rdoIsMend.Checked == true)
            {
                chp.Is_Renew = 'Y';
            }
            else
            {
                chp.Is_Renew = 'N';
            }

            //是否当天检查一次
            if (this.rdoIsCheck.Checked == true)
            {
                chp.Istoday = 'Y'; //是
            }
            else
            {
                chp.Istoday = 'N';
            }



            if (this.txtPrealertTime.Enabled == true)
            {
                //预警时间
                if (this.txtPrealertTime.Text != "")
                {
                    chp.Prealerttime = Convert.ToInt32(this.txtPrealertTime.Text);   //预警时间
                    chp.Pretimeunit  = this.cboPrealertUnit.SelectedItem.ToString(); //预警单位
                }
                else
                {
                    App.Msg("请输入预警时间");
                }
            }
            else
            {
                chp.Prealerttime = 0;  //预警时间
                chp.Pretimeunit  = ""; //预警单位
            }



            //扣分值
            if (txtDeduction.Enabled == true)
            {
                chp.Take_Grade = Convert.ToDouble(this.txtDeduction.Text);
            }

            //是否提醒

            if (this.rdoIsNotice.Checked == true)
            {
                chp.Is_Notice = 'Y';
            }
            else
            {
                chp.Is_Notice = 'N';
            }

            chp.Isoveralert   = 'Y';                                                   //警告
            chp.Overalerttime = 0;                                                     //报警提前时间(超过)
            chp.Overtimeunit  = "";                                                    //报警提前时间单位(超过)
            chp.ThreadState   = 1;                                                     //线程状态-----------默认为1,启动
            chp.Fix_Time      = Con_CheckBoxListUtil.GetCheckedItems(this.gpbFixTime); //固定执行时间点

            if (txtItemMax.Text != "")
            {
                chp.Item_Max = float.Parse(txtItemMax.Text);
            }
            else
            {
                chp.Item_Max = 0f;
            }

            if (txtItemMin.Text != "")
            {
                chp.Item_Min = float.Parse(txtItemMin.Text);
            }
            else
            {
                chp.Item_Min = 0f;
            }

            if (this.txtExceTimes.Text == null || this.txtExceTimes.Text == "")
            {
                chp.ExceTimes = 1;
            }
            else
            {
                chp.ExceTimes = Convert.ToInt32(this.txtExceTimes.Text);
            }



            if (updateFlag)//=true 修改
            {
                string temp = "update t_quality_var_hlb hlb set hlb.document_type=" + chp.Document_Type + ",hlb.sub_item=" + chp.Sub_Item + ",hlb.inpatient_type=" + chp.Inpatient_Type + ",hlb.base_time=" + chp.Base_Time + ",hlb.runcycle=" + chp.Runcycle + ",hlb.runcycleunit='" + chp.Runcycleunit + "',hlb.isprealert='" + chp.Isprealert + "',hlb.prealerttime=" + chp.Prealerttime + ",hlb.pretimeunit='" + chp.Pretimeunit + "',hlb.isoveralert='" + chp.Isoveralert + "',hlb.overalerttime=" + chp.Overalerttime + ",hlb.overtimeunit='" + chp.Overtimeunit + "',hlb.take_grade=" + chp.Take_Grade + ",hlb.is_notice='" + chp.Is_Notice + "',hlb.is_renew='" + chp.Is_Renew + "',hlb.fix_time='" + chp.Fix_Time + "',hlb.istoday='" + chp.Istoday + "',hlb.excetimes=" + chp.ExceTimes + ",hlb.threadstate=" + chp.ThreadState + ",hlb.item_max=" + chp.Item_Max + ",hlb.item_min=" + chp.Item_Min + "where hlb.id=" + chp.Id;

                int          i      = 0;
                DialogResult result = MessageBox.Show("数据已修改,确认要保存?", "消息", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (result == DialogResult.OK)
                {
                    i = App.ExecuteSQL(temp);
                }
                else
                {
                    return;
                }


                if (i > 0)
                {
                    App.Msg("修改成功!");
                    QualityView();
                    ResetAll();
                }
                else
                {
                    App.MsgErr("修改失败!");
                }
            }
            else //新增
            {
                string temp = "insert into T_QUALITY_VAR_HLB values(" + chp.Id + "," + chp.Document_Type + "," + chp.Sub_Item + ","
                              + "" + chp.Inpatient_Type + "," + chp.Base_Time + "," + chp.Runcycle + ","
                              + "'" + chp.Runcycleunit + "','" + chp.Isprealert + "'," + chp.Prealerttime + ",'" + chp.Pretimeunit + "',"
                              + "'" + chp.Isoveralert + "'," + chp.Overalerttime + ",'" + chp.Overtimeunit + "',"
                              + "" + chp.Take_Grade + ",'" + chp.Is_Notice + "','" + chp.Is_Renew + "',"
                              + "'" + chp.Fix_Time + "','" + chp.Istoday + "'," + chp.ExceTimes + "," + chp.ThreadState + "," + chp.Item_Max + "," + chp.Item_Min + ")";


                int          i      = 0;
                DialogResult result = MessageBox.Show("确认要保存数据?", "消息", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (result == DialogResult.OK)
                {
                    i = App.ExecuteSQL(temp);
                }
                else
                {
                    return;
                }


                if (i > 0)
                {
                    App.Msg("添加成功!");
                    QualityView();
                    ResetAll();
                }
                else
                {
                    App.MsgErr("添加失败!");
                }
            }
        }
Exemplo n.º 4
0
        private void frmSectionCheck_Load(object sender, EventArgs e)
        {
            //老代码注释掉
            //DataSet dataSet = App.GetDataSet("select distinct(ts.sid),ts.section_name from t_Section_Area tsa inner join t_Sectioninfo ts on tsa.sid=ts.sid");

            #region 消息提醒使用
            DataSet dataSet = new DataSet();
            if (strT_Msg_Setting == 3)
            {
                dataSet = App.GetDataSet("select t.said as SID,t.sick_area_name as SECTION_NAME from T_SICKAREAINFO t");
            }
            else
            {
                if (strT_Msg_Setting == 2)
                {
                    dataSet = App.GetDataSet("select distinct(ts.sid),ts.section_name from  t_Sectioninfo ts");
                }
                else
                {
                    dataSet = App.GetDataSet("select distinct(ts.sid),ts.section_name from t_Section_Area tsa inner join t_Sectioninfo ts on tsa.sid=ts.sid");
                }
            }
            #endregion

            Class_Sections[] class_Sections;
            int lenght = dataSet.Tables[0].Rows.Count;

            CheckBox[] ff = new CheckBox[lenght];
            for (int i = 0; i < lenght; i++)
            {
                class_Sections                 = new Class_Sections[lenght];
                class_Sections[i]              = new Class_Sections();
                class_Sections[i].Sid          = Convert.ToInt32(dataSet.Tables[0].Rows[i]["SID"].ToString());
                class_Sections[i].Section_Name = dataSet.Tables[0].Rows[i]["SECTION_NAME"].ToString();

                chkSectionListBox.Items.Add(class_Sections[i]);
                chkSectionListBox.DisplayMember = "Section_Name";
                chkSectionListBox.ValueMember   = "SID";
            }

            if (ucYWCParam.FlexSection != null)
            {
                // Con_CheckBoxListUtil.SetCheck(this.chkSectionListBox, frmYWCParam.FlexSection);

                //chkSectionListBox.Items.Clear();
                string[] temp = ucYWCParam.FlexSection.Split(',');
                foreach (string str in temp)
                {
                    for (int i = 0; i < chkSectionListBox.Items.Count; i++)
                    {
                        if (str == chkSectionListBox.GetItemText(chkSectionListBox.Items[i]))
                        {
                            chkSectionListBox.Items.RemoveAt(i); //除自身规则的科室以外,已被选择的科室则移除它
                        }
                    }
                }

                //Con_CheckBoxListUtil.RemoveExitItems(chkSectionListBox);
            }

            if (ywcSectionName != null)
            {
                Con_CheckBoxListUtil.SetCheck(this.chkSectionListBox, ywcSectionName);

                //老代码注释掉
                //this.groupBox1.Text = "文书类型为:[" + documentType + "]的科室列表";

                #region 消息提醒使用
                if (strT_Msg_Setting == 3)
                {
                    this.groupBox1.Text = "病区列表";
                }
                else if (strT_Msg_Setting == 1 || strT_Msg_Setting == 2)
                {
                    this.groupBox1.Text = "科室列表";
                }
                else
                {
                    this.groupBox1.Text = "文书类型为:[" + documentType + "]的科室列表";
                }
                #endregion
            }
            else
            {
                //老代码注释掉
                //this.groupBox1.Text = "科室列表";
                #region 消息提醒使用
                if (strT_Msg_Setting == 3)
                {
                    this.groupBox1.Text = "病区列表";
                }
                else
                {
                    this.groupBox1.Text = "科室列表";
                }
                #endregion
            }

            #region 消息提醒使用
            if (strT_Msg_Setting == 1 || strT_Msg_Setting == 2 || strT_Msg_Setting == 3)//消息提醒使用
            {
                // DataSet ds;
                if (STRMSGSECTION_IDS == "")//如果等于空,不需要进行选中提示
                {
                    for (int i = 0; i < chkSectionListBox.Items.Count; i++)
                    {
                        chkSectionListBox.SetItemChecked(i, false);
                    }
                    ywcSectionID   = "";
                    ywcSectionName = "";
                }
            }
            #endregion
        }