示例#1
0
 /// <summary>
 /// 新增时限规则
 /// by xlb 2013-01-06
 /// </summary>
 /// <param name="qcRule"></param>
 public static void InsertQcRule(QCRule qcRule, QCCondition qcCondition, RuleCategory ruleCategory)
 {
     try
     {
         string c_SqlInsert = "insert into QCRule(RULECODE,CONDITIONCODE,DESCRIPTION,"
                              + "REMINDER,FOULMESSAGE,DELAYTIME,TIMELIMIT,MARK,CYCLETIMES,CYCLEINTERVAL,"
                              + "DOCOTORLEVEL,SORTCODE,MEMO,SCORE,QCCODE,valid) values(seq_qcrulecode.nextval,@CONDITIONCODE,@DESCRIPTION,"
                              + "@REMINDER,@FOULMESSAGE,@DELAYTIME,@TIMELIMIT,@MARK,@CYCLETIMES,@CYCLEINTERVAL,@DOCOTORLEVEL,"
                              + "@SORTCODE,@MEMO,@SCORE,@QCCODE,@valid)";
         SqlParameter[] sps =
         {
             new SqlParameter("@CONDITIONCODE", qcCondition.Code),
             new SqlParameter("@DESCRIPTION",   qcRule.Description),
             new SqlParameter("@REMINDER",      qcRule.Reminder),
             new SqlParameter("@FOULMESSAGE",   qcRule.FoulMessage),
             new SqlParameter("@TIMELIMIT",     qcRule.TimeLimit),
             new SqlParameter("@MARK",          qcRule.MARK),
             new SqlParameter("@CYCLETIMES",    qcRule.CycleTimes),
             new SqlParameter("@CYCLEINTERVAL", qcRule.CycleInterval),
             new SqlParameter("@DOCOTORLEVEL",  (int)qcRule.DoctorLevel),
             new SqlParameter("@SORTCODE",      ruleCategory.Code),
             new SqlParameter("@valid",         qcRule.Valid),
             new SqlParameter("@MEMO",          qcRule.Valid),
             new SqlParameter("@DELAYTIME",     qcRule.DelayTime),
             new SqlParameter("@SCORE",         qcRule.Sorce),
             new SqlParameter("@QCCODE",        qcRule.QCCode),
         };
         DS_SqlHelper.ExecuteNonQuery(c_SqlInsert, sps, CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#2
0
 /// <summary>
 /// 修改时限条件具体信息
 /// by xlb 2013-01-07
 /// </summary>
 /// <param name="qcCondition"></param>
 public static void UpdateCondition(QCCondition qcCondition)
 {
     try
     {
         string sqlUpdateCondition = @"update QCCondition set description=@description,"
                                     + "memo=@memo,tablename=@tablename,columnname=@columnname,"
                                     + "columnvalue=@columnvalue,timecolumnname=@timecolumn,timerange=@timerange,"
                                     + "patnocolumnname=@patnocolumnname,dblink=@dblink where code=@code";
         SqlParameter[] sps =
         {
             new SqlParameter("@description",     qcCondition.Description),
             new SqlParameter("@memo",            qcCondition.Memo),
             new SqlParameter("@tablename",       qcCondition.TableName),
             new SqlParameter("@columnname",      qcCondition.ColumnName),
             new SqlParameter("@columnvalue",     qcCondition.ColumnValue),
             new SqlParameter("@timecolumn",      qcCondition.TimeColumnName),
             new SqlParameter("@timerange",       qcCondition.TimeRange),
             new SqlParameter("@patnocolumnname", qcCondition.PatNoColumnName),
             new SqlParameter("@dblink",          qcCondition.DBLink),
             new SqlParameter("@code",            qcCondition.Code)
         };
         DS_SqlHelper.ExecuteNonQuery(sqlUpdateCondition, sps, CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#3
0
        /// <summary>
        /// 判断临时工号是否存在
        /// <auth>张业兴</auth>
        /// <date>2012-12-18</date>
        /// </summary>
        /// <param name="id">临时工号</param>
        /// <param name="table">表名</param>
        /// <returns>受影响的行数</returns>
        private int ValidateExist(string id, string table)
        {
            try
            {
                int            count           = 0;//记录受影响的行数
                string         strSqlUsersById = "select * from users where id=@id";
                string         strSqlTempUsers = "select * from TEMPUSERS where userid=@userid";
                SqlParameter[] parms;
                switch (table)
                {
                case "users":
                    parms          = new SqlParameter[] { new SqlParameter("@id", SqlDbType.NVarChar, 6) };
                    parms[0].Value = id;
                    count          = DS_SqlHelper.ExecuteNonQuery(strSqlUsersById, parms, CommandType.Text);
                    break;

                case "tempUsers":
                    parms          = new SqlParameter[] { new SqlParameter("@userid", SqlDbType.NVarChar, 6) };
                    parms[0].Value = id;
                    count          = DS_SqlHelper.ExecuteNonQuery(strSqlTempUsers, parms, CommandType.Text);
                    break;
                }
                return(count);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#4
0
 /// <summary>
 /// 保存方法 用于删除受邀医生或修改新增记录
 /// Add xlb 2013-03-08
 /// </summary>
 /// <param name="typeId"></param>
 /// <param name="row"></param>
 private void SaveConsultRecordDepartment(int typeId /*操作类型*/, DataRow row)
 {
     try
     {
         string departmentCode  = string.Empty;
         string departmentName  = string.Empty;
         string employeeCode    = string.Empty;
         string employeeName    = string.Empty;
         string employeeLevelID = string.Empty;
         string createUser      = m_app.User.Id; //创建人
         string createTime      = System.DateTime.Now.ToString();
         string modifyuser      = m_app.User.Id; //修改人
         string canceluser      = m_app.User.Id; //作废人
         int    ConsultID       = 0;
         int    ordervalue      = 1;
         string sql             = @"select id from hospitalinfo";
         //医院代码
         string hospitalCode = DS_SqlHelper.ExecuteDataTable(sql, CommandType.Text).Rows[0][0].ToString();
         //行状态为删除则记录删除行ID
         if (row.RowState == DataRowState.Deleted)
         {
             //获取删除前的ID值
             ConsultID = int.Parse(row["ID", DataRowVersion.Original].ToString());
         }
         else
         {//行状态为新增或修改状态则记录相应的值
             departmentCode  = row["DepartmentCode"].ToString();
             departmentName  = row["DepartmentName"].ToString();
             employeeCode    = row["EmployeeCode"].ToString();
             employeeName    = row["EmployeeName"].ToString();
             employeeLevelID = row["EmployeeLevelID"].ToString();
             if (!string.IsNullOrEmpty(row["ID"].ToString()))
             {
                 ConsultID = int.Parse(row["ID"].ToString());//ID
             }
         }
         SqlParameter[] sps =
         {
             new SqlParameter("@TypeID",          typeId),
             new SqlParameter("@ConsultId",       ConsultID),
             new SqlParameter("@consultapplysn",  mconsultApplySn),
             new SqlParameter("@ordervalue",      ordervalue),
             new SqlParameter("@hospitalcode",    hospitalCode),
             new SqlParameter("@departmentcode",  departmentCode),
             new SqlParameter("@departmentname",  departmentName),
             new SqlParameter("@employeecode",    employeeCode),
             new SqlParameter("@employeename",    employeeName),
             new SqlParameter("@employeelevelid", employeeLevelID),
             new SqlParameter("@createuser",      createUser),
             new SqlParameter("@createtime",      createTime),
             new SqlParameter("@canceluser",      canceluser),
             new SqlParameter("@modifyuser",      modifyuser)
         };
         DS_SqlHelper.ExecuteNonQuery("EMR_CONSULTATION.usp_SaveConsultRecord", sps, CommandType.StoredProcedure);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#5
0
 /// <summary>
 /// 新增时限条件
 /// xlb 2013-01-06
 /// </summary>
 /// <param name="qcCondition"></param>
 public static void InsertCondition(QCCondition qcCondition)
 {
     try
     {
         string sqlCondtiion = "insert into QCCondition(code,description,valid,memo,tablename,"
                               + "columnname,columnvalue,timecolumnname,timerange,patnocolumnname,dblink) values(@code,"
                               + "@description,@valid,@memo,@tablename,@columnname,@columnvalue,@timecolumnname,@timerange,"
                               + "@patnocolumnname,@dblink)";
         SqlParameter[] sps =
         {
             new SqlParameter("@code",            qcCondition.Code),
             new SqlParameter("@description",     qcCondition.Description),
             new SqlParameter("@valid",           "1"),
             new SqlParameter("@memo",            qcCondition.Memo),
             new SqlParameter("@tablename",       qcCondition.TableName),
             new SqlParameter("@columnname",      qcCondition.ColumnName),
             new SqlParameter("@columnvalue",     qcCondition.ColumnValue),
             new SqlParameter("@timecolumnname",  qcCondition.TimeColumnName),
             new SqlParameter("@timerange",       qcCondition.TimeRange),
             new SqlParameter("@patnocolumnname", qcCondition.PatNoColumnName),
             new SqlParameter("@dblink",          qcCondition.DBLink)
         };
         DS_SqlHelper.ExecuteNonQuery(sqlCondtiion, sps, CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#6
0
 /// <summary>
 /// 更新会诊申请相关信息的方法
 /// Add xlb 2013-03-01
 /// </summary>
 /// <param name="consultStatus"></param>
 private void UpdateConsultApply(ConsultStatus consultStatus)
 {
     try
     {
         string         sql = @"UPDATE consultapply set consultsuggestion = @consultsuggestion,
         finishtime=@finishtime,stateid =@stateid,modifieduser=@modifiedUser,modifiedtime=@modifiedtime WHERE consultapplysn = @consultapplysn";
         string         consultSuggestion = memoEditSuggestion.Text.Trim();
         string         finishTime        = dateEditConsultationDate.Text + " " + timeEditConsultationTime.Text;
         string         stateId           = Convert.ToString((int)consultStatus);
         SqlParameter[] sps =
         {
             new SqlParameter("@consultsuggestion", consultSuggestion),
             new SqlParameter("@finishtime",        finishTime),
             new SqlParameter("@stateid",           stateId),
             new SqlParameter("@modifiedUser",      m_app.User.Id),
             new SqlParameter("@modifiedtime",      DateTime.Now.ToString("yyyy-MM-dd HH;mm:ss")),
             new SqlParameter("@consultapplysn",    mconsultApplySn)
         };
         DS_SqlHelper.ExecuteNonQuery(sql, sps, CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#7
0
        /// <summary>
        /// 保存数据 之前有的数据修改更新,没有的添加新行
        /// </summary>
        private void SaveData()
        {
            try
            {
                for (int i = 0; i < bandedGridView1.RowCount; i++)
                {
                    StringBuilder fieldsValues = new StringBuilder();
                    try
                    {
                        DataRow dr = bandedGridView1.GetDataRow(i);
                        if (dr == null)
                        {
                            continue;
                        }


                        // if (string.IsNullOrEmpty(dr["ID"].ToString())) //该行是新增行
                        bool IsInsert = IsInSertDate(dr);

                        if (IsInsert && m_ChangedRowIndex.Contains(i))
                        {
                            CreateInsertSql(dr);
                            DS_SqlHelper.ExecuteNonQuery(m_sbSql.ToString());
                        }
                        else //更新数据
                        {
                            if (m_ChangedRowIndex.Contains(i)) //该行数据修改
                            {
                                if (m_CurTimeslot == radio1.Tag.ToString()) //第一个时段
                                {
                                    CreateUpdateSql(dr, true);
                                }
                                else
                                {
                                    CreateUpdateSql(dr, false);
                                }
                                string surveyDate = m_CurrDatetime;// dateEdit.Text.Replace('/', '-');
                                m_sbSql.Append(" where " + "NOOFINPAT='" + dr[NOOFINPAT] + "' and dateofsurvey='" + surveyDate + "' and Timeslot='" + m_CurTimeslot + "'");
                                DS_SqlHelper.ExecuteNonQuery(m_sbSql.ToString());
                            }
                        }
                        m_sbSql.Remove(0, m_sbSql.Length);
                    }
                    catch (Exception ex)
                    {
                        m_IsSaveOk = false;
                        throw ex;
                    }
                }
                m_IsSaveOk = true;
            }
            catch (Exception ex)
            {
                m_IsSaveOk = false;
                throw ex;
            }
        }
示例#8
0
 public static void CancelQCRecordData(string qcRecordID)
 {
     try
     {
         DS_SqlHelper.ExecuteNonQuery(string.Format(c_SqlCancelRecordByID, qcRecordID), CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#9
0
 /// <summary>
 /// 更新病历的违规状态
 /// </summary>
 public static void UpdateFoulState()
 {
     try
     {
         DS_SqlHelper.ExecuteNonQuery(c_SqlUpdateFoulState, CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 /// 作废会诊记录
 /// </summary>
 /// <param name="consultationApplySN"></param>
 private void CancelConsultationRecord(string consultationApplySN)
 {
     try
     {
         string sqlCancelConsultationRecord = "update consultapply set valid = '0' where consultapplysn = '{0}' and valid = '1'";
         DS_SqlHelper.ExecuteNonQuery(string.Format(sqlCancelConsultationRecord, consultationApplySN), CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 /// 更新会诊单状态
 /// </summary>
 /// <param name="stateid"></param>
 /// <param name="consultationApplySN"></param>
 private void UpdateConsultationState(string stateid, string consultationApplySN)
 {
     try
     {
         string sqlUpdateConsultationState = "update consultapply set stateid = '{0}' where consultapplysn = '{1}' and valid = '1'";
         DS_SqlHelper.ExecuteNonQuery(string.Format(sqlUpdateConsultationState, stateid, consultationApplySN), CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#12
0
        /// <summary>
        /// 保存方法
        /// Add by xlb 2013-04-12
        /// </summary>
        /// <param name="iemExcept"></param>
        public bool SaveIemMainPageExcept(IemMainPageExcept iemExcept)
        {
            try
            {
                if (string.IsNullOrEmpty(iemExcept.IemExId))
                {
                    iemExcept.IemExId = Guid.NewGuid().ToString();
                }

                SqlParameter[] sps =
                {
                    new SqlParameter("@iemexId",         SqlDbType.VarChar),
                    new SqlParameter("@iemexName",       SqlDbType.VarChar),
                    new SqlParameter("@dateElementFlow", SqlDbType.VarChar),
                    new SqlParameter("@iemControl",      SqlDbType.VarChar),
                    new SqlParameter("@iemOtherName",    SqlDbType.VarChar),
                    new SqlParameter("@orderCode",       SqlDbType.VarChar),
                    new SqlParameter("@isOtherLine",     SqlDbType.VarChar),
                    new SqlParameter("@valide",          SqlDbType.VarChar),
                    new SqlParameter("@createDocId",     SqlDbType.VarChar),
                    new SqlParameter("@createDateTime",  SqlDbType.VarChar),
                    new SqlParameter("@modifyDocId",     SqlDbType.VarChar),
                    new SqlParameter("@modifyDateTime",  SqlDbType.VarChar)
                };
                sps[0].Value = iemExcept.IemExId;
                sps[1].Value = iemExcept.IemExName;
                sps[2].Value = iemExcept.DateElementFlow;
                sps[3].Value = iemExcept.IemControl;
                sps[4].Value = iemExcept.IemOtherName;
                sps[5].Value = iemExcept.OrderCode;
                sps[6].Value = iemExcept.IsOtherLine.Equals("是") ? "1" : "0";
                sps[7].Value = iemExcept.Vailde;
                sps[8].Value = DS_Common.currentUser.DoctorId;
                sps[9].Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                if (string.IsNullOrEmpty(iemExcept.ModifyDocId))
                {
                    sps[10].Value = "";
                    sps[11].Value = "";
                }
                else
                {
                    sps[10].Value = iemExcept.ModifyDocId;
                    sps[11].Value = iemExcept.ModifyDateTime;
                }
                DS_SqlHelper.ExecuteNonQuery("MainPageExtenSion.ADDORMODIFYIEMEXCEPT", sps, CommandType.StoredProcedure);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#13
0
 /// <summary>
 /// 删除质控记录
 /// xlb 2013-01-11
 /// </summary>
 /// <param name="ruleCode"></param>
 public static void DeleteQcRecird(string ruleCode)
 {
     try
     {
         string         sqlDeleteQcRecord = "delete QcRecord where rulecode=@ruleCode";
         SqlParameter[] sps = { new SqlParameter("@ruleCode", ruleCode) };
         DS_SqlHelper.ExecuteNonQuery(sqlDeleteQcRecord, sps, CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#14
0
        public static void InsertConsultationApplyDept(string consultApplySn, string orderValue, string hospitalCode, string departmentCode,
                                                       string departmentName, string employeeCode, string employeeName, string employeeLevelID, string createUser, string createTime)
        {
            try
            {
                SqlParameter[] sqlParam = new SqlParameter[]
                {
                    new SqlParameter("@ConsultApplySn", SqlDbType.Decimal),
                    new SqlParameter("@OrderValue", SqlDbType.Decimal),
                    new SqlParameter("@HospitalCode", SqlDbType.VarChar),
                    new SqlParameter("@DepartmentCode", SqlDbType.VarChar),
                    new SqlParameter("@DepartmentName", SqlDbType.VarChar),
                    new SqlParameter("@EmployeeCode", SqlDbType.VarChar),
                    new SqlParameter("@EmployeeName", SqlDbType.VarChar),
                    new SqlParameter("@EmployeeLevelID", SqlDbType.VarChar),
                    new SqlParameter("@CreateUser", SqlDbType.VarChar),
                    new SqlParameter("@CreateTime", SqlDbType.VarChar),
                };

                if (consultApplySn.Trim() == "")
                {
                    sqlParam[0].Value = 0f;
                }
                else
                {
                    sqlParam[0].Value = Convert.ToInt32(consultApplySn);
                }
                if (orderValue.Trim() == "")
                {
                    sqlParam[1].Value = 0;
                }
                else
                {
                    sqlParam[1].Value = Convert.ToInt32(orderValue);
                }
                sqlParam[2].Value = hospitalCode;
                sqlParam[3].Value = departmentCode;
                sqlParam[4].Value = departmentName;
                sqlParam[5].Value = employeeCode;
                sqlParam[6].Value = employeeName;
                sqlParam[7].Value = employeeLevelID;
                sqlParam[8].Value = createUser;
                sqlParam[9].Value = createTime;
                //DS_SqlHelper.ExecuteNonQueryInTran("EMR_CONSULTATION.usp_InsertConsultationApplyD", sqlParam, CommandType.StoredProcedure);
                DS_SqlHelper.ExecuteNonQuery("EMR_CONSULTATION.usp_InsertConsultationApplyD", sqlParam, CommandType.StoredProcedure);
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#15
0
 /// <summary>
 /// 插入入院记录
 /// 中心需求
 /// Ad By XLB 2013-06-09
 /// </summary>
 /// <param name="noofinpat">病案号</param>
 /// <param name="inHosDate">入院时间</param>
 /// <param name="inCode">入院状态代码</param>
 private void InsertHosStatus(string noofinpat, string inHosDate, string inCode)
 {
     try
     {
         DS_SqlHelper.ExecuteNonQuery(@"insert into PatientStatus(ID,CCODE,NOOFINPAT,DOTIME,PATID) 
                                    values(seq_Emr_ConfigPoint_ID.Nextval,@cCode,@noofinpat,@doTime,@patId)",
                                     new SqlParameter[]{new SqlParameter("@cCode",inCode),
                                         new SqlParameter("@noofinpat",noofinpat),new SqlParameter("@doTime",inHosDate),
                                     new SqlParameter("@patId",patid) }, CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#16
0
 /// <summary>
 /// 删除时限规则
 /// xlb 2013-01-09
 /// </summary>
 /// <param name="ruleCode"></param>
 public static void DeleteQcRule(string ruleCode)
 {
     try
     {
         if (ruleCode == null)
         {
             return;
         }
         SqlParameter[] sps = { new SqlParameter("@rulecode", ruleCode) };
         DS_SqlHelper.ExecuteNonQuery(c_sqlDelete, sps, CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#17
0
        /// <summary>
        /// 增加图片签名
        /// <auth>张业兴</auth>
        /// <date>2012-12-12</date>
        /// </summary>
        private void Insert()
        {
            try
            {
                string         sqlInsert = "insert into userpicsign (userpicflow,userid,createdatetime,createuserid,createusername,valide,userpic) values(@userpicflow,@userid,@createdatetime,@createuserid,@createusername,@valide,@userpic)";
                SqlParameter[] parms     = new SqlParameter[]
                {
                    new SqlParameter("@userpicflow", SqlDbType.NVarChar, 50),
                    new SqlParameter("@userid", SqlDbType.NVarChar, 20),
                    new SqlParameter("@createdatetime", SqlDbType.NVarChar, 20),
                    new SqlParameter("@createuserid", SqlDbType.NVarChar, 20),
                    new SqlParameter("@createusername", SqlDbType.NVarChar, 20),
                    new SqlParameter("@valide", SqlDbType.NVarChar, 1),
                    new SqlParameter("@userpic", SqlDbType.Text)
                };
                parms[0].Value = Guid.NewGuid().ToString();
                parms[1].Value = txtUserId.Text.Trim();
                DateTime now = DateTime.Now;
                parms[2].Value = now.ToString();
                parms[3].Value = m_app.User.Id;
                parms[4].Value = m_app.User.Name;
                if (string.IsNullOrEmpty(picString))
                {
                    if (DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("签名图片不存在,你确定要保存吗?", "签名图片", DrectSoft.Common.Ctrs.DLG.MyMessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        parms[5].Value = 0;
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    parms[5].Value = 1;
                }

                parms[6].Value = picString;
                DS_SqlHelper.ExecuteNonQuery(sqlInsert, parms, CommandType.Text);
                dataRowPicSign["USERPICFLOW"] = parms[0].Value;
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("保存成功!");
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
            }
        }
示例#18
0
        /// <summary>
        /// 插入初始化数据,即外部触发时应该往QCRecord表中插入的一条时限记录信息
        /// </summary>
        /// <param name="noofinpat"></param>
        /// <param name="rule"></param>
        /// <param name="ConfigDataResult"></param>
        public static void InsertInitData(string noofinpat, QCRule rule, DataRow drConfigDataResult)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] {
                    new SqlParameter("@noofinpat", SqlDbType.NVarChar),
                    new SqlParameter("@rulecode", SqlDbType.NVarChar),
                    new SqlParameter("@conditioncode", SqlDbType.NVarChar),
                    new SqlParameter("@conditiontime", SqlDbType.NVarChar),
                    new SqlParameter("@realconditiontime", SqlDbType.NVarChar),
                    new SqlParameter("@condition", SqlDbType.Int),
                    new SqlParameter("@reminder", SqlDbType.NVarChar),
                    new SqlParameter("@foulmessage", SqlDbType.NVarChar),
                    new SqlParameter("@docotorlevel", SqlDbType.Int),
                    new SqlParameter("@cycletimes", SqlDbType.Int),
                    new SqlParameter("@memo", SqlDbType.NVarChar),
                    new SqlParameter("@iscycle", SqlDbType.Int),
                    new SqlParameter("@firstcyclerecordid", SqlDbType.NVarChar),
                    new SqlParameter("@timelimit", SqlDbType.Int),
                    new SqlParameter("@qccode", SqlDbType.NVarChar),
                    new SqlParameter("@score", SqlDbType.Decimal)
                };
                parms[0].Value = noofinpat;
                parms[1].Value = rule.RuleCode;
                parms[2].Value = rule.Condition.Code;
                parms[3].Value = (Convert.ToDateTime(drConfigDataResult[rule.Condition.TimeColumnName].ToString())).ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.CurrentCulture);
                DateTime RealConditionTime = Convert.ToDateTime(parms[3].Value).AddSeconds((int)rule.DelayTime);
                parms[4].Value  = RealConditionTime.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.CurrentCulture);
                parms[5].Value  = (int)rule.DelayTime == 0 ? 1 : 0;
                parms[6].Value  = rule.Reminder;
                parms[7].Value  = rule.FoulMessage;
                parms[8].Value  = (int)rule.DoctorLevel;
                parms[9].Value  = rule.MARK == OperationType.Circle ? "1" : "0";
                parms[10].Value = rule.Memo;
                parms[11].Value = rule.MARK == OperationType.Circle ? "1" : "0";
                parms[12].Value = "";
                parms[13].Value = rule.TimeLimit.ToString();
                parms[14].Value = rule.QCCode;
                parms[15].Value = rule.Sorce.ToString();

                DS_SqlHelper.ExecuteNonQuery(c_SqlInsertInitData, parms, CommandType.Text);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#19
0
 /// <summary>
 /// 删除操作
 /// add 当前用户再删除病种组合时,只有用户具有了改病种组合才可以删除
 /// add by 项令波 2012-12-12
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void barButtonItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         if (MyMessageBox.Show("您确认删除吗?", "提示", MyMessageBoxButtons.OkCancel) == DialogResult.OK)
         {
             DataRow dr = gridViewDiseaseGroup.GetDataRow(gridViewDiseaseGroup.FocusedRowHandle);
             if (dr != null)
             {
                 string    name      = dr["NAME"].ToString();
                 string    groupname = dr["DISEASEGROUP"].ToString().Trim();
                 string    disaseid  = dr["ID"].ToString().Trim();
                 string    sql       = string.Format(@"delete from DiseaseGroup where name = '" + name + "' or name is null");
                 DataTable dt        = m_SqlHelper.ExecuteDataTable("select relatedisease from attendingphysician where id=@ID", new SqlParameter[] { new SqlParameter("ID", m_app.User.Id) }, CommandType.Text);
                 if (dt != null && dt.Rows.Count > 0)
                 {
                     string diseasename = dt.Rows[0]["RELATEDISEASE"].ToString().Trim();
                     if (diseasename == groupname || m_DeleteList.Contains(disaseid))
                     {
                         DS_SqlHelper.ExecuteNonQuery(sql);
                     }
                     else
                     {
                         MessageBox.Show("您没有权限删除");
                     }
                 }
                 else
                 {
                     if (m_DeleteList.Contains(disaseid))
                     {
                         DS_SqlHelper.ExecuteNonQuery(sql);
                     }
                     else
                     {
                         MessageBox.Show("您没有权限删除");
                     }
                 }
             }
         }
         InitDiseaseGroup();
     }
     catch (Exception ex)
     {
         //m_app.CustomMessageBox.MessageShow(ex.Message);
         MyMessageBox.Show(1, ex);
     }
 }
示例#20
0
 /// <summary>
 /// 更新时限记录是否停止循环时限
 /// </summary>
 /// <param name="id"></param>
 /// <param name="isStopCycle"></param>
 public static void UpdateStopCycle(string id, bool isStopCycle)
 {
     try
     {
         SqlParameter[] parms = new SqlParameter[] {
             new SqlParameter("@id", SqlDbType.NVarChar),
             new SqlParameter("@isstopcycle", SqlDbType.NVarChar)
         };
         parms[0].Value = id;
         parms[1].Value = isStopCycle ? "1" : "";
         DS_SqlHelper.ExecuteNonQuery(c_SqlUpdateIsStopCycle, parms, CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#21
0
        /// <summary>
        /// 插入初始化数据,只针对循环时限规则
        /// </summary>
        /// <param name="record"></param>
        public static void InsertInitDataForCircle(QCRecord recordLast, QCRecord recordFirst)
        {
            try
            {
                SqlParameter[] parms = new SqlParameter[] {
                    new SqlParameter("@noofinpat", SqlDbType.NVarChar),
                    new SqlParameter("@rulecode", SqlDbType.NVarChar),
                    new SqlParameter("@conditioncode", SqlDbType.NVarChar),
                    new SqlParameter("@conditiontime", SqlDbType.NVarChar),
                    new SqlParameter("@realconditiontime", SqlDbType.NVarChar),
                    new SqlParameter("@condition", SqlDbType.Int),
                    new SqlParameter("@reminder", SqlDbType.NVarChar),
                    new SqlParameter("@foulmessage", SqlDbType.NVarChar),
                    new SqlParameter("@docotorlevel", SqlDbType.Int),
                    new SqlParameter("@cycletimes", SqlDbType.Int),
                    new SqlParameter("@memo", SqlDbType.NVarChar),
                    new SqlParameter("@iscycle", SqlDbType.Int),
                    new SqlParameter("@firstcyclerecordid", SqlDbType.NVarChar),
                    new SqlParameter("@timelimit", SqlDbType.Int),
                    new SqlParameter("@qccode", SqlDbType.NVarChar),
                    new SqlParameter("@score", SqlDbType.Decimal)
                };
                parms[0].Value  = recordLast.NoOfInpat;
                parms[1].Value  = recordLast.Rule.RuleCode;
                parms[2].Value  = recordLast.Condition.Code;
                parms[3].Value  = recordLast.RealConditionTime.AddSeconds(recordLast.TimeLimit).ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.CurrentCulture);
                parms[4].Value  = recordLast.RealConditionTime.AddSeconds(recordLast.TimeLimit).ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.CurrentCulture);
                parms[5].Value  = 1;//由于循环中的规则没有延迟时间,所以插入即生效
                parms[6].Value  = recordLast.Reminder;
                parms[7].Value  = recordLast.FoulMessage;
                parms[8].Value  = (int)recordLast.DoctorLevel;
                parms[9].Value  = ++recordLast.CycleTimes;//当前是循环的次数
                parms[10].Value = recordLast.Memo;
                parms[11].Value = recordLast.Rule.MARK == OperationType.Circle ? "1" : "0";
                parms[12].Value = recordFirst.ID;
                parms[13].Value = recordLast.TimeLimit;
                parms[14].Value = recordLast.QCCode;
                parms[15].Value = recordLast.Score;

                DS_SqlHelper.ExecuteNonQuery(c_SqlInsertInitData, parms, CommandType.Text);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#22
0
 /// <summary>
 /// 删除病历质量控制数据
 /// </summary>
 /// <param name="emrQcItem"></param>
 public static void DeleteEmrQcItem(EmrQcItem emrQcItem)
 {
     try
     {
         string sqlDeleteEmrTemp = "delete EMRQCITEM where I_CODE=@iCode";
         if (emrQcItem == null || emrQcItem.I_Code == null)
         {
             throw new Exception("没有数据");
         }
         SqlParameter[] sps = { new SqlParameter("@iCode", emrQcItem.I_Code) };
         DS_SqlHelper.ExecuteNonQuery(sqlDeleteEmrTemp, sps, CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#23
0
 /// <summary>
 /// 保存方法 用来保存受邀医师填写的会诊意见
 /// Add xlb 2013-02-25
 /// </summary>
 private void Save(string status)
 {
     try
     {
         DrectSoft.DSSqlHelper.DS_SqlHelper.CreateSqlHelper();
         string         sql = @"select consultsuggestion  from consultsuggestion where 
                consultapplysn=@consultapplySn and createuser=@createUser and valid='1'";
         SqlParameter[] sps = { new SqlParameter("@consultapplySn", consultApplySns),
                                new SqlParameter("@createUser",     app.User.Id), };
         DataTable      dt = DS_SqlHelper.ExecuteDataTable(sql, sps, CommandType.Text);
         if (dt != null && dt.Rows.Count <= 0)
         {
             string         sqlInsert = @"insert into consultsuggestion(consultapplysn,createuser,
                                 createtime,consultsuggestion,valid,state)
                    values(@consultapplysn,@createuser,@createtime,@consultsuggestion,1,@status)";
             SqlParameter[] spr       =
             {
                 new SqlParameter("@consultapplysn",    consultApplySns),
                 new SqlParameter("@createuser",        app.User.Id),
                 new SqlParameter("@createtime",        DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")),
                 new SqlParameter("@consultsuggestion", memoEditSuggestion.Text.Trim()),
                 new SqlParameter("@status",            status)
             };
             DS_SqlHelper.ExecuteNonQuery(sqlInsert, spr, CommandType.Text);
         }
         else
         {
             string         sqlupdate = @"update consultsuggestion set consultsuggestion=@consultsuggestion,state=@state
                               where createuser=@createuser and consultapplysn=@consultApplySn";
             SqlParameter[] spr       =
             {
                 new SqlParameter("@consultsuggestion", memoEditSuggestion.Text.Trim()),
                 new SqlParameter("@state",             status),
                 new SqlParameter("@createuser",        app.User.Id),
                 new SqlParameter("@consultApplySn",    consultApplySns)
             };
             DS_SqlHelper.ExecuteNonQuery(sqlupdate, spr, CommandType.Text);
         }
         MessageBox.Show("保存成功");
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#24
0
 /// <summary>
 /// 删除时限规则条件方法
 /// xlb 2013-01-06
 /// </summary>
 /// <param name="_qcCondition"></param>
 public static void DeleteCondition(QCCondition _qcCondition)
 {
     try
     {
         if (_qcCondition == null || string.IsNullOrEmpty(_qcCondition.Code))
         {
             throw new Exception("没有删除的数据");
         }
         string         _sqlCondtionDelete = "update QCCondition set valid=0 where code=@cCode ";
         SqlParameter[] sps = { new SqlParameter("@cCode", SqlDbType.NVarChar) };
         sps[0].Value = _qcCondition.Code;
         DS_SqlHelper.ExecuteNonQuery(_sqlCondtionDelete, sps, CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#25
0
 /// <summary>
 /// 更新时限记录的已完成
 /// </summary>
 /// <param name="id"></param>
 public static void UpdateResultComplete(string id, string recordDetailID, string foulState)
 {
     try
     {
         SqlParameter[] parms = new SqlParameter[] {
             new SqlParameter("@id", SqlDbType.NVarChar),
             new SqlParameter("@recorddetail", SqlDbType.NVarChar),
             new SqlParameter("@foulstate", SqlDbType.NVarChar)
         };
         parms[0].Value = id;
         parms[1].Value = recordDetailID;
         parms[2].Value = foulState;
         DS_SqlHelper.ExecuteNonQuery(c_SqlUpdateResultComplete, parms, CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#26
0
 /// <summary>
 /// 修改病历质量控制数据
 ///   xlb 2013-01-08
 /// </summary>
 /// <param name="emrQcItem"></param>
 public static void UpdateToEmrQcItem(EmrQcItem emrQcItem)
 {
     try
     {
         string sqlUpdateEmrTemp = "update EMRQCITEM set CODE=@CODE,NAME=@NAME,"
                                   + "I_CODE=@I_CODE,I_NAME=@I_NAME  where I_CODE=@I_CODE";
         SqlParameter[] sps =
         {
             new SqlParameter("@CODE",   emrQcItem.Code == null?"":emrQcItem.Code),
             new SqlParameter("@NAME",   emrQcItem.Name == null?"":emrQcItem.Name),
             new SqlParameter("@I_CODE", emrQcItem.I_Code == null?"":emrQcItem.I_Code),
             new SqlParameter("@I_NAME", emrQcItem.I_Name == null?"":emrQcItem.I_Name)
         };
         DS_SqlHelper.ExecuteNonQuery(sqlUpdateEmrTemp, sps, CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#27
0
 /// <summary>
 /// 修改审核状态通过则为待会诊否则为否决
 /// Add xlb 2013-02-21
 /// </summary>
 private void ModitifyConsultation(ConsultStatus consultStatus, string rejectReason, string consultapplySn)
 {
     try
     {
         string stateId = Convert.ToString((int)consultStatus);
         DS_SqlHelper.CreateSqlHelper();
         string         isPassed = consultStatus == ConsultStatus.WaitConsultation ? "1" : "0";
         string         sql      = @"update consultapply set  stateid=@stateId,rejectreason=@rejectReason,ispassed=@ispassed where consultapplysn=@consultapplySn";
         SqlParameter[] sps      =
         {
             new SqlParameter("@stateId",        stateId),
             new SqlParameter("@rejectReason",   rejectReason),
             new SqlParameter("@ispassed",       isPassed),
             new SqlParameter("@consultapplysn", consultapplySn)
         };
         DS_SqlHelper.ExecuteNonQuery(sql, sps, CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#28
0
        public virtual int DeleteAnObject(object _obj)
        {
            int result;

            try
            {
                if (_obj == null)
                {
                    throw new Exception("DeleteAnObject:实体对象为空");
                }
                DbParameter[] array = null;
                string        text  = this.MakeDeleteSql(_obj, out array);
                this.SetParameterValues(_obj, array);
                int num = DS_SqlHelper.ExecuteNonQuery(text, array, CommandType.Text);
                result = num;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
示例#29
0
        /// <summary>
        /// 删除事件 valide改为0并非真正删除
        /// by 项令波 2012-12-14
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                if (gridView1.FocusedRowHandle < 0)
                {
                    return;
                }
                int       index = this.gridView1.FocusedRowHandle;
                DataTable dt    = (DataTable)this.gcCommonModel.DataSource;
                if (dt == null || dt.Rows.Count <= 0)
                {
                    //throw new Exception("没有数据");
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("没有数据");
                    return;
                }

                string id = dt.Rows[index]["TEMPFLOW"].ToString().Trim();
                if (string.IsNullOrEmpty(id))
                {
                    return;
                }
                string         SqlStr = "update CommonnotePrintTemp set valide='0' where tempflow=@tempid ";
                SqlParameter[] sps    = { new SqlParameter("@tempid", id) };
                if (DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("请确认删除吗?", "志扬软件", DrectSoft.Common.Ctrs.DLG.MyMessageBoxButtons.OkCancel) == DialogResult.OK)
                {
                    DS_SqlHelper.ExecuteNonQuery(SqlStr, sps, CommandType.Text);
                    ReSet();
                    Search();
                    gridView1.FocusedRowHandle = index;//删除后焦点定位到下一条数据上
                }
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
            }
        }
示例#30
0
 /// <summary>
 /// 保存使用记录信息
 /// Add by xlb 2013-04-12
 /// </summary>
 /// <param name="iemExceptUse"></param>
 /// <returns></returns>
 public bool SaveIemUse(IemMainPageExceptUse iemExceptUse)
 {
     try
     {
         if (iemExceptUse == null)
         {
             return(false);
         }
         if (string.IsNullOrEmpty(iemExceptUse.IemexUseId))
         {
             iemExceptUse.IemexUseId = Guid.NewGuid().ToString();
         }
         SqlParameter[] sps =
         {
             new SqlParameter("@iemExUserId",    SqlDbType.NVarChar),
             new SqlParameter("@iemExId",        SqlDbType.NVarChar),
             new SqlParameter("@nOofInpat",      SqlDbType.NVarChar),
             new SqlParameter("@value",          SqlDbType.NVarChar),
             new SqlParameter("@createDocId",    SqlDbType.NVarChar),
             new SqlParameter("@modifyDocId",    SqlDbType.VarChar),
             new SqlParameter("@modifyDateTime", SqlDbType.NVarChar)
         };
         sps[0].Value = iemExceptUse.IemexUseId;
         sps[1].Value = iemExceptUse.IemexId;
         sps[2].Value = iemExceptUse.Noofinpat;
         sps[3].Value = iemExceptUse.Value;;
         sps[4].Value = DS_Common.currentUser.DoctorId;
         sps[5].Value = DS_Common.currentUser.DoctorId;
         sps[6].Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
         DS_SqlHelper.ExecuteNonQuery("MainPageExtenSion.ADDORMODIFYIEMUS", sps, CommandType.StoredProcedure);
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }