/// <summary> /// 新增招聘信息 /// </summary> /// <param name="query"></param> /// <returns></returns> public Result_Msg AddJob(QueryCommon <JobsAddQuery> query) { Result_Msg res = new Result_Msg(); Jobs job = new Jobs() { JobTitle = query.ParamInfo.JobTitle, JobContent = query.ParamInfo.JobContent, CreateDate = query.ParamInfo.CreateDate, UpdateDate = query.ParamInfo.UpdateDate, StartDate = query.ParamInfo.StartDate, EndDate = query.ParamInfo.EndDate, UserId = query.ParamInfo.UserId, UserType = query.ParamInfo.UserType, ApprovalStatus = query.ParamInfo.ApprovalStatus, Reviewer = query.ParamInfo.Reviewer, PayrolHigh = query.ParamInfo.PayrolHigh, PayrolLow = query.ParamInfo.PayrolLow, PayrollType = query.ParamInfo.PayrollType, TypeOfCurrency = query.ParamInfo.TypeOfCurrency, WorkPlace = query.ParamInfo.WorkPlace, WorkType = query.ParamInfo.WorkType, CompanyTel = query.ParamInfo.CompanyTel, CompanyEmail = query.ParamInfo.CompanyEmail, LanguageType = query.ParamInfo.LanguageType }; context.Jobs.Add(job); res.IsSuccess = context.SaveChanges() == 1; return(res); }
/// <summary> /// 获取当前登录用户类型信息 /// </summary> /// <param name="query"></param> /// <returns></returns> public string GetCurrentUserType(QueryCommon <IWantToBuyQuery> query) { Result_Model <CurrentUserInfo> res = new Result_Model <CurrentUserInfo>() { Model = new CurrentUserInfo(), Msg = new Result_Msg() { IsSuccess = true } }; if (base.CurrentUser != null) { res.Model.Id = base.CurrentUser.Id; res.Model.UserType = base.CurrentUser.UserType; res.Model.UserName = base.CurrentUser.UserName; } else { res.Msg = new Result_Msg() { IsSuccess = false, Message = "获取当前用户登陆信息失败" }; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
public string Get_PageInfo(QueryCommon <WhatBusyQuery> query) { Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); resModel = whatBuys.Get_PageInfo(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public string GetLawInfoList_Web(QueryCommon <LawInfoQuery_Web> query) { ILawInfoService jobsService = ServiceHelper.Create <ILawInfoService>(); Result_List_Pager <Result_LawInfo> res = jobsService.GetLawInfoList_Web(query); List <Result_AttachmentInfo> resItem = new List <Result_AttachmentInfo>(); foreach (var item in res.List) { resItem = GetObjectList_ById_Web(item.Id).List.Where(x => x.AttachmentName != null && x.AttachmentName != "" && x.AttachmentName.LastIndexOf('.') > 0).ToList(); if (resItem != null && resItem.Count > 0) { Result_AttachmentInfo imgItem = resItem.Where(x => HashSet_Common.ImageTypeArr.Contains(x.AttachmentName.Substring(x.AttachmentName.LastIndexOf('.'), x.AttachmentName.Length - x.AttachmentName.LastIndexOf('.')))).FirstOrDefault(); if (imgItem != null) { item.AttachmentName = imgItem.AttachmentName; } else { item.AttachmentName = ""; } } else { item.AttachmentName = ""; } } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
/// <summary> /// 修改幻灯片信息 /// </summary> /// <param name="query"></param> /// <returns></returns> public Result_Msg ModifyBannerIndex(QueryCommon <BannerIndexQuery> query) { Result_Msg res = new Result_Msg(); BannersIndex bannerIndexOld = context.BannersIndex.FindById <BannersIndex>(query.ParamInfo.Id); if (bannerIndexOld != null) { bannerIndexOld.BannerTitle = query.ParamInfo.BannerTitle; bannerIndexOld.BannerDes = query.ParamInfo.BannerDes; bannerIndexOld.ManagerId = query.ParamInfo.ManagerId; bannerIndexOld.TargetName = query.ParamInfo.TargetName; bannerIndexOld.Url = query.ParamInfo.Url; bannerIndexOld.LanguageType = query.ParamInfo.LanguageType; bannerIndexOld.ShopId = 1; try { res.IsSuccess = context.SaveChanges() == 1; } catch (Exception ex) { res.Message = "修改失败:" + ex.Message; } } else { res.IsSuccess = false; res.Message = "修改失败,数据库中不存在该记录"; } return(res); }
/// <summary> /// 会议列表 /// </summary> /// <param name="query"></param> /// <returns></returns> public Result_List_Pager <Result_MeetingInfo> GetMeetingsList_Web(QueryCommon <MeetingInfoQuery_Web> query) { Result_List_Pager <Result_MeetingInfo> res = new Result_List_Pager <Result_MeetingInfo>() { List = new List <Result_MeetingInfo>(), PageInfo = new PageInfo(), Msg = new Result_Msg() { IsSuccess = true } }; try { var linqList = from listMeet in context.MeetingInfo select listMeet; if (query.ParamInfo.LanguageType != 0) { //语言类型(0:所有 ;1:中文;2:英文;) linqList = linqList.Where(x => x.LanguageType == query.ParamInfo.LanguageType); } if (query.ParamInfo.Type == 1)//最新 { linqList = linqList.Where(x => x.MeetingTime >= query.ParamInfo.EndTime); } if (query.ParamInfo.Type == 2)//历史 { linqList = linqList.Where(x => x.MeetingTime < query.ParamInfo.EndTime); } if (query.ParamInfo.Type == 0) { linqList = linqList.Where(x => x.MeetingTime >= query.ParamInfo.StartTime && x.MeetingTime < query.ParamInfo.EndTime); } int total = linqList.Count(); List <MeetingInfo> list = linqList.OrderBy(p => p.MeetingTime).OrderByDescending(p => p.Id).Skip((query.PageInfo.CurrentPage - 1) * query.PageInfo.PageSize).Take(query.PageInfo.PageSize).ToList(); res.List = list.Select(x => new Result_MeetingInfo() { Id = x.Id, Title = x.Title, CreatDate = x.CreatDate, MeetingContent = x.MeetingContent, MeetingPlace = x.MeetingPlace, MeetingTime = x.MeetingTime.ToString("yyyy-MM-dd HH:mm"), ContinueTime = x.ContinueTime, UserId = x.UserId }).ToList(); res.PageInfo.CurrentPage = query.PageInfo.CurrentPage; res.PageInfo.PageSize = query.PageInfo.PageSize; res.PageInfo.Total = total; res.PageInfo.PageCount = Convert.ToInt32(Math.Ceiling((double)total / (double)query.PageInfo.PageSize)); } catch (Exception ex) { res.Msg.IsSuccess = false; res.Msg.Message = "查询失败,失败原因:" + ex.Message; } return(res); }
public string Get_PageInfo_Default_Web(QueryCommon <IWantToBuyQuery> query) { Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); resModel = iWantToBuyService.Get_PageInfo_Web_Supply(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public string Get_PageInfo(QueryCommon <JobsQuery> query) { Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); resModel = jobsService.Get_PageInfo(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public string GetBannerList(QueryCommon <BannerIndexQuery> query) { Result_List_Pager <Result_BannersIndex> res = new Result_List_Pager <Result_BannersIndex>(); Result_List_Pager <BannersIndex> resService = bannerIndexService.GetBannerList(query); if (resService.Msg.IsSuccess) { var listHash = hashSet.Get_DictionariesList(); res.List = resService.List.Select(x => new Result_BannersIndex() { Id = x.Id, BannerDes = x.BannerDes, BannerTitle = x.BannerTitle, LanguageType = x.LanguageType == 1 ? listHash.Where(y => y.DictionaryTypeId == 10 && y.DValue == x.LanguageType.ToString()).FirstOrDefault().DKey : listHash.Where(y => y.DictionaryTypeId == 10 && y.DValue == x.LanguageType.ToString()).FirstOrDefault().Remarks, ManagerId = x.ManagerId, ShopId = x.ShopId, TargetName = x.TargetName, Url = x.Url }).ToList(); res.Msg = resService.Msg; res.PageInfo = resService.PageInfo; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
public string Update_Apply(QueryCommon <ApplyAmountInfo> query) { query.ParamInfo.ApplyStatus = 0; query.ParamInfo.ApplyDate = DateTime.Now; Result_Msg res = ServiceHelper.Create <IApplyAmountService>().Update_Apply(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
public string Get_PageInfo(QueryCommon <LawInfoQuery_Web> query) { Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); ILawInfoService jobsService = ServiceHelper.Create <ILawInfoService>(); resModel = jobsService.Get_PageInfo_Web(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public string Get_PageInfo(QueryCommon <BannerIndexQuery> query) { Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); IBannersIndexService bannerService = ServiceHelper.Create <IBannersIndexService>(); resModel = bannerService.Get_PageInfo(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public string Get_PageInfo_Member(QueryCommon <IWantToBuyQuery> query) { Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); query.ParamInfo.PurchaseID = base.CurrentUser.Id; resModel = supplyService.Get_PageInfo_IWantToBuyList_SupplyUser(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
/// <summary> /// 会议列表 /// </summary> /// <param name="query"></param> /// <returns></returns> public Result_List_Pager <Result_LawInfo> GetLawInfoList_Web(QueryCommon <LawInfoQuery_Web> query) { Result_List_Pager <Result_LawInfo> res = new Result_List_Pager <Result_LawInfo>() { List = new List <Result_LawInfo>(), PageInfo = new PageInfo(), Msg = new Result_Msg() { IsSuccess = true } }; try { var linqList = from listMeet in context.LawInfo select listMeet; if (query.ParamInfo.LanguageType != 0) { //语言类型(0:所有 ;1:中文;2:英文;) linqList = linqList.Where(x => x.LanguageType == query.ParamInfo.LanguageType); } if (query.ParamInfo.Title != null && query.ParamInfo.Title != string.Empty) { linqList = linqList.Where(x => x.Title.IndexOf(query.ParamInfo.Title) != -1); } if (query.ParamInfo.StartTime != null && query.ParamInfo.EndTime != null) { linqList = linqList.Where(x => x.CreateTime >= query.ParamInfo.StartTime && x.CreateTime <= query.ParamInfo.EndTime); } if (!string.IsNullOrWhiteSpace(query.ParamInfo.LawsInfo)) { linqList = linqList.Where(x => x.LawsInfo.Contains(query.ParamInfo.LawsInfo)); } int total = linqList.Count(); List <LawInfo> list = linqList.OrderBy(p => p.CreateTime).OrderByDescending(p => p.Id).Skip((query.PageInfo.CurrentPage - 1) * query.PageInfo.PageSize).Take(query.PageInfo.PageSize).ToList(); res.List = list.Select(x => new Result_LawInfo() { Id = x.Id, Title = x.Title, CreateTime = x.CreateTime, Author = x.Author, LawsInfo = x.LawsInfo, UserId = x.UserId }).ToList(); res.PageInfo.CurrentPage = query.PageInfo.CurrentPage; res.PageInfo.PageSize = query.PageInfo.PageSize; res.PageInfo.Total = total; res.PageInfo.PageCount = Convert.ToInt32(Math.Ceiling((double)total / (double)query.PageInfo.PageSize)); } catch (Exception ex) { res.Msg.IsSuccess = false; res.Msg.Message = "查询失败,失败原因:" + ex.Message; } return(res); }
public string IWantToBuyOrderAdd(QueryCommon <IWantToSupplyQuery> query) { DateTime now = DateTime.Now; Result_Model <IWantToSupply> res = iWantToBuyService.GetObjectById_Supply(query.ParamInfo.Id); Result_Model <IWantToBuy_Orders> res1 = iWantToBuyService.AddIWantToBuyOrder(res.Model); return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
public string JobsList1(QueryCommon <JobsQuery> query) { Result_List_Pager <Result_Jobs> res = new Result_List_Pager <Result_Jobs>(); query.ParamInfo.UserId = base.CurrentUser.Id; query.ParamInfo.UserType = base.CurrentUser.UserType; IJobsService jobsService = ServiceHelper.Create <IJobsService>(); Result_List_Pager <Jobs> resList = jobsService.GetJobsList_Member(query); if (resList.Msg.IsSuccess) { try { var listHash = hashSet.Get_DictionariesList(); res.PageInfo = resList.PageInfo; res.Msg = resList.Msg; res.List = resList.List.Select(x => new Result_Jobs() { Id = x.Id, JobTitle = x.JobTitle, UserType = listHash.Where(y => y.DictionaryTypeId == 15 && y.DKey == x.UserType.ToString()).FirstOrDefault().DValue, JobContent = x.JobContent, UserId = x.UserId.ToString(), CreateDate = x.CreateDate.ToString("yyyy-MM-dd"), UpdateDate = x.UpdateDate.ToString("yyyy-MM-dd"), StartDate = x.StartDate.ToString("yyyy-MM-dd"), EndDate = x.EndDate.ToString("yyyy-MM-dd"), ApprovalStatus = listHash.Where(y => y.DictionaryTypeId == 14 && y.DKey == x.ApprovalStatus.ToString()).FirstOrDefault().DValue, Reviewer = x.Reviewer, Payrol_LowHigh = (x.PayrolLow.ToString() + '-' + x.PayrolHigh.ToString()), PayrollType = listHash.Where(y => y.DictionaryTypeId == 18 && y.DKey == x.PayrollType.ToString()).FirstOrDefault().DValue, TypeOfCurrency = listHash.Where(y => y.DictionaryTypeId == 1 && y.DValue == x.TypeOfCurrency.ToString()).FirstOrDefault().Remarks, WorkType = listHash.Where(y => y.DictionaryTypeId == 17 && y.DKey == x.WorkType.ToString()).FirstOrDefault().DValue, CompanyTel = x.CompanyTel, CompanyEmail = x.CompanyEmail, WorkPlace = x.WorkPlace, LanguageType = x.LanguageType == 1 ? listHash.Where(y => y.DictionaryTypeId == 10 && y.DValue == x.LanguageType.ToString()).FirstOrDefault().DKey : listHash.Where(y => y.DictionaryTypeId == 10 && y.DValue == x.LanguageType.ToString()).FirstOrDefault().Remarks }).ToList(); } catch (Exception ex) { res.Msg = new Result_Msg() { IsSuccess = false, Message = ex.Message }; } } else { res.Msg = resList.Msg; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
public string Get_PageInfo_Member(QueryCommon <JobsQuery> query) { Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); query.ParamInfo.UserId = base.CurrentUser.Id; query.ParamInfo.UserType = base.CurrentUser.UserType; resModel = jobsService.Get_PageInfo_Member(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public string Get_PageInfo_IWantToSupply_List(QueryCommon <IWantToBuyQuery> query) { if (base.CurrentUser != null) { query.ParamInfo.PurchaseID = base.CurrentUser.Id; } Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); resModel = iWantToBuyService.Get_PageInfo_IWantToSupply_List(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public string Get_PageInfo_Buy_Web(QueryCommon <IWantToBuyQuery> query) { query.ParamInfo = new IWantToBuyQuery(); if (base.CurrentUser != null) { query.ParamInfo.Id = base.CurrentUser.Id; } Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); resModel = iWantToBuyService.Get_PageInfo_Web_Buy(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public string IWantToBuy_Update(QueryCommon <IWantToBuyQuery> query) { Result_Msg res = new Result_Msg() { IsSuccess = true }; DateTime dtNow = DateTime.Now; query.ParamInfo.UpdateDate = dtNow; try { Result_Model <IWantToBuy> resIWantToBuy = iWantToBuyService.GetObjectById_Web_Buy(query.ParamInfo.Id); if (resIWantToBuy.Msg.IsSuccess) { switch (resIWantToBuy.Model.Status) { case 0: break; case 1: res.Message = "“废弃采购”采购单不能修改!"; res.IsSuccess = false; break; case 2: res.Message = "“终止公示”采购单不能修改!"; res.IsSuccess = false; break; case 3: res.Message = "“已确定”采购单不能修改!"; res.IsSuccess = false; break; default: break; } if (res.IsSuccess) { res = iWantToBuyService.IWantToBuy_Update(query); } } } catch (Exception ex) { res.IsSuccess = false; res.Message = ex.Message; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
public async Task <PagedView <CustomerDto> > GetPagedCustomers (string name, string cpf, string email, int page, int pageSize) { int totalItems = 0; PagedView <CustomerDto> result = new PagedView <CustomerDto>(); var offset = QueryCommon.OffSet(page, pageSize); string sql = @"SELECT FirstName + ' ' + LastName As Name, Email, Phone FROM dbo.CUSTOMER WHERE (Cpf = @Cpf OR ISNULL(@Cpf,'') = '') AND (Email = @Email OR ISNULL(@Email,'') = '') AND ((FirstName like @FirstName OR ISNULL(@FirstName,'') = '') OR (LastName like @LastName OR ISNULL(@LastName,'') = '')) "; string sqlPaged = QueryCommon.PagedQuery(orderBy: "Name", sql, offset, pageSize); string sqlTotalCount = QueryCommon.TotalItemsQuery(sql); var customers = await _database.GetConnection() .QueryAsync <CustomerDto>(sqlPaged, new { Cpf = cpf ?? string.Empty, Email = email ?? string.Empty, FirstName = $"%{name}%" ?? $"%{string.Empty}%", LastName = $"%{name}%" ?? $"%{string.Empty}%" }); totalItems = await _database.GetConnection() .ExecuteScalarAsync <int>(sqlTotalCount, new { Cpf = cpf ?? string.Empty, Email = email ?? string.Empty, FirstName = name ?? string.Empty, LastName = name ?? string.Empty }); result.Data = customers.ToList(); result.Page = page; result.PageSize = pageSize; result.TotalPages = totalItems / pageSize + (totalItems % pageSize == 0 ? 0 : 1); result.TotalItems = totalItems; return(result); }
public string ModifyBannerIndex(QueryCommon <BannerIndexQuery> query) { Result_Msg res = new Result_Msg(); if (base.CurrentManager != null && base.CurrentManager.Id > 0) { res = bannerIndexService.ModifyBannerIndex(query); } else { } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
/// <summary> /// 分页信息 /// </summary> /// <param name="query"></param> /// <returns></returns> public Result_Model <PageInfo> Get_PageInfo_Admin(QueryCommon <JobsQuery> query) { Result_Model <PageInfo> resPage = new Result_Model <PageInfo>() { Model = new PageInfo(), Msg = new Result_Msg() { IsSuccess = true } }; try { var linqList = from job in context.Jobs select job; #region 拼接 Linq 查询条件 if (query.ParamInfo.UserType != 0) { linqList = linqList.Where(x => x.UserType == query.ParamInfo.UserType); } if (query.ParamInfo.LanguageType != 0) { //语言类型(0:所有 ;1:中文;2:英文;) linqList = linqList.Where(x => x.LanguageType == query.ParamInfo.LanguageType); } if (query.ParamInfo.ApprovalStatus != 0) { linqList = linqList.Where(x => x.ApprovalStatus == query.ParamInfo.ApprovalStatus); } if (query.ParamInfo.JobTitle != null && query.ParamInfo.JobTitle != string.Empty) { linqList = linqList.Where(x => x.JobTitle.IndexOf(query.ParamInfo.JobTitle) != -1); } #endregion int total = linqList.Count(); resPage.Model.CurrentPage = query.PageInfo.CurrentPage; resPage.Model.PageSize = query.PageInfo.PageSize; resPage.Model.Total = total; resPage.Model.PageCount = Convert.ToInt32(Math.Ceiling((double)total / (double)query.PageInfo.PageSize)); } catch (Exception ex) { resPage.Msg = new Result_Msg() { IsSuccess = false, Message = ex.Message }; } return(resPage); }
public string IWantToBuyList_Web(QueryCommon <IWantToBuyQuery> query) { query.ParamInfo = new IWantToBuyQuery(); if (base.CurrentUser != null) { query.ParamInfo.PurchaseID = base.CurrentUser.Id; } Result_List_Pager <Result_IWantToBuy> res = new Result_List_Pager <Result_IWantToBuy>(); Result_List_Pager <IWantToBuy> resList = iWantToBuyService.Get_IWantToBuyList_Web_Buy(query); if (resList.Msg.IsSuccess) { var listHash = hashSet.Get_DictionariesList(); res.PageInfo = resList.PageInfo; res.Msg = resList.Msg; res.List = resList.List.Select(x => new Result_IWantToBuy() { Id = x.Id, PurchaseID = x.PurchaseID, ProductName = x.ProductName, PurchaseNum = x.PurchaseNum, Quantity = x.Quantity, Remarks = x.Remarks, TotalPrice = x.TotalPrice, Unit = x.Unit, UnitPrice = x.UnitPrice, Address = x.Address, Status = x.Status, StatusStr = listHash.Where(y => y.DictionaryTypeId == 107 && y.DKey == x.Status.ToString()).FirstOrDefault().DValue, //SupplyModel = GetObjectById_Web_Supply(x.Id, base.CurrentUser.Id), SupplyList = Get_SupplyList_ByIWantToBuyId(x.Id).List, DeliveryDate = x.DeliveryDate.ToString("yyyy-MM-dd hh:mm"), CreateDate = x.CreateDate.ToString("yyyy-MM-dd hh:mm"), StartDate = x.StartDate.ToString("yyyy-MM-dd hh:mm"), EndDate = x.EndDate.ToString("yyyy-MM-dd hh:mm"), UpdateDate = x.UpdateDate.ToString("yyyy-MM-dd hh:mm"), TypeOfCurrency = listHash.Where(y => y.DictionaryTypeId == 1 && y.DValue == x.TypeOfCurrency.ToString()).FirstOrDefault().Remarks }).ToList(); } else { res.Msg = resList.Msg; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
public string BannerAdd(QueryCommon <BannerIndexQuery> query) { Result_Msg res = new Result_Msg(); if (base.CurrentManager != null && base.CurrentManager.Id > 0) { res = bannerIndexService.BannerAdd(query); } else { res.IsSuccess = false; res.Message = "您尚未登陆,或登录超时,请重新登陆"; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
public string JobsAdd(QueryCommon <JobsAddQuery> query) { DateTime now = DateTime.Now; query.ParamInfo.UserId = base.CurrentUser.Id; query.ParamInfo.UserType = base.CurrentUser.UserType; query.ParamInfo.ApprovalStatus = 1; query.ParamInfo.CreateDate = now; query.ParamInfo.UpdateDate = now; IJobsService jobsService = ServiceHelper.Create <IJobsService>(); Result_Msg res = jobsService.AddJob(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
/// <summary> /// 获取招聘信息列表——Admin /// </summary> /// <param name="query"></param> /// <returns></returns> public Result_List_Pager <Jobs> GetJobsList_Admin(QueryCommon <JobsQuery> query) { Result_List_Pager <Jobs> res = new Result_List_Pager <Jobs>() { List = new List <Jobs>(), PageInfo = new PageInfo(), Msg = new Result_Msg() { IsSuccess = true } }; try { var linqList = from job in context.Jobs select job; if (query.ParamInfo.UserType != 0) { linqList = linqList.Where(x => x.UserType == query.ParamInfo.UserType); } if (query.ParamInfo.LanguageType != 0) { //语言类型(0:所有 ;1:中文;2:英文;) linqList = linqList.Where(x => x.LanguageType == query.ParamInfo.LanguageType); } if (query.ParamInfo.ApprovalStatus != 0) { linqList = linqList.Where(x => x.ApprovalStatus == query.ParamInfo.ApprovalStatus); } if (query.ParamInfo.JobTitle != null && query.ParamInfo.JobTitle != string.Empty) { linqList = linqList.Where(x => x.JobTitle.IndexOf(query.ParamInfo.JobTitle) != -1); } int total = linqList.Count(); res.List = linqList.OrderByDescending(p => p.CreateDate).Skip((query.PageInfo.CurrentPage - 1) * query.PageInfo.PageSize).Take(query.PageInfo.PageSize).ToList(); res.PageInfo.CurrentPage = query.PageInfo.CurrentPage; res.PageInfo.PageSize = query.PageInfo.PageSize; res.PageInfo.Total = total; res.PageInfo.PageCount = Convert.ToInt32(Math.Ceiling((double)total / (double)query.PageInfo.PageSize)); } catch (Exception ex) { res.Msg.IsSuccess = false; res.Msg.Message = "查询失败,失败原因:" + ex.Message; } return(res); }
/// <summary> /// 更新数据 /// </summary> /// <param name="query"></param> /// <returns></returns> public string UpdateWhatBusy_By_WhatBusyType(QueryCommon <WhatBusyQuery> query) { Result_Model <WhatBusy> res = new Result_Model <WhatBusy>(); if (base.CurrentManager != null && base.CurrentManager.Id > 0) { long userId = base.CurrentManager.Id; res = whatBuys.UpdateWhatBusy_By_WhatBusyType(query); } else { res.Msg.IsSuccess = false; res.Msg.Message = "计算" + hashSet.Get_DictionariesList_ByTypeID(19).Where(y => y.DKey == query.ParamInfo.BusyType.ToString()).FirstOrDefault().DValue + "数据失败"; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
public string IWantToBuyAdd(QueryCommon <IWantToBuyQuery> query) { DateTime now = DateTime.Now; query.ParamInfo.PurchaseID = base.CurrentUser.Id; query.ParamInfo.CreateDate = DateTime.Now; query.ParamInfo.UpdateDate = DateTime.Now; query.ParamInfo.StartDate = DateTime.Now; query.ParamInfo.EndDate = DateTime.Now; query.ParamInfo.PurchaseNum = GetPurchaseNum(); query.ParamInfo.Status = 0; Result_Msg res = iWantToBuyService.IWantToBuy_Add_Web(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
public string Detail_Apply(QueryCommon <ApplyAmountInfo> query) { Result_Model <ApplyAmountInfo> res = new Result_Model <ApplyAmountInfo>() { Model = new ApplyAmountInfo(), Msg = new Result_Msg() }; res.Model = ServiceHelper.Create <IApplyAmountService>().GetApplyById(query.ParamInfo.Id); if (res.Model != null) { switch (res.Model.ApplyStatus) { case 0: res.Msg = new Result_Msg() { IsSuccess = true }; break; case 1: res.Msg = new Result_Msg() { IsSuccess = false, Message = "审核已通过,不能修改" }; break; case 2: res.Msg = new Result_Msg() { IsSuccess = true, }; break; default: break; } } else { res.Msg = new Result_Msg() { IsSuccess = false, Message = "未找到记录" }; }; return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }