public string fMantenimientoLineaDetalleDA(BELineaDetalle Request) { String sRes = ""; try { cmdSQL.Connection = NewConnection(strCon); cmdSQL.CommandText = "USP_SAR_MNT_LineaDetalle"; cmdSQL.CommandType = CommandType.StoredProcedure; cmdSQL.Parameters.Clear(); pAddParameter(cmdSQL, "@nLinDetId", Request.pnLinDetId == 0 ? 0 : Request.pnLinDetId, DbType.Int32); pAddParameter(cmdSQL, "@nComId", Request.pnComId == 0 ? 0 : Request.pnComId, DbType.Int32); pAddParameter(cmdSQL, "@nLDetValor", Request.pnLDetValor == 0 ? 0 : Request.pnLDetValor, DbType.Decimal); //Int32 JRTV pAddParameter(cmdSQL, "@nLinId", Request.pnLinId == 0 ? 0 : Request.pnLinId, DbType.Int32); pAddParameter(cmdSQL, "@nMatId", Request.pnMatId == 0 ? 0 : Request.pnMatId, DbType.Int32); pAddParameter(cmdSQL, "@nPerId", Request.pnPerId == 0 ? 0 : Request.pnPerId, DbType.Int32); pAddParameter(cmdSQL, "@nTipId", Request.pnTipId == 0 ? 0 : Request.pnTipId, DbType.Int32); pAddParameter(cmdSQL, "@cOpcion", Request.pcOpcion == "" ? "00" : Request.pcOpcion, DbType.String); sRes = fEjecutar(cmdSQL); } catch (Exception ex) { throw new Exception(ex.Message, ex); } finally { if (cmdSQL.Connection.State == ConnectionState.Open) { cmdSQL.Connection.Close(); } } return(sRes); }
public DataTable fListaLineaDetalleDA(BELineaDetalle objDet) { DataTable dt = new DataTable(); try { cmdSQL.Connection = NewConnection(ConfigurationManager.AppSettings[objDet.DBConexion]); //cmdSQL.Connection = NewConnection(strCon); cmdSQL.CommandType = CommandType.StoredProcedure; cmdSQL.Parameters.Clear(); cmdSQL.CommandText = "USP_SAR_SEL_ListaLineaDetalle_Filter"; pAddParameter(cmdSQL, "@nLinDetId", objDet.pnLinDetId == 0 ? 0 : objDet.pnLinDetId, DbType.Int32); pAddParameter(cmdSQL, "@nComId", objDet.pnComId == 0 ? 0 : objDet.pnComId, DbType.Int32); pAddParameter(cmdSQL, "@nLinId", objDet.pnLinId == 0 ? 0 : objDet.pnLinId, DbType.Int32); pAddParameter(cmdSQL, "@nMatId", objDet.pnMatId == 0 ? 0 : objDet.pnMatId, DbType.Int32); pAddParameter(cmdSQL, "@nPerId", objDet.pnPerId == 0 ? 0 : objDet.pnPerId, DbType.Int32); pAddParameter(cmdSQL, "@nTipId", objDet.pnTipId == 0 ? 0 : objDet.pnTipId, DbType.Int32); pAddParameter(cmdSQL, "@cOpcion", objDet.pcOpcion == "" ? "00" : objDet.pcOpcion, DbType.String); SqlDataAdapter da = new SqlDataAdapter(cmdSQL); da.Fill(dt); } catch (Exception ex) { throw new Exception(ex.Message, ex); } finally { if (cmdSQL.Connection.State == ConnectionState.Open) { cmdSQL.Connection.Close(); } } return(dt); }
public BELineaDetalle VALOR_Linea(int pnWkfId, int pnLenId, int pnTipId, int pnComId, int pnPerId, string pcMateEliminado, string pcOpcion, string DBConexion) { BELineaDetalle objBE = new BELineaDetalle(); BELineaDetalle objRespuesta; try { objBE.pnWorId = pnWkfId; objBE.pnLenId = pnLenId; objBE.pnTipId = pnTipId; objBE.pnTipId = pnTipId; objBE.pnComId = pnComId; objBE.pnPerId = pnPerId; objBE.pcMatEliminado = pcMateEliminado; objBE.pcOpcion = pcOpcion; objBE.DBConexion = DBConexion; objRespuesta = new BLLineaDetalle().fObtenerValorBL(objBE); } catch (Exception ex) { var st = new StackTrace(ex, true); var frame = st.GetFrame(0); var line = frame.GetFileLineNumber(); throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound, ex.Message + "; line:" + frame.ToString())); } return(objRespuesta); }
public DataTable LIST_DetalleMatriz(int pnLinDetId, int pnMatId, int pnLinId, int pnTipId, int pnComId, int pnPerId, string pcOpcion, string DBConexion) { BELineaDetalle objDet = new BELineaDetalle(); objDet.pnLinDetId = pnLinDetId; objDet.pnMatId = pnMatId; objDet.pnLinId = pnLinId; objDet.pnTipId = pnTipId; objDet.pnComId = pnComId; objDet.pnPerId = pnPerId; objDet.pcOpcion = pcOpcion; objDet.DBConexion = DBConexion; return(LineaDetalleBL.fListaLineaDetalleBL(objDet)); }
public BELineaDetalle fObtenerValorDL(BELineaDetalle Request) { Request.pnLinDetId = -1;//error try { cmdSQL.Connection = NewConnection(strCon); cmdSQL.CommandType = CommandType.StoredProcedure; cmdSQL.Parameters.Clear(); cmdSQL.CommandText = "USP_SAR_SEL_ValorMEE"; pAddParameter(cmdSQL, "@nWorId", Request.pnWorId == 0 ? 0 : Request.pnWorId, DbType.Int32); pAddParameter(cmdSQL, "@nLenId", Request.pnLenId == 0 ? 0 : Request.pnLenId, DbType.Int32); pAddParameter(cmdSQL, "@nTipId", Request.pnTipId == 0 ? 0 : Request.pnTipId, DbType.Int32); pAddParameter(cmdSQL, "@nComId", Request.pnComId == 0 ? 0 : Request.pnComId, DbType.Int32); pAddParameter(cmdSQL, "@nPerId", Request.pnPerId == 0 ? 0 : Request.pnPerId, DbType.Int32); pAddParameter(cmdSQL, "@cMatEliminado", Request.pcMatEliminado == "" ? "" : Request.pcMatEliminado, DbType.String); pAddParameter(cmdSQL, "@cOpcion", Request.pcOpcion == "" ? "" : Request.pcOpcion, DbType.String); SqlDataReader drSQL = fLeer(cmdSQL); if (drSQL.HasRows) { List <BELineaDetalle> lista = new List <BELineaDetalle>(); lista = (List <BELineaDetalle>)ConvertirDataReaderALista <BELineaDetalle>(drSQL); Request.pnLinDetId = lista[0].pnLinDetId; Request.pnLDetValor = lista[0].pnLDetValor; } else { Request.pnLinDetId = 0; Request.pnLDetValor = 0; } } catch (Exception ex) { throw new Exception(ex.Message, ex); } finally { if (cmdSQL.Connection.State == ConnectionState.Open) { cmdSQL.Connection.Close(); } } return(Request); }
public string fn_INS_LineaDetalle(BELineaDetalle objBELin /*int pnLinDetId, int pnComId, int pnLDetValor, int pnLinId, int pnMatId, int pnPerId, int pnTipId, int pcOpcion*/) { string Respuesta = ""; try { BELineaDetalle objLin = new BELineaDetalle(); objLin.pnLinDetId = objBELin.pnLinDetId; objLin.pnComId = objBELin.pnComId; objLin.pnLDetValor = objBELin.pnLDetValor; objLin.pnLinId = 1; objLin.pnMatId = objBELin.pnMatId; objLin.pnPerId = objBELin.pnPerId; objLin.pnTipId = objBELin.pnTipId; objLin.pcOpcion = "01"; Respuesta = LineaDetalleBL.fMantenimientoLineaDetalleBL(objLin); }catch (Exception ex) { throw new Exception(ex.Message, ex); } return(Respuesta); }
public BELineaDetalle fObtenerValorBL(BELineaDetalle objLineaDetalle) { return(objDA.fObtenerValorDL(objLineaDetalle)); }
public string fMantenimientoLineaDetalleBL(BELineaDetalle objLineaDetalle) { return(objDA.fMantenimientoLineaDetalleDA(objLineaDetalle)); }
public DataTable fListaLineaDetalleBL(BELineaDetalle objLineaDetalle) { return(objDA.fListaLineaDetalleDA(objLineaDetalle)); }