public ResponseAgregarTransportista AgregarTransportista(RequestAgregarTransportista request)
        {
            ResponseAgregarTransportista response = new ResponseAgregarTransportista();

            TransportistaBL tbl = new TransportistaBL();

            response = tbl.AgregarTransportista(request);

            return(response);
        }
Example #2
0
        public ResponseAgregarTransportista AgregarTransportista(RequestAgregarTransportista request)
        {
            ResponseAgregarTransportista response = new ResponseAgregarTransportista();


            TransportistaDA tda = new TransportistaDA();

            response = tda.AgregarTransportista(request);

            return(response);
        }
        public ResponseAgregarTransportista AgregarTransportista(RequestAgregarTransportista request)
        {
            ResponseAgregarTransportista response = new ResponseAgregarTransportista();

            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["cnxANTP"].ToString());


            try
            {
                SqlCommand com = new SqlCommand("USP_AGREGAR_TRANSPORTISTA", con);
                com.CommandType = CommandType.StoredProcedure;
                com.Parameters.Add("@Ruc", SqlDbType.VarChar, 15).Value          = request.Ruc;
                com.Parameters.Add("@RazonSocial", SqlDbType.VarChar, 150).Value = request.RazonSocial;
                com.Parameters.Add("@Email", SqlDbType.VarChar, 100).Value       = request.Email;
                com.Parameters.Add("@telef1", SqlDbType.VarChar, 25).Value       = request.Telefono1;
                com.Parameters.Add("@telef2", SqlDbType.VarChar, 26).Value       = request.Telefono2;
                com.Parameters.Add("@telef3", SqlDbType.VarChar, 27).Value       = request.Telefono3;
                com.Parameters.Add("@Estado", SqlDbType.Bit).Value = request.Estado;
                com.Parameters.Add("@UsuarioCreacion", SqlDbType.VarChar, 20).Value = request.UsuarioCreacion;

                con.Open();
                com.ExecuteNonQuery();

                response.Estado  = true;
                response.Mensaje = "Exitoso";
            } catch (Exception ex)
            {
                response.Estado  = false;
                response.Mensaje = ex.Message.ToString();
            }
            finally
            {
                con.Close();
            }
            return(response);
        }