Esempio n. 1
0
        /// <summary>
        /// 通过身份证号码,更新医疗救助步骤列表中的情况(各级审批时) 更新成功返回true
        /// </summary>
        /// <param name="idCard"></param>
        /// <param name="med_Step"></param>
        /// <returns></returns>
        public static bool UpdateStepByIdCard(long confirmId, Med_Step med_Step)
        {
            bool result = false;
            try
            {
                StringBuilder strSql = new StringBuilder();
                strSql.Append(" update Ass_step set ");
                strSql.Append(" StepId=@StepId,CommunityReason=@CommunityReason,CommunityResult=@CommunityResult,CommunityDate=@CommunityDate,StreetReason=@StreetReason,StreetResult=@StreetResult,StreetDate=@StreetDate, BossReason=@BossReason,Result=@Result,BossDate=@BossDate ");
                strSql.Append("where ConfirmId=@confirmId");
                SqlParameter[] parameters = {
                    new SqlParameter("@StepId", SqlDbType.Int),
                    new SqlParameter("@CommunityReason",SqlDbType.NVarChar,50),
                    new SqlParameter("@CommunityResult", SqlDbType.Int),
                    new SqlParameter("@CommunityDate", SqlDbType.NVarChar,50),
                    new SqlParameter("@StreetReason", SqlDbType.NVarChar,50),
                    new SqlParameter("@StreetResult", SqlDbType.Int),
                    new SqlParameter("@StreetDate", SqlDbType.NVarChar,50),
                    new SqlParameter("@BossReason", SqlDbType.NVarChar,50),
                    new SqlParameter("@Result", SqlDbType.Int),
                    new SqlParameter("@BossDate", SqlDbType.NVarChar,50),
                    new SqlParameter("@confirmId", SqlDbType.BigInt),
                                             };
                parameters[0].Value = med_Step.StepId;
                parameters[1].Value = med_Step.CommunityReason;
                parameters[2].Value = med_Step.CommunityResult;
                parameters[3].Value = med_Step.CommunityDate;
                parameters[4].Value = med_Step.StreetReason;
                parameters[5].Value = med_Step.StreetResult;
                parameters[6].Value = med_Step.StreetDate;
                parameters[7].Value = med_Step.BossReason;
                parameters[8].Value = med_Step.Result;
                parameters[9].Value = med_Step.BossDate;
                parameters[10].Value = confirmId;

                int count = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
                if (count == 1)
                {
                    result = true;
                }
            }
            catch (Exception e)
            {
                Log4Net.LogWrite("err", "UpdateStepByIdCard:" + e.Message);
            }
            return result;
        }
Esempio n. 2
0
        /// <summary>
        /// 通过验证码列表id找出医疗救助审批步骤表的相关信息
        /// </summary>
        /// <param name="idCard"></param>
        /// <returns></returns>
        public static Med_Step SelectStepModeById(long confirmId)
        {
            Med_Step med_Step = new Med_Step();
            StringBuilder strSql = new StringBuilder();
            DataSet ds = new DataSet();
            strSql.Append("select * from Ass_Step where ConfirmId = '" + confirmId + "'");
            ds = DbHelperSQL.Query(strSql.ToString());
            med_Step.Id = (long)ds.Tables[0].Rows[0]["Id"];
            med_Step.StepId = (int)ds.Tables[0].Rows[0]["StepId"];
            med_Step.IdCard = (string)ds.Tables[0].Rows[0]["IdCard"];

            med_Step.CommunityReason = ds.Tables[0].Rows[0]["CommunityReason"] == null ? " " : (string)ds.Tables[0].Rows[0]["CommunityReason"];
            med_Step.CommunityResult = (int)ds.Tables[0].Rows[0]["CommunityResult"];
            med_Step.StreetReason = ds.Tables[0].Rows[0]["StreetReason"] == null ? " " : (string)ds.Tables[0].Rows[0]["StreetReason"];
            med_Step.StreetResult = (int)ds.Tables[0].Rows[0]["StreetResult"];
            med_Step.BossReason = ds.Tables[0].Rows[0]["BossReason"] == null ? " " : (string)ds.Tables[0].Rows[0]["BossReason"];
            med_Step.Result = (int)ds.Tables[0].Rows[0]["Result"];

            #region  处理时间为空值的情况

            if (ds.Tables[0].Rows[0]["CommunityDate"] == DBNull.Value)
            {
                med_Step.CommunityDate = null;
            }
            else
            {
                med_Step.CommunityDate = (string)ds.Tables[0].Rows[0]["CommunityDate"];
            }
            if (ds.Tables[0].Rows[0]["StreetDate"] == DBNull.Value)
            {
                med_Step.StreetDate = null;
            }
            else
            {
                med_Step.StreetDate = (string)ds.Tables[0].Rows[0]["StreetDate"];
            }
            if (ds.Tables[0].Rows[0]["BossDate"] == DBNull.Value)
            {
                med_Step.BossDate = null;
            }
            else
            {
                med_Step.BossDate = (string)ds.Tables[0].Rows[0]["BossDate"];
            }
            #endregion
            ds.Dispose();
            return med_Step;
        }