Esempio n. 1
0
        public void UpdateVehiculos(E_Vehiculo ObjVehiculo, string Tipo)
        {
            SqlDatabase SqlClient = new SqlDatabase(connectionString);

            DbConnection tCnn;

            tCnn = SqlClient.CreateConnection();
            tCnn.Open();

            DbTransaction tran = tCnn.BeginTransaction();

            try
            {
                DbCommand SqlCommand = SqlClient.GetStoredProcCommand("[Empresa].[Usp_UpdateVehiculos]");

                SqlClient.AddInParameter(SqlCommand, "@Placa", SqlDbType.VarChar, ObjVehiculo.Placa);
                SqlClient.AddInParameter(SqlCommand, "@Marca", SqlDbType.VarChar, ObjVehiculo.Marca);
                SqlClient.AddInParameter(SqlCommand, "@CertificadoInscripcion", SqlDbType.Int, ObjVehiculo.CertificadoInscripcion);
                SqlClient.AddInParameter(SqlCommand, "@ConfiguracionVehicular", SqlDbType.VarChar, ObjVehiculo.ConfiguracionVehicular);
                SqlClient.AddInParameter(SqlCommand, "@Tara", SqlDbType.Decimal, ObjVehiculo.Tara);
                SqlClient.AddInParameter(SqlCommand, "@PesoBruto", SqlDbType.Decimal, ObjVehiculo.PesoBruto);
                SqlClient.AddInParameter(SqlCommand, "@EmpresaID", SqlDbType.Char, ObjVehiculo.EmpresaID);
                SqlClient.AddInParameter(SqlCommand, "@UsuarioID", SqlDbType.Int, ObjVehiculo.UsuarioID);
                SqlClient.AddInParameter(SqlCommand, "@Tipo", SqlDbType.Char, Tipo);

                SqlClient.ExecuteNonQuery(SqlCommand, tran);

                tran.Commit();
                tCnn.Close();
                tCnn.Dispose();
                SqlCommand.Dispose();
            }
            catch (Exception ex)
            {
                tran.Rollback();
                throw new Exception(ex.Message);
            }
        }
Esempio n. 2
0
 private void ObtenerDatosControles()
 {
     ObjVehiculo       = new E_Vehiculo();
     ObjVehiculo.Placa = TxtPlaca.Text;
     ObjVehiculo.Marca = TxtMarca.Text;
     if (TxtCertificadoInscripcion.Text != "")
     {
         ObjVehiculo.CertificadoInscripcion = Convert.ToInt32(TxtCertificadoInscripcion.Text);
     }
     ObjVehiculo.ConfiguracionVehicular = TxtConfiguracionVehicular.Text;
     if (TxtTara.Text != "")
     {
         ObjVehiculo.Tara = Convert.ToDecimal(TxtTara.Text);
     }
     if (TxtPesoBruto.Text != "")
     {
         ObjVehiculo.PesoBruto = Convert.ToDecimal(TxtPesoBruto.Text);
     }
     if (CboEmpresa.SelectedIndex != -1)
     {
         ObjVehiculo.EmpresaID = CboEmpresa.SelectedValue.ToString();
     }
     ObjVehiculo.UsuarioID = AppSettings.UserID;
 }
 public bool EditarVehiculo(E_Vehiculo e_Vehiculo)
 {
     return(d_Vehiculo.UpdateVehiculo(e_Vehiculo.Placa, e_Vehiculo.ClienteID, e_Vehiculo.Marca, e_Vehiculo.Modelo, e_Vehiculo.Matricula, e_Vehiculo.PuertoID));
 }
 public bool AgregarVehiculo(E_Vehiculo e_Vehiculo)
 {
     return(d_Vehiculo.InsertVehiculo(e_Vehiculo.Placa, e_Vehiculo.ClienteID, e_Vehiculo.Marca, e_Vehiculo.Modelo, e_Vehiculo.Matricula, e_Vehiculo.PuertoID));
 }
Esempio n. 5
0
        public void InsertVehiculos(E_Vehiculo ObjVehiculo)
        {
            CD_Vehiculo objCD_Vehiculo = new CD_Vehiculo(AppSettings.GetConnectionString);

            objCD_Vehiculo.InsertVehiculos(ObjVehiculo);
        }
Esempio n. 6
0
        public void UpdateVehiculos(E_Vehiculo ObjVehiculo, string Tipo)
        {
            CD_Vehiculo objCD_Vehiculo = new CD_Vehiculo(AppSettings.GetConnectionString);

            objCD_Vehiculo.UpdateVehiculos(ObjVehiculo, Tipo);
        }