コード例 #1
0
ファイル: OrderDA.cs プロジェクト: Andres-Lopez/DW_Billing
        public CreateOrderOut CreateOrder(CreateOrderIn input)
        {
            CreateOrderOut response = new CreateOrderOut()
            {
                ResponseCode = Entities.Client.General.ResponseCode.Error
            };

            using (IDbConnection connection = new SqlConnection(connectionString))
            {
                connection.Open();
                DynamicParameters param = new DynamicParameters();

                param.Add("@OrderId", input.order.OrderId);
                param.Add("@ClientId", input.order.ClientId);
                param.Add("@Total", input.order.Total);
                param.Add("@Operation", 1);
                param.Add("@RESULT", dbType: DbType.Int32, direction: ParameterDirection.ReturnValue);


                var data = connection.Execute("SP_Crud_Order", param, commandType: CommandType.StoredProcedure);

                if (param.Get <int>("@RESULT") > 0)
                {
                    response.ResponseCode = Entities.Client.General.ResponseCode.Success;
                    response.OrderId      = param.Get <int>("@RESULT");
                }
            }

            return(response);
        }
コード例 #2
0
        public IHttpActionResult CreateOrder(CreateOrderIn input)
        {
            var response = client.CreateOrder(input);

            return(Ok(response));
        }
コード例 #3
0
 public CreateOrderOut CreateOrder(CreateOrderIn input)
 {
     return(orderDA.CreateOrder(input));
 }