123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- using LeaRun.Application.Entity.WarehouseManage;
- using LeaRun.Data;
- using LeaRun.Util;
- using LeaRun.Util.WebControl;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace LeaRun.Application.Service.WarehouseManage
- {
- public class SalesService
- {
- public SqlHelper sqlHelper = new SqlHelper("InstallDB");
- /// <summary>
- /// 获取销售订单
- /// </summary>
- /// <param name="pagination">分页参数</param>
- /// <returns></returns>
- public IEnumerable<SalesEntity> GetSalesOrderList() {
- try
- {
- string sql = "select * from WM_Sales order by CreateDt desc";
- // int total = pagination.records;
- DataTable dt = sqlHelper.ExecuteDataTable(sql,CommandType.Text,null);
- // pagination.records = total;
- return DataHelper.DataTableToT<SalesEntity>(dt);
- }
- catch (Exception ex)
- {
- return null;
-
- }
- }
- /// <summary>
- /// 获取业务员列表
- /// </summary>
- /// <returns></returns>
- public IEnumerable<SalesmanEntity> GetSalesManList() {
- try
- {
- string sql = "select SalesmanId,SalemanName from WM_Salesman";
- DataTable dt = sqlHelper.ExecuteDataTable(sql,CommandType.Text,null);
- var list = DataHelper.DataTableToT<SalesmanEntity>(dt);
- return list;
- }
- catch (Exception ex)
- {
-
- return null;
- }
-
- }
- /// <summary>
- /// 获取销售订单详情
- /// </summary>
- /// <param name="saleId"></param>
- /// <returns></returns>
- public SalesEntity GetSalesOrder(string saleId) {
- try
- {
- string sql = "select SaleId,Code,CustomerName,OrderType, SaleSerialNumer,SalemanId,OrderPayment,CreateDt,remark from WM_Sales where saleId="+saleId;
- DataTable dtResult = sqlHelper.ExecuteDataTable(sql,CommandType.Text,null);
- List<SalesEntity> list = DataHelper.DataTableToT<SalesEntity>(dtResult);
- return list[0];
- }
- catch (Exception ex)
- {
-
- return null;
- }
-
-
-
- }
- /// <summary>
- /// 获取编码与单据号
- /// </summary>
- /// <returns></returns>
- public DataTable getCodeNum() {
- string sql = "select top 1 Code,SaleSerialNumer from WM_Sales order by Code desc";
- DataTable dt = sqlHelper.ExecuteDataTable(sql,CommandType.Text,null);
- return dt;
- }
- }
- }
|