示例#1
0
        /// <summary>
        /// 根据申请人ID获取申请信息
        /// </summary>
        /// <param name="ID">申请人ID</param>
        /// <returns>ApplyInfo</returns>
        public static ApplyInfo getApplyInfo(string ID)
        {
            string  sql = string.Format("select * from {0} where apply_id ='{1}' ", applytable, ID);
            DataSet ds  = SqlHelper.ExecuteDataSet(sql);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                ApplyInfo model = new ApplyInfo();
                model.applyId            = ds.Tables[0].Rows[0]["apply_id"].ToString();
                model.applySource        = ds.Tables[0].Rows[0]["apply_source"].ToString();
                model.applyUserId        = ds.Tables[0].Rows[0]["apply_user_id"].ToString();
                model.applyDate          = ds.Tables[0].Rows[0]["apply_date"].ToString();
                model.applyYearMonth     = ds.Tables[0].Rows[0]["apply_date_month"].ToString();
                model.applyStatus        = ds.Tables[0].Rows[0]["apply_status"].ToString();
                model.dataObs            = ds.Tables[0].Rows[0]["data_obs"].ToString();
                model.dataSize           = ds.Tables[0].Rows[0]["data_size"].ToString();
                model.applyReason        = ds.Tables[0].Rows[0]["apply_reason"].ToString();
                model.rejectReason       = ds.Tables[0].Rows[0]["reject_reason"].ToString();
                model.applyType          = ds.Tables[0].Rows[0]["apply_type"].ToString();
                model.lastApprovalUserId = ds.Tables[0].Rows[0]["last_approval_user"].ToString();
                model.lastApprovalDate   = ds.Tables[0].Rows[0]["last_approval_date"].ToString();
                return(model);
            }
            return(null);
        }
示例#2
0
        /// <summary>
        /// 根据申请ID更新申请信息
        /// </summary>
        /// <param name="apply">ApplyInfo</param>
        /// <returns></returns>
        public static int updateApplyInfo(ApplyInfo apply)
        {
            string sql = string.Format("update {0} set apply_status = '{1}',reject_reason='{2}',last_approval_user='******',last_approval_date='{4}' where  apply_id = '{5}'",
                                       applytable, apply.applyStatus, apply.rejectReason, apply.lastApprovalUserId, apply.lastApprovalDate, apply.applyId);

            return(SqlHelper.ExecuteNonQuery(sql));
        }