/// <summary> /// 判断是否申请高级服务 /// </summary> /// <param name="companyId">公司编号</param> /// <param name="serviceType">高级服务项目</param> /// <returns></returns> public virtual bool IsApply(string companyId, EyouSoft.Model.CompanyStructure.SysService serviceType) { bool isApply = false; DbCommand cmd = this.SystemStore.GetSqlStringCommand(SQL_SELECT_IsApply); this.SystemStore.AddInParameter(cmd, "CompanyId", DbType.String, companyId); this.SystemStore.AddInParameter(cmd, "ServiceType", DbType.Byte, serviceType); using (IDataReader rdr = DbHelper.ExecuteReader(cmd, this.SystemStore)) { if (rdr.Read()) { isApply = rdr.GetInt32(0) == 0 ? false : true; } } return(isApply); }
/// <summary> /// 获取高级服务申请审核状态,返回null未申请 /// </summary> /// <param name="companyId">公司编号</param> /// <param name="serviceType">高级服务项目</param> /// <returns></returns> public EyouSoft.Model.SystemStructure.ApplyServiceState? GetApplyState(string companyId, EyouSoft.Model.CompanyStructure.SysService serviceType) { return(dal.GetApplyState(companyId, serviceType)); }
/// <summary> /// 判断是否申请高级服务 /// </summary> /// <param name="companyId">公司编号</param> /// <param name="serviceType">高级服务项目</param> /// <returns></returns> public bool IsApply(string companyId, EyouSoft.Model.CompanyStructure.SysService serviceType) { return(dal.IsApply(companyId, serviceType)); }
/// <summary> /// 按当前登录用户分管的区域范围获取快到期(提前一个月)服务信息集合 /// </summary> /// <param name="pageSize">每页记录数</param> /// <param name="pageIndex">当前页索引</param> /// <param name="recordCount">总记录数</param> /// <param name="serviceType">高级服务项目</param> /// <param name="provinceId">省份编号 为null时不做为查询条件</param> /// <param name="cityId">城市编号 为null时不做为查询条件</param> /// <param name="companyName">公司名称 为null时不做为查询条件</param> /// <param name="searchStartTime">搜索起始时间 为null时不做为查询条件</param> /// <param name="searchFinishTime">搜索截止时间 为null时不做为查询条件</param> /// <returns></returns> public IList <EyouSoft.Model.SystemStructure.SysApplyServiceInfo> GetComingExpireApplys(int pageSize, int pageIndex, ref int recordCount , EyouSoft.Model.CompanyStructure.SysService serviceType , int?provinceId, int?cityId, string companyName , DateTime?searchStartTime, DateTime?searchFinishTime) { DateTime?expireStartTime = null; DateTime?expireFinishTime = null; if (!(searchStartTime.HasValue || searchFinishTime.HasValue))//未按时间进行查询时默认查询一个月内到期的 { expireStartTime = DateTime.Today; expireFinishTime = expireStartTime.Value.AddMonths(1); } if (searchFinishTime.HasValue) { searchFinishTime = searchFinishTime.Value.AddDays(1); } return(dal.GetComingExpireApplys(pageSize, pageIndex, ref recordCount , serviceType, expireStartTime, expireFinishTime , this.GetWebMasterArea(), provinceId, cityId, companyName, searchStartTime, searchFinishTime)); }
/// <summary> /// 按当前登录用户分管的区域范围获取高级服务申请信息集合 /// </summary> /// <param name="pageSize">每页记录数</param> /// <param name="pageIndex">当前页索引</param> /// <param name="recordCount">总记录数</param> /// <param name="serviceType">高级服务项目</param> /// <param name="provinceId">省份编号 为null时不做为查询条件</param> /// <param name="cityId">城市编号 为null时不做为查询条件</param> /// <param name="companyName">公司名称 为null时不做为查询条件</param> /// <param name="applyStartTime">申请起始时间 为null时不做为查询条件</param> /// <param name="applyFinishTime">申请截止时间 为null时不做为查询条件</param> /// <param name="applyState">审核状态 为null时不做为查询条件</param> /// <returns></returns> public IList <EyouSoft.Model.SystemStructure.SysApplyServiceInfo> GetApplys(int pageSize, int pageIndex, ref int recordCount , EyouSoft.Model.CompanyStructure.SysService serviceType, int?provinceId, int?cityId, string companyName, DateTime?applyStartTime, DateTime?applyFinishTime , EyouSoft.Model.SystemStructure.ApplyServiceState?applyState) { return(dal.GetApplys(pageSize, pageIndex, ref recordCount, serviceType , provinceId, cityId, companyName, applyStartTime, applyFinishTime , applyState, this.GetWebMasterArea())); }
/// <summary> /// 获取高级服务申请信息业务实体 /// </summary> /// <param name="companyId">公司编号</param> /// <param name="serviceType">高级服务项目</param> /// <returns></returns> public EyouSoft.Model.SystemStructure.SysApplyServiceInfo GetApplyInfo(string companyId, EyouSoft.Model.CompanyStructure.SysService serviceType) { return(dal.GetApplyInfo(companyId, serviceType)); }
/// <summary> /// 获取高级服务申请审核状态,返回null未申请 /// </summary> /// <param name="companyId">公司编号</param> /// <param name="serviceType">高级服务项目</param> /// <returns></returns> public virtual EyouSoft.Model.SystemStructure.ApplyServiceState? GetApplyState(string companyId, EyouSoft.Model.CompanyStructure.SysService serviceType) { EyouSoft.Model.SystemStructure.ApplyServiceState?state = null; DbCommand cmd = this.SystemStore.GetSqlStringCommand(SQL_SELECT_GetApplyState); this.SystemStore.AddInParameter(cmd, "CompanyId", DbType.String, companyId); this.SystemStore.AddInParameter(cmd, "ServiceType", DbType.Byte, serviceType); using (IDataReader rdr = DbHelper.ExecuteReader(cmd, this.SystemStore)) { if (rdr.Read()) { state = (EyouSoft.Model.SystemStructure.ApplyServiceState)rdr.GetByte(0); } } return(state); }
/// <summary> /// 获取快到期服务信息集合 /// </summary> /// <param name="pageSize">每页记录数</param> /// <param name="pageIndex">当前页索引</param> /// <param name="recordCount">总记录数</param> /// <param name="serviceType">高级服务项目</param> /// <param name="expireStartTime">到期起始时间 为null时不做为查询条件</param> /// <param name="expireFinishTime">到期截止时间 为null时不做为查询条件</param> /// <param name="userAreas">用户分管的区域范围 为null时不做为查询条件</param> /// <param name="provinceId">省份编号 为null时不做为查询条件</param> /// <param name="cityId">城市编号 为null时不做为查询条件</param> /// <param name="companyName">公司名称 为null时不做为查询条件</param> /// <param name="searchStartTime">搜索起始时间 为null时不做为查询条件</param> /// <param name="searchFinishTime">搜索截止时间 为null时不做为查询条件</param> /// <returns></returns> public virtual IList <EyouSoft.Model.SystemStructure.SysApplyServiceInfo> GetComingExpireApplys(int pageSize, int pageIndex, ref int recordCount , EyouSoft.Model.CompanyStructure.SysService serviceType, DateTime?expireStartTime, DateTime?expireFinishTime , string userAreas , int?provinceId, int?cityId, string companyName , DateTime?searchStartTime, DateTime?searchFinishTime) { IList <EyouSoft.Model.SystemStructure.SysApplyServiceInfo> services = new List <EyouSoft.Model.SystemStructure.SysApplyServiceInfo>(); StringBuilder cmdQuery = new StringBuilder(); string tableName = "tbl_SysApplyService"; string primaryKey = "Id"; string orderByString = "ApplyState ASC,CheckTime DESC,ApplyTime DESC"; string fields = "*"; #region 拼接查询条件 cmdQuery.AppendFormat(" ApplyState=1 AND ServiceType={0} ", (int)serviceType); if (expireStartTime.HasValue) { cmdQuery.AppendFormat(" AND ExpireTime>='{0}' ", expireStartTime.Value); } if (expireFinishTime.HasValue) { cmdQuery.AppendFormat(" AND ExpireTime<='{0}' ", expireFinishTime.Value); } if (!string.IsNullOrEmpty(userAreas)) { cmdQuery.AppendFormat(" AND CityId IN({0}) ", userAreas); } if (provinceId.HasValue) { cmdQuery.AppendFormat(" AND ProvinceId={0} ", provinceId.Value); } if (cityId.HasValue) { cmdQuery.AppendFormat(" AND CityId={0} ", cityId.Value); } if (!string.IsNullOrEmpty(companyName)) { cmdQuery.AppendFormat(" AND CompanyName LIKE '%{0}%' ", companyName); } if (searchStartTime.HasValue) { cmdQuery.AppendFormat(" AND ExpireTime>='{0}' ", searchStartTime.Value); } if (searchFinishTime.HasValue) { cmdQuery.AppendFormat(" AND ExpireTime<='{0}' ", searchFinishTime.Value); } #endregion using (IDataReader rdr = DbHelper.ExecuteReader(this.SystemStore, pageSize, pageIndex, ref recordCount, tableName, primaryKey, fields, cmdQuery.ToString(), orderByString)) { while (rdr.Read()) { EyouSoft.Model.SystemStructure.SysApplyServiceInfo info = new EyouSoft.Model.SystemStructure.SysApplyServiceInfo(); info.ApplyId = rdr.GetString(rdr.GetOrdinal("Id")); info.ApplyServiceType = (EyouSoft.Model.CompanyStructure.SysService)rdr.GetByte(rdr.GetOrdinal("ServiceType")); info.ApplyState = (EyouSoft.Model.SystemStructure.ApplyServiceState)rdr.GetByte(rdr.GetOrdinal("ApplyState")); info.ApplyText = rdr["ApplyText"].ToString(); info.ApplyTime = rdr.GetDateTime(rdr.GetOrdinal("ApplyTime")); info.CheckText = rdr["CheckText"].ToString(); if (!rdr.IsDBNull(rdr.GetOrdinal("CheckTime"))) { info.CheckTime = rdr.GetDateTime(rdr.GetOrdinal("CheckTime")); } info.CityId = rdr.GetInt32(rdr.GetOrdinal("CityId")); info.CityName = rdr["CityName"].ToString(); info.CompanyId = rdr.GetString(rdr.GetOrdinal("CompanyId")); info.CompanyName = rdr["CompanyName"].ToString(); info.ContactAddress = rdr["CompanyAdress"].ToString(); info.ContactMobile = rdr["ContactMobile"].ToString(); info.ContactMQ = rdr["ContactMQ"].ToString(); info.ContactName = rdr["ContactName"].ToString(); info.ContactQQ = rdr["ContactQQ"].ToString(); info.ContactTel = rdr["ContactTel"].ToString(); if (!rdr.IsDBNull(rdr.GetOrdinal("EnableTime"))) { info.EnableTime = rdr.GetDateTime(rdr.GetOrdinal("EnableTime")); } if (!rdr.IsDBNull(rdr.GetOrdinal("ExpireTime"))) { info.ExpireTime = rdr.GetDateTime(rdr.GetOrdinal("ExpireTime")); } info.OperatorId = rdr.GetInt32(rdr.GetOrdinal("OperatorID")); info.ProvinceId = rdr.GetInt32(rdr.GetOrdinal("ProvinceId")); info.ProvinceName = rdr["ProvinceName"].ToString(); info.UserId = rdr.GetString(rdr.GetOrdinal("UserID")); services.Add(info); } } return(services); }
/// <summary> /// 获取高级服务申请信息业务实体 /// </summary> /// <param name="companyId">公司编号</param> /// <param name="serviceType">高级服务项目</param> /// <returns></returns> public virtual EyouSoft.Model.SystemStructure.SysApplyServiceInfo GetApplyInfo(string companyId, EyouSoft.Model.CompanyStructure.SysService serviceType) { DbCommand cmd = this.SystemStore.GetSqlStringCommand(SQL_SELECT_GetApplyInfo + " AND CompanyId=@CompanyId AND ServiceType=@ServiceType"); this.SystemStore.AddInParameter(cmd, "CompanyId", DbType.String, companyId); this.SystemStore.AddInParameter(cmd, "ServiceType", DbType.Byte, serviceType); return(GetApplyInfo(cmd)); }