| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using AutoMapper; |
| | | using CommonToolsCore; |
| | | using DTO; |
| | | using IServices; |
| | | using Microsoft.AspNetCore.Mvc.Rendering; |
| | |
| | | } |
| | | |
| | | _context.SaveChanges(); |
| | | |
| | | var listPosition = _context.CooperatecustomCustomers.Where(r => r.RecStatus == "A").ToList(); |
| | | |
| | | var CooperatecustomCustomerDTOs = _mapper.Map<List<CooperatecustomCustomerDTO>>(listPosition); |
| | | CacheHelperNetCore.CacheInsert("CooperatecustomCustomerDTOs", CooperatecustomCustomerDTOs); |
| | | |
| | | resultEntity.ReturnID = cooperatecustomCustomer.Id; |
| | | resultEntity.Result = true; |
| | | } |
| | |
| | | /// <returns></returns> |
| | | public List<CooperatecustomCustomerDTO> GetList(string HuiyuanId = "", string Name = "") |
| | | { |
| | | List<CooperatecustomCustomerDTO> CooperatecustomCustomerDTOs = (List<CooperatecustomCustomerDTO>)CacheHelperNetCore.CacheValue("CooperatecustomCustomerDTOs"); |
| | | if (CooperatecustomCustomerDTOs != null && CooperatecustomCustomerDTOs.Count > 0) |
| | | { |
| | | if (!string.IsNullOrEmpty(HuiyuanId)) |
| | | { |
| | | CooperatecustomCustomerDTOs = CooperatecustomCustomerDTOs.Where(x => x.HuiyuanId == HuiyuanId).ToList(); |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(Name)) |
| | | { |
| | | CooperatecustomCustomerDTOs = CooperatecustomCustomerDTOs.Where(x => x.Name == Name).ToList(); |
| | | } |
| | | |
| | | return CooperatecustomCustomerDTOs; |
| | | } |
| | | |
| | | var listPosition = _context.CooperatecustomCustomers.Where(r => r.RecStatus == "A").ToList(); |
| | | |
| | | CooperatecustomCustomerDTOs = _mapper.Map<List<CooperatecustomCustomerDTO>>(listPosition); |
| | | CacheHelperNetCore.CacheInsert("CooperatecustomCustomerDTOs", CooperatecustomCustomerDTOs); |
| | | |
| | | |
| | | if (!string.IsNullOrEmpty(HuiyuanId)) |
| | | { |
| | | listPosition = listPosition.Where(x => x.HuiyuanId == HuiyuanId).ToList(); |
| | | CooperatecustomCustomerDTOs = CooperatecustomCustomerDTOs.Where(x => x.HuiyuanId == HuiyuanId).ToList(); |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(Name)) |
| | | { |
| | | listPosition = listPosition.Where(x => x.Name == Name).ToList(); |
| | | CooperatecustomCustomerDTOs = CooperatecustomCustomerDTOs.Where(x => x.Name == Name).ToList(); |
| | | } |
| | | |
| | | var list = _mapper.Map<List<CooperatecustomCustomerDTO>>(listPosition); |
| | | return list; |
| | | return CooperatecustomCustomerDTOs; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | public List<CooperatecustomCustomerDTO> GetListsalary(string userid, DateTime datemin, DateTime datemax) |