Esempio n. 1
0
        public UpdateClientOut UpdateClient(UpdateClientIn input)
        {
            UpdateClientOut response = new UpdateClientOut()
            {
                ResponseCode = Entities.Client.General.ResponseCode.Error
            };

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

                param.Add("@ClientId", input.client.ClientId);
                param.Add("@FirstName", input.client.FirstName);
                param.Add("@LastName", input.client.LastName);
                param.Add("@Age", input.client.Age);
                param.Add("@Identification", input.client.Identification);
                param.Add("@Email", input.client.Email);
                param.Add("@Operation", 3);
                param.Add("@RESULT", dbType: DbType.Int32, direction: ParameterDirection.ReturnValue);


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

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

            return(response);
        }
        public IHttpActionResult UpdateClient(UpdateClientIn input)
        {
            var response = client.UpdateClient(input);

            return(Ok(response));
        }
Esempio n. 3
0
 public UpdateClientOut UpdateClient(UpdateClientIn input)
 {
     return(clientDA.UpdateClient(input));
 }