internal Order AddOrder(Bill bill, TypeOfDelivery type) { Order order = new Order(0, bill, type); var p = new DynamicParameters(); p.Add("@billID", bill.Id); if (type == TypeOfDelivery.STORE) { p.Add("@deliveryType", 0); } else { p.Add("@deliveryType", 1); } p.Add("@temp", 0, DbType.Int32, direction: ParameterDirection.Output); connection.Execute("dbo.AddOrder", p, commandType: CommandType.StoredProcedure); order.Id = p.Get <int>("@temp"); return(order); }
public Order(int id, Bill bill, TypeOfDelivery type) { Id = id; Bill = bill; Type = type; }