123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using LeaRun.Application.Entity.WarehouseManage;
- using LeaRun.Data;
- using LeaRun.Util;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Data.SqlClient;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- //using
- namespace LeaRun.Application.Service.WarehouseManage
- {
- public class WM_SaleDetailsService
- {
- private SqlHelper sqlHelper = new SqlHelper("InstallDB");
- public IEnumerable<WM_SaleDetailsEntity> getDetailList() {
- try
- {
- string sql = "select * from dbo.WM_SaleDetails";
- DataTable dt = sqlHelper.ExecuteDataTable(sql,CommandType.Text,null);
- return DataHelper.DataTableToT<WM_SaleDetailsEntity>(dt);
- }
- catch (Exception)
- {
-
- throw;
- }
-
- }
- //TODO 获取登录用户的公共方法
- public int InsertSalesDetailsEntity(WM_SaleDetailsEntity entity) {
- string sql = @" INSERT INTO WM_SaleDetails(WarehouseId,GoodId,DeliveryNum,PayPrice,CostPrice,OrderAccount,CreateDt,UpdateDt,Operator,OrderNum)VALUES(@WarehouseId,@GoodId,@DeliveryNum,@PayPrice,@CostPrice,@OrderAccount,@CreateDt,@UpdateDt,@Operator,@OrderNum)";
- List<SqlParameter> list=new List<SqlParameter>();
- list.Add(new SqlParameter("@WarehouseId",entity.WarehouseId));
- list.Add(new SqlParameter("@GoodId",entity.GoodId));
- list.Add(new SqlParameter("@DeliveryNum", entity.DeliveryNum));
- list.Add(new SqlParameter("@PayPrice", entity.PayPrice));
- list.Add(new SqlParameter("@CostPrice", entity.CostPrice));
- list.Add(new SqlParameter("@OrderAccount", entity.OrderAccount));
- list.Add(new SqlParameter("@CreateDt", DateTime.Now));
- list.Add(new SqlParameter("@UpdateDt", DateTime.Now));
- list.Add(new SqlParameter("@Operator", "System"));
- list.Add(new SqlParameter("@OrderNum", entity.OrderNum));
- int n = sqlHelper.ExecuteNonQuery(sql,CommandType.Text,list.ToArray());
- return n;
- }
- }
- }
|