Example #1
0
        /// <summary>
        /// 获取通过的岗位数
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public int ReadPostPassNum(int userID)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("select count(1) from [" + ShopMssqlHelper.TablePrefix + "PassPost] where [UserID]=" + userID + " and [IsRZ]=1 and [postid] in (select [postid] from [_post])");
            return((int)DbSQLHelper.GetSingle(sql.ToString()));
        }
Example #2
0
        public int AddPost(PostInfo Model)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("Insert into [" + ShopMssqlHelper.TablePrefix + "Post] ( [PostName],[PostPlan],[ParentId],[OrderIndex],[Locked],[IsPost],[CompanyID]) values(@PostName,@PostPlan,@ParentId,@OrderIndex,@Locked,@IsPost,@CompanyID)");
            sql.Append("SELECT @@identity");
            SqlParameter[] par = (SqlParameter[])this.ValueParas(Model);
            return(Convert.ToInt32(DbSQLHelper.GetSingle(sql.ToString(), par)));
        }
Example #3
0
        /// <summary>
        /// 查询时间段内公司变化总数
        /// </summary>
        /// <param name="CompanyId">公司Id</param>
        /// <param name="StartDate">开始日期</param>
        /// <param name="EndDate">结束日期</param>
        /// <returns></returns>
        public int CompanyChangeNum(int CompanyId, DateTime StartDate, DateTime EndDate)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("Select Sum(ChangeNum) From [" + ShopMssqlHelper.TablePrefix + "CompanyRecord] Where CompanyId=" + CompanyId + " and CreateDate Between '" + StartDate + "' and '" + EndDate + "'");
            object Result = DbSQLHelper.GetSingle(sql.ToString());

            if (object.Equals(Result, null))
            {
                Result = 0;
            }
            return(int.Parse(Result.ToString()));
        }
Example #4
0
        /// <summary>
        /// 查询公司变化总数
        /// </summary>
        /// <param name="CompanyId"></param>
        /// <returns></returns>
        public int CompanyChangeNum(int CompanyId)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("Select Sum(ChangeNum) From [" + ShopMssqlHelper.TablePrefix + "CompanyRecord] Where CompanyId=" + CompanyId);
            object Result = DbSQLHelper.GetSingle(sql.ToString());

            if (object.Equals(Result, null))
            {
                Result = 0;
            }
            return(int.Parse(Result.ToString()));
        }
Example #5
0
        /// <summary>
        /// 读取公司岗位开始时间
        /// </summary>
        /// <param name="Model"></param>
        /// <returns></returns>
        public DateTime ReadCompanyPostPlan(int CompanyId, int PostId)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("Select top 1 StartDate From [" + ShopMssqlHelper.TablePrefix + "CompanyPostPlan] Where CompanyId in (" + CompanyId + ") and PostId Like '%|" + PostId + "|%' order by Id desc");
            object Result = DbSQLHelper.GetSingle(sql.ToString());

            if (object.Equals(Result, null))
            {
                Result = DateTime.MinValue;
            }
            return(Convert.ToDateTime(Result.ToString()));
        }