public ClientPaymentDto ClientPaymentDetail(OneParam param) { var clientPaymentDetail = (from clientPaymentItem in _clientPaymentRepository.GetAll() join salesOrder in _salesOrderRepository.GetAll() on clientPaymentItem.SalesOrderId equals salesOrder.Id join client in _clientRepository.GetAll() on salesOrder.ClientId equals client.Id join userInfo in _userRepository.GetAll() on clientPaymentItem.CreatorUserId equals userInfo.Id where clientPaymentItem.Id == param.Id select new ClientPaymentDto { Id = clientPaymentItem.Id, SalesOrderId = clientPaymentItem.SalesOrderId, SalesOrderNum = salesOrder.SalesNum, ClientName = client.Name, PaymentBank = clientPaymentItem.PaymentBank, BankTransactionNum = clientPaymentItem.BankTransactionNum, PaymentSum = clientPaymentItem.PaymentSum, ReceiptBank = clientPaymentItem.ReceiptBank, ReceiptAccountId = clientPaymentItem.ReceiptAccountId, State = clientPaymentItem.State, CreatorUserName = userInfo.UserName, CreationTime = clientPaymentItem.CreationTime }).FirstOrDefault(); return(clientPaymentDetail); }
public ReceiptDedailDto ReceiptDetail(OneParam param) { var receiptDetail = (from receiptItem in _receiptRepository.GetAll() join salesOrder in _salesOrderRepository.GetAll() on receiptItem.SalesOrderId equals salesOrder.Id join client in _clientRepository.GetAll() on salesOrder.ClientId equals client.Id join userInfo in _userRepository.GetAll() on receiptItem.CreatorUserId equals userInfo.Id where receiptItem.Id == param.Id select new ReceiptDedailDto { Id = receiptItem.Id, ClientName = client.Name, SalesOrderNum = salesOrder.SalesNum, ReceiptWay = receiptItem.ReceiptWay, PaymentMethod = receiptItem.PaymentMethod, ReceiptDate = receiptItem.ReceiptDate, JournalName = receiptItem.JournalName, PostingProfile = receiptItem.PostingProfile, BankName = receiptItem.BankName, JournalBalanceNum = receiptItem.JournalBalanceNum, JournalBalance = receiptItem.JournalBalance, LineAmountCaps = receiptItem.LineAmountCaps, BankTransactionNum = receiptItem.BankTransactionNum, SupplyOfGoods = receiptItem.SupplyOfGoods, ContractNum = receiptItem.ContractNum, Remark = receiptItem.Remark, Currency = receiptItem.Currency, ReceiptAbstract = receiptItem.ReceiptAbstract, CreatorUserName = userInfo.UserName, State = receiptItem.State, CreationTime = receiptItem.CreationTime }).FirstOrDefault(); return(receiptDetail); }
public async Task <object> GetRolesByUser(OneParam param) { var roles = await _roleRepository.GetAllListAsync(); var inRoles = await UserManager.GetRolesAsync(param.Id); return(new { allRoles = roles.MapTo <List <RoleListDto> >(), inRoles = inRoles.ToArray() }); }
public async Task <EditSupplierInput> GetSupplierById(OneParam param) { var supplier = await _supplierRepository.GetAsync(param.Id); var supplierDto = supplier.MapTo <EditSupplierInput>(); return(supplierDto); }
public async Task <EditClientInput> GetClientById(OneParam param) { var client = await _clientRepository.GetAsync(param.Id); var clientDto = client.MapTo <EditClientInput>(); return(clientDto); }
public EditSalesOrderInput GetSalesOrderById(OneParam param) { var salesOrder = _salesOrderRepository.GetAllIncluding(m => m.SalesOrderItem).Where(m => m.Id == param.Id).FirstOrDefault(); var salesOrderDto = salesOrder.MapTo <EditSalesOrderInput>(); salesOrderDto.SalesOrderItems = salesOrder.SalesOrderItem.MapTo <List <EditSalesOrderItemDto> >(); return(salesOrderDto); }
public EditPurchaseOrderInput GetPurchaseOrderById(OneParam param) { var purchaseOrder = _purchaseOrderRepository.GetAllIncluding(m => m.PurchaseOrderItem).Where(m => m.Id == param.Id).FirstOrDefault(); var purchaseOrderDto = purchaseOrder.MapTo <EditPurchaseOrderInput>(); purchaseOrderDto.PurchaseOrderItems = purchaseOrder.PurchaseOrderItem.MapTo <List <EditPurchaseOrderItemDto> >(); return(purchaseOrderDto); }
public async Task <EditProductInput> GetProductById(OneParam param) { var product = await _productRepository.GetAsync(param.Id); var unitList = await _unitRepository.GetAllListAsync(); return(product.MapTo <EditProductInput>()); }
public async Task <EditReceiptInput> GetReceiptById(OneParam param) { var receipt = await _receiptRepository.GetAsync(param.Id); var receiptDto = receipt.MapTo <EditReceiptInput>(); return(receiptDto); }
public async Task StopProduct(OneParam param) { var product = await _productRepository.GetAsync(param.Id); if (product.Stopped) { product.Stopped = false; } else { product.Stopped = true; } await _productRepository.UpdateAsync(product); }
public async Task <object> GetPermissionsByRole(OneParam param) { var rolePermissions = await _roleManager.GetGrantedPermissionsAsync(param.Id); var allPermissons = _permissionManager.GetAllPermissions().ToList(); var permissionGroup = new List <PermissionGroupDto>(); foreach (var item in allPermissons.Where(m => m.Children.Count() > 0)) { PermissionGroupDto tempData = item.MapTo <PermissionGroupDto>(); tempData.PermissionGroups = item.Children.ToList().MapTo <List <PermissionListDto> >(); permissionGroup.Add(tempData); } return(new { allPermissons = permissionGroup, rolePermissions = rolePermissions.Select(m => m.Name).ToList() }); }
public SalesOrderDetailDto SalesOrderDetail(OneParam param) { //订单详情 var salesOrderDetail = (from salesOrder in _salesOrderRepository.GetAll() join client in _clientRepository.GetAll() on salesOrder.ClientId equals client.Id join contract in _contractRepository.GetAll() on salesOrder.SalesContractId equals contract.Id join inventSite in _inventSiteRepository.GetAll() on salesOrder.InventSiteId equals inventSite.Id join inventLocation in _inventLocationRepository.GetAll() on salesOrder.InventLocationId equals inventLocation.Id join userInfo in _userRepository.GetAll() on salesOrder.CreatorUserId equals userInfo.Id where salesOrder.Id == param.Id select new SalesOrderDetailDto { Id = salesOrder.Id, SalesNum = salesOrder.SalesNum, ClientName = client.Name, InventSiteName = inventSite.Name, InventLocationName = inventLocation.Name, SalesContractNum = contract.ContractNum, Consignee = salesOrder.Consignee, DeliveryAddress = salesOrder.DeliveryAddress, PostCode = salesOrder.PostCode, DistributionMode = salesOrder.DistributionMode, MobilePhone = salesOrder.MobilePhone, InvoiceHeader = salesOrder.InvoiceHeader, Instructions = salesOrder.Instructions, PaymentMethod = salesOrder.PaymentMethod, State = salesOrder.State, CreationTime = salesOrder.CreationTime, CreatorUserName = userInfo.UserName }).FirstOrDefault(); //订单行 var salesOrderItems = (from salesOrderItem in _salesOrderItemRepository.GetAll() join product in _productRepository.GetAll() on salesOrderItem.ProductId equals product.Id join inventBatchItem in _inventBatchRepository.GetAll() on salesOrderItem.InventBatchId equals inventBatchItem.Id where salesOrderItem.SalesOrderId == salesOrderDetail.Id select new SalesOrderItemDetailDto { ProductName = product.Name, InventBatchNum = inventBatchItem.InventBatchNum, PurchCount = salesOrderItem.PurchCount, PurchPrice = salesOrderItem.PurchPrice }).ToList(); salesOrderDetail.SalesOrderItems = salesOrderItems; //商品总价 salesOrderDetail.TotalPrices = salesOrderItems.Sum(m => (m.PurchCount) * (m.PurchPrice)); return(salesOrderDetail); }
public PurchaseOrderDetailDto PurchaseOrderDetail(OneParam param) { //订单详情 var purchaseOrderDetail = (from purchaseOrder in _purchaseOrderRepository.GetAll() join contract in _contractRepository.GetAll() on purchaseOrder.ContractId equals contract.Id join supplier in _supplierRepository.GetAll() on purchaseOrder.SupplierId equals supplier.Id join inventSite in _inventSiteRepository.GetAll() on purchaseOrder.InventSiteId equals inventSite.Id join inventLocation in _inventLocationRepository.GetAll() on purchaseOrder.InventLocationId equals inventLocation.Id join userInfo in _userRepository.GetAll() on purchaseOrder.CreatorUserId equals userInfo.Id where purchaseOrder.Id == param.Id select new PurchaseOrderDetailDto { Id = purchaseOrder.Id, PurchNum = purchaseOrder.PurchNum, SupplierName = supplier.Name, InventSiteName = inventSite.Name, InventLocationName = inventLocation.Name, ContractNum = contract.ContractNum, State = purchaseOrder.State, CreationTime = purchaseOrder.CreationTime, CreatorUserName = userInfo.UserName }).FirstOrDefault(); //订单行 var purchaseOrderItems = (from purchaseOrderItem in _purchaseOrderItemRepository.GetAll() join product in _productRepository.GetAll() on purchaseOrderItem.ProductId equals product.Id join inventBatchItem in _inventBatchRepository.GetAll() on purchaseOrderItem.InventBatchId equals inventBatchItem.Id where purchaseOrderItem.PurchaseOrderId == purchaseOrderDetail.Id select new PurchaseOrderItemDetailDto { ProductName = product.Name, InventBatchNum = inventBatchItem.InventBatchNum, PurchCount = purchaseOrderItem.PurchCount, PurchPrice = purchaseOrderItem.PurchPrice }).ToList(); purchaseOrderDetail.PurchaseOrderItems = purchaseOrderItems; //商品总价 purchaseOrderDetail.TotalPrices = purchaseOrderItems.Sum(m => (m.PurchCount) * (m.PurchPrice)); return(purchaseOrderDetail); }
/// <summary> /// 根据id获取角色 /// </summary> /// <param name="id">角色Id</param> /// <returns></returns> public async Task <EditUserInput> GetRoleById(OneParam param) { var roles = await _roleRepository.GetAsync(param.Id); return(roles.MapTo <EditUserInput>()); }
public async Task <EditProjectInput> GetProjectById(OneParam param) { var project = await _projectRepository.GetAsync(param.Id); return(project.MapTo <EditProjectInput>()); }
public async Task <EditDeliverInput> GetDeliverById(OneParam param) { var deliver = await _deliverRepository.GetAsync(param.Id); return(deliver.MapTo <EditDeliverInput>()); }