public int UpdateEntrega(E_Vale ObjVale) { int NumIngreso = 0; SqlDatabase SqlClient = new SqlDatabase(connectionString); DbConnection tCnn; tCnn = SqlClient.CreateConnection(); tCnn.Open(); DbTransaction tran = tCnn.BeginTransaction(); try { DbCommand SqlCommand = SqlClient.GetStoredProcCommand("Ventas.Usp_Update_EntregaNavidenha"); SqlClient.AddInParameter(SqlCommand, "@NumComprobante", SqlDbType.Char, ObjVale.NumComprobante); SqlClient.AddInParameter(SqlCommand, "@NumVale", SqlDbType.Int, ObjVale.NumVale); SqlClient.AddInParameter(SqlCommand, "@ProductoID", SqlDbType.VarChar, ObjVale.ProductoId); SqlClient.AddInParameter(SqlCommand, "@PesoReal", SqlDbType.Decimal, ObjVale.PesoActual); SqlClient.AddInParameter(SqlCommand, "@UsuarioID", SqlDbType.Int, ObjVale.UsuarioID); SqlClient.AddInParameter(SqlCommand, "@NroCredito", SqlDbType.Char, ObjVale.NotaIngreso); SqlClient.AddInParameter(SqlCommand, "@Tipo", SqlDbType.Char, ObjVale.Tipo); NumIngreso = (int)SqlClient.ExecuteScalar(SqlCommand); tran.Commit(); tCnn.Close(); tCnn.Dispose(); return(NumIngreso); } catch (Exception ex) { tran.Rollback(); throw new Exception(ex.Message); } }
public int UpdateEntrega(E_Vale ObjVale) { CD_Vales objCD_Vale = new CD_Vales(AppSettings.GetConnectionString); return(objCD_Vale.UpdateEntrega(ObjVale)); }