public bool Eliminar_Detalle(Comun.clsDetalles ClsDet) { bool Res = false; SqlConnection con = new SqlConnection(); try { Conexion Oconexion = new Conexion(); con = Oconexion.slConexion(); con.Open(); string SP_ElimarProxDetalle = "SP_ElimarProxDetalle"; SqlCommand CmdDetalles = new SqlCommand(SP_ElimarProxDetalle, con); CmdDetalles.CommandType = CommandType.StoredProcedure; CmdDetalles.Parameters.AddWithValue("@Cod_producto", ClsDet.Cod_Product); int Resultado = CmdDetalles.ExecuteNonQuery(); if (Resultado > 0) { Res = true; } } catch (Exception e) { Res = false; } finally { con.Close(); con.Dispose(); } return(Res); }
public bool Registrar_Detalles(Comun.clsDetalles ClsDet) { bool Res = false; SqlConnection con = new SqlConnection(); try { Conexion oconexion = new Conexion(); con = oconexion.slConexion(); con.Open(); string SP_RegistrarDetallesDevoluciones = "SP_RegistrarDetallesMov"; SqlCommand CmDetalles = new SqlCommand(SP_RegistrarDetallesDevoluciones, con); CmDetalles.CommandType = CommandType.StoredProcedure; CmDetalles.Parameters.AddWithValue("@cod_prod", ClsDet.Cod_Product); CmDetalles.Parameters.AddWithValue("@cantidad", ClsDet.Cantidad); CmDetalles.Parameters.AddWithValue("@valor", ClsDet.Valor); int Resultado = CmDetalles.ExecuteNonQuery(); if (Resultado > 0) { Res = true; } } catch (Exception) { Res = false; } finally { con.Close(); con.Dispose(); } return(Res); }
public bool Agregar_Detalles(Comun.clsDetalles dtDt) { bool res = false; SqlConnection con = new SqlConnection(); try { Conexion oconexion = new Conexion(); con = oconexion.slConexion(); con.Open(); string SP_RegistraDetalles = "SP_RegistraDetalles"; SqlCommand CmdDetalles = new SqlCommand(SP_RegistraDetalles, con); CmdDetalles.CommandType = CommandType.StoredProcedure; CmdDetalles.Parameters.AddWithValue("@Codigo", dtDt.Cod_Product); CmdDetalles.Parameters.AddWithValue("@Cantidad", dtDt.Cantidad); CmdDetalles.Parameters.AddWithValue("@Valor", dtDt.Valor); int Resultado = CmdDetalles.ExecuteNonQuery(); if (Resultado > 0) { res = true; } } catch (Exception e) { res = false; } finally { con.Close(); con.Dispose(); } return(res); }