public List <OrderDetails> getOrderDetailInfoData(string productId, string orderId) { List <OrderDetails> list = null; try { IParameterMapper ipmapper = new getOrderDetailsListInfoDataParameterMapper(); DataAccessor <OrderDetails> tableAccessor; string strSql = @"select od.CreateDate, od.DetailsId, od.Discount , od.DiscountPrice, od.OrderId, od.ProductCount, od.Remark, od.SendState, od.TotalPrice, od.UnitPrice, od.UseState , od.ProductId , p.ProductName from OrderDetails od ,Product p where od.ProductId=p.Id and od.ProductId=@ProductId and od.OrderId=@OrderId"; tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder <OrderDetails> .MapAllProperties() .Map(t => t.CreateDate).ToColumn("CreateDate") .Map(t => t.DetailsId).ToColumn("DetailsId") .Map(t => t.Discount).ToColumn("Discount") .Map(t => t.DiscountPrice).ToColumn("DiscountPrice") .Map(t => t.OrderId).ToColumn("OrderId") .Map(t => t.ProductCount).ToColumn("ProductCount") .Map(t => t.Remark).ToColumn("Remark") .Map(t => t.SendState).ToColumn("SendState") .Map(t => t.TotalPrice).ToColumn("TotalPrice") .Map(t => t.UnitPrice).ToColumn("UnitPrice") .Map(t => t.UseState).ToColumn("UseState") .Map(t => t.ProductId).ToColumn("ProductId") .Map(t => t.ProductName).ToColumn("ProductName") .Build()); list = tableAccessor.Execute(new string[] { orderId, productId }).ToList(); return(list); } catch (Exception ex) { Logger.Log(ex); return(null); } }
public List<OrderDetails> getOrderDetailInfoData(string productId, string orderId) { List<OrderDetails> list = null; try { IParameterMapper ipmapper = new getOrderDetailsListInfoDataParameterMapper(); DataAccessor<OrderDetails> tableAccessor; string strSql = @"select od.CreateDate, od.DetailsId, od.Discount , od.DiscountPrice, od.OrderId, od.ProductCount, od.Remark, od.SendState, od.TotalPrice, od.UnitPrice, od.UseState , od.ProductId , p.ProductName from OrderDetails od ,Product p where od.ProductId=p.Id and od.ProductId=@ProductId and od.OrderId=@OrderId"; tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder<OrderDetails>.MapAllProperties() .Map(t => t.CreateDate).ToColumn("CreateDate") .Map(t => t.DetailsId).ToColumn("DetailsId") .Map(t => t.Discount).ToColumn("Discount") .Map(t => t.DiscountPrice).ToColumn("DiscountPrice") .Map(t => t.OrderId).ToColumn("OrderId") .Map(t => t.ProductCount).ToColumn("ProductCount") .Map(t => t.Remark).ToColumn("Remark") .Map(t => t.SendState).ToColumn("SendState") .Map(t => t.TotalPrice).ToColumn("TotalPrice") .Map(t => t.UnitPrice).ToColumn("UnitPrice") .Map(t => t.UseState).ToColumn("UseState") .Map(t => t.ProductId).ToColumn("ProductId") .Map(t => t.ProductName).ToColumn("ProductName") .Build()); list = tableAccessor.Execute(new string[] {orderId , productId }).ToList(); return list; } catch (Exception ex) { Logger.Log(ex); return null; } }