Esempio n. 1
0
        /// <summary>
        /// 查询应聘公司列表
        /// </summary>
        /// <param name="searchInfo"></param>
        /// <returns></returns>
        public DataTable CompanieQry(CompanieSearchInfo searchInfo)
        {
            IList<SqlParameter> arrParameter = new List<SqlParameter>();

            //设置参数
            arrParameter.Add(new SqlParameter("@name", searchInfo.Name));
            arrParameter.Add(new SqlParameter("@user_to_state", searchInfo.UserToState));
            arrParameter.Add(new SqlParameter("@page_index", searchInfo.PageIndex));
            arrParameter.Add(new SqlParameter("@page_size", searchInfo.PageSize));
            arrParameter.Add(new SqlParameter { ParameterName = "@rows_count", Direction = ParameterDirection.Output, SqlDbType=SqlDbType.Int });

            DataTable dtCompanieQry = SqlHelper.GetTableProducts("companies_qry_sp", arrParameter.ToArray())[0];

            searchInfo.RowsCount = Convert.ToInt32(arrParameter.First(p => p.ParameterName == "@rows_count").SqlValue.ToString());

            return dtCompanieQry;
        }
Esempio n. 2
0
        /// <summary>
        /// 查询应聘公司列表
        /// </summary>
        /// <param name="searchInfo"></param>
        /// <returns></returns>
        public IList<Company> CompanieQry(CompanieSearchInfo searchInfo)
        {
            DataTable dtCompanieQry = dal.CompanieQry(searchInfo);

            IList<Company> list = new List<Company>();
            foreach (DataRow dr in dtCompanieQry.Rows)
            {
                list.Add(new Company
                {
                    Id = Functions.ToConvert<int>(dr["Id"]),
                    Name = Functions.ToConvert<string>(dr["Name"]),
                    Address = Functions.ToConvert<string>(dr["Address"]),
                    UserToState = (UserToState)Enum.Parse(typeof(UserToState), Functions.ToConvert<string>(dr["UserToState"]), true),
                    WorkToDate = Functions.ToConvert<string>(dr["WorkToDate"]),
                    CreateDate = Functions.ToConvert<DateTime>(dr["CreateDate"])
                });
            }
            return list;
        }
Esempio n. 3
0
 public DataTable CompanieQry(CompanieSearchInfo searchInfo)
 {
     throw new NotImplementedException();
 }
Esempio n. 4
0
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="PageIndex">当前页</param>
        /// <param name="Name">公司</param>
        /// <param name="createdateFlag">按日期排序</param>
        /// <returns></returns>
        public ActionResult Index(int PageIndex = 1, string Name = "",int UserToState=-1)
        {
            CompanieSearchInfo searchInfo = new CompanieSearchInfo
            {
                Name = Name,
                UserToState=UserToState,
                PageIndex = PageIndex,
                PageSize = MyBlogConfiguration.PagerSize
            };

            IList<Company> ltCompany = Biz.CompanieQry(searchInfo);

            if (ltCompany != null)
            {
                ViewBag.VBCompanieSearchInfo = searchInfo;
                return View(ltCompany);
            }
            return HttpNotFound();
        }