/// <summary> /// 获取车辆申请列表 /// </summary> private void UserCarList() { int type = this.GetFormValue("type", 0); // int pageindex = this.GetFormValue("page", 1); // int pageSize = this.GetFormValue("pagesize", 20); int status = this.GetFormValue("status", -2); int recordCount = 0; SearchWhere where = new SearchWhere(); where.key = this.GetFormValue("name", ""); where.type = type; where.Status = status; List <UserCarInfoModel> result = UserCarLogic.Instance.GetUserCarList(pageindex, pageSize, out recordCount, where); int pageCount = recordCount / pageSize; if (recordCount % pageSize != 0) { ++pageCount; } this.Data["PageSize"] = pageSize; this.Data["PageIndex"] = pageindex; this.Data["Total"] = recordCount; this.Data["PageCount"] = pageCount; this.Data["Rows"] = result; }
public void getMyApply(string token, int type, int pageIndex = 1) { VerifySignCheck(); try { pageIndex = pageIndex > 0 ? pageIndex : 1; SearchWhere where = new SearchWhere(); where.token = token; where.type = type; result.index = pageIndex; List <UserCarInfoModel> data = UserCarLogic.Instance.GetUserCarList(pageIndex, pageSize, out recordCount, where); if (data != null) { data.ForEach((item) => { item.StatusName = item.Status == 1 ? "通过" : item.Status == -1 ? "失败" : item.StatusName; item.Remark = string.IsNullOrEmpty(item.Remark) ? "" : item.Remark; }); result.setResult(ApiStatusCode.OK, data); } } catch (SoapException ex) { LogHelper.Debug(string.Format("StackTrace:{0},Message:{1}", ex.StackTrace, ex.Message), this.DebugMode); result.setResult(ApiStatusCode.务器错误, ex.Message); } JsonResult(result); }
public void getCustomerList(string token, int type, int pageIndex) { VerifySignCheck(); try { pageIndex = pageIndex > 0 ? pageIndex : 1; SearchWhere where = new SearchWhere(); where.token = token; where.type = type; result.index = pageIndex; var data = UserCarLogic.Instance.GetCusstomerList(pageIndex, pageSize, out recordCount, where); if (data != null) { result.setResult(ApiStatusCode.OK, data); } } catch (Exception ex) { LogHelper.Debug(string.Format("StackTrace:{0},Message:{1}", ex.StackTrace, ex.Message), this.DebugMode); result.setResult(ApiStatusCode.务器错误, ex.Message); } goto Finish; Finish: JsonResult(result); }
/// <summary> /// 获取客户列表 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <param name="recordCount"></param> /// <param name="where"></param> /// <returns></returns> public List <CustomerModel> GetCusstomerList(int pageIndex, int pageSize, out int recordCount, SearchWhere where) { return(dal.GetCusstomerList(pageIndex, pageSize, out recordCount, where)); }
/// <summary> /// 获取车辆信息 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <param name="recordCount"></param> /// <param name="where"></param> /// <returns></returns> public List <UserCarInfoModel> GetUserCarList(int pageIndex, int pageSize, out int recordCount, SearchWhere where) { return(dal.GetUserCarList(pageIndex, pageSize, out recordCount, where)); }
/// <summary> /// 获取车辆信息 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <param name="recordCount"></param> /// <param name="where"></param> /// <returns></returns> public List <UserCarInfoModel> GetUserCarList(int pageIndex, int pageSize, out int recordCount, SearchWhere where) { string sql = @"select id,OrderNo,Type,A.Usertoken,carInfo,carType,invoicePrice,InsuranceType,FristBeneficiary,agreement,WIE,City,CustomerId,Status,ApplyAge,LoanMoney,RepaymentPeriod,A.CreateTime,Remark,c.UserName as storeName from MD_ApplyCarInsurance A left join MD_CustomerList c on c.UserId=CustomerId where 1=1 "; if (where != null) { if (!string.IsNullOrEmpty(where.key)) { if (where.type == 1) { sql += string.Format(" and (carType like '%{0}%' or City like '%{0}%' or InsuranceType like '%{0}%' or agreement like '%{0}%' or FristBeneficiary like '%{0}%')", where.key); } else if (where.type == 0) { sql += string.Format(" and (carInfo like '%{0}%' or carType like '%{0}%' or City like '%{0}%' )", where.key); } } if (where.type > -1) { sql += string.Format(" and Type={0} ", where.type); } if (where.Status != -2) { sql += string.Format(" and Status={0} ", where.Status); } if (!string.IsNullOrEmpty(where.token)) { sql += string.Format(" and A.Usertoken='{0}' ", where.token); } } string querySql = DbHelperSQL.buildPageSql(pageIndex, pageSize, sql, "A.createtime"); string recordCountSql = DbHelperSQL.buildRecordCountSql(sql); recordCount = Convert.ToInt32(DbHelperSQL.GetSingle(recordCountSql)); List <UserCarInfoModel> lst = new List <UserCarInfoModel>(); using (SqlDataReader dr = DbHelperSQL.ExecuteReader(querySql)) { lst = DbHelperSQL.GetEntityList <UserCarInfoModel>(dr); } return(lst); }
/// <summary> /// 获取客户列表 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <param name="recordCount"></param> /// <param name="where"></param> /// <returns></returns> public List <CustomerModel> GetCusstomerList(int pageIndex, int pageSize, out int recordCount, SearchWhere where) { string sql = @"select UserId,UserToken,UserName,UserMobile,UserSex,UserIDCard,UserImg,CreateTime,UserType from MD_CustomerList where 1=1 "; if (where != null) { if (!string.IsNullOrEmpty(where.key)) { sql += string.Format(" and UserName like '%{0}%' ", where.key); } if (!string.IsNullOrEmpty(where.token)) { sql += string.Format(" and Usertoken='{0}' ", where.token); } } string querySql = DbHelperSQL.buildPageSql(pageIndex, pageSize, sql, "CreateTime", true); string recordCountSql = DbHelperSQL.buildRecordCountSql(sql); recordCount = Convert.ToInt32(DbHelperSQL.GetSingle(recordCountSql)); List <CustomerModel> lst = new List <CustomerModel>(); using (SqlDataReader dr = DbHelperSQL.ExecuteReader(querySql)) { lst = DbHelperSQL.GetEntityList <CustomerModel>(dr); } return(lst); }
public SearchParams(SearchType type, SearchWhere where, string what, bool MatchCase, bool MatchWholeWord) { this.Type = type; this.Where = where; this.What = what; this.MatchCase = MatchCase; this.MatchWholeWord = MatchWholeWord; }
private void SearchTextInFiles(SearchWhere where, string what, bool MatchCase, bool MatchWholeWord) { List<BuildFileWrapper> FilesList = new List<BuildFileWrapper>(); List<LibraryWrapper> CheckedLibrariesList = new List<LibraryWrapper>(); if ((where == SearchWhere.All) || (where == SearchWhere.PKDatabase)) { foreach (LibraryWrapper LW in m_inv.Libraries) { FilesList.Clear(); if (Solution != null) { if (Solution.IsReference(LW)) { FilesList.AddRange(LW.FastCompileFiles); FilesList.AddRange(LW.HeaderFiles); FilesList.AddRange(LW.OtherFiles); FilesList.AddRange(LW.SourceFiles); } } else { FilesList.AddRange(LW.FastCompileFiles); FilesList.AddRange(LW.HeaderFiles); FilesList.AddRange(LW.OtherFiles); FilesList.AddRange(LW.SourceFiles); } SearchResultsHolder.SearchComponentDescriptor LibraryDesc = new SearchResultsHolder.SearchComponentDescriptor(ComponentWrapper.GetComponentWrapper(LW)); foreach (BuildFileWrapper file in FilesList) { this.CheckTextInFile(LibraryDesc, file, what, MatchCase, MatchWholeWord); } } } if ((where == SearchWhere.All) || (where == SearchWhere.Solution)) { if (Solution != null) { foreach (ProjectWrapper PW in Solution.Projects) { foreach (ComponentWrapper CW in PW.Libraries) { LibraryWrapper LW = this.FindLibrary(CW.Guid); if ((LW != null))// && (!Libs.Contains(LW))) { if (CheckedLibrariesList.Contains(LW)) continue; CheckedLibrariesList.Add(LW); FilesList.Clear(); FilesList.AddRange(LW.FastCompileFiles); FilesList.AddRange(LW.HeaderFiles); FilesList.AddRange(LW.OtherFiles); FilesList.AddRange(LW.SourceFiles); //SearchResultsHolder.ComponentDescriptor ProjectDesc = new SearchResultsHolder.ComponentDescriptor(); //ProjectDesc.Component = ComponentWrapper.GetComponentWrapper(PW); //ProjectDesc.Parent = new SearchResultsHolder.ComponentDescriptor(null, ComponentWrapper.GetComponentWrapper(Solution)); //SearchResultsHolder.ComponentDescriptor LibraryDesc = new SearchResultsHolder.ComponentDescriptor(ProjectDesc, ComponentWrapper.GetComponentWrapper(LW)); SearchResultsHolder.SearchComponentDescriptor LibraryDesc = new SearchResultsHolder.SearchComponentDescriptor(new SearchResultsHolder.SearchComponentDescriptor(null, ComponentWrapper.GetComponentWrapper(Solution)), ComponentWrapper.GetComponentWrapper(LW)); if (!Solution.IsReference(LW)) { foreach (BuildFileWrapper file in FilesList) { this.CheckTextInFile(LibraryDesc, file, what, MatchCase, MatchWholeWord); } } } } } } } }
/// <summary> /// Searchs in Features /// </summary> /// <param name="what"></param> /// <param name="MatchCase"></param> /// <param name="MatchWholeWord"></param> private void SearchInFeatures(SearchWhere where, string what, bool MatchCase, bool MatchWholeWord) { if ((where == SearchWhere.All) || (where == SearchWhere.PKDatabase)) { foreach (FeatureWrapper FW in m_inv.Features) { this.CheckFeature(FW, what, MatchCase, MatchWholeWord); } } if ((where == SearchWhere.All) || (where == SearchWhere.Solution)) { if (Solution != null) { foreach (ProjectWrapper PW in Solution.Projects) { foreach (ComponentWrapper CW in PW.Features) { FeatureWrapper FW = this.FindFeature(CW.Guid); if ((FW != null))// && (!Libs.Contains(LW))) { SearchResultsHolder.SearchComponentDescriptor ProjectDesc = new SearchResultsHolder.SearchComponentDescriptor(); ProjectDesc.Component = ComponentWrapper.GetComponentWrapper(PW); ProjectDesc.Parent = new SearchResultsHolder.SearchComponentDescriptor(null, ComponentWrapper.GetComponentWrapper(Solution)); this.CheckFeature(ProjectDesc, FW, what, MatchCase, MatchWholeWord); } } } } } }
/// <summary> /// Searchs in LibraryCategories /// </summary> /// <param name="what"></param> /// <param name="MatchCase"></param> /// <param name="MatchWholeWord"></param> private void SearchInLibraryCategories(SearchWhere where, string what, bool MatchCase, bool MatchWholeWord) { if ((where == SearchWhere.All) || (where == SearchWhere.PKDatabase)) { foreach (LibraryCategoryWrapper LCW in m_inv.LibraryCategories) { this.CheckLibraryCategory(LCW, what, MatchCase, MatchWholeWord); } } if ((where == SearchWhere.All) || (where == SearchWhere.Solution)) { if (Solution != null) { foreach (ProjectWrapper PW in Solution.Projects) { foreach (ComponentWrapper CW in PW.LibraryCategories) { LibraryCategoryWrapper LCW = this.FindLibraryCategory(CW.Guid); if ((LCW != null))// && (!Libs.Contains(LW))) { SearchResultsHolder.SearchComponentDescriptor ProjectDesc = new SearchResultsHolder.SearchComponentDescriptor(); ProjectDesc.Component = ComponentWrapper.GetComponentWrapper(PW); ProjectDesc.Parent = new SearchResultsHolder.SearchComponentDescriptor(null, ComponentWrapper.GetComponentWrapper(Solution)); this.CheckLibraryCategory(ProjectDesc, LCW, what, MatchCase, MatchWholeWord); } } } } } }
/// <summary> /// Searchs components in inventory /// </summary> /// <param name="type">Search type</param> /// <param name="what">Search what</param> /// <param name="MatchCase">Match case</param> /// <param name="MatchWholeWord">Match whiole word</param> public void Search(SearchType type, SearchWhere where, string what, bool MatchCase, bool MatchWholeWord) { if (!this.m_SearchWorker.IsBusy) this.m_SearchWorker.RunWorkerAsync(new SearchParams(type, where, what, MatchCase, MatchWholeWord)); }