public bool fncAlta(int vEmpresa, string vTipo, DateTime vFecha, DateTime vFechaHora, string vAlmacen, string vProducto, string vDescripción, string vCantidad, string vDocumento, string vOFL, string vUbicación, string vLote, SqlConnection dbconec, SqlTransaction dbTr) { bool vOk = false; try { string vValoresCab = cUtil.fncCargaValoresSQLparaComand(vTabla, cParamXml.strConecProduc_Prueb); int vNumCampos = Convert.ToInt16(cUtil.Piece(vValoresCab, "#", 3)); string vCampos = cUtil.Piece(vValoresCab, "#", 2); vValoresCab = cUtil.Piece(vValoresCab, "#", 1); string vCamposRelp = vCampos.Substring(1, vCampos.Length - 2); int vCont = 1; string[] vDatos = new string[vNumCampos]; for (int i = 0; i < vNumCampos; i++) { vDatos[i] = ""; } if (vEmpresa == 0) { vEmpresa = 1; } vDatos[1] = vEmpresa.ToString(); vDatos[2] = vTipo; vDatos[3] = vFecha.ToShortDateString(); vDatos[4] = vFechaHora.ToString(); vDatos[5] = vAlmacen; vDatos[6] = vProducto; vDatos[7] = vDescripción; vDatos[8] = vCantidad.ToString().Replace(",", "."); vDatos[9] = vDocumento; vDatos[10] = vOFL; vDatos[11] = vUbicación; vDatos[12] = vLote; string vValoresNew = cUtil.fncReplaceValoresSQL(vDatos, vValoresCab, vNumCampos); string vSql = "INSERT INTO " + vTabla + vCampos + " " + vValoresNew; int vCor = SQLDataAccess.GEN_ExecuteNonQueryTransac(vSql, dbconec, dbTr); if (vCor == 1) { vOk = true; } } catch (Exception ex) { vOk = false; } return(vOk); }
public static bool fncMenosCantidadServida(string vEmpresa, int vEnt, int vLin, string vCan, SqlConnection vConec, SqlTransaction vTr) { bool vOk = false; string vSql = cConstantes.SQL_Entrega_Update_MenosCanServida; vSql = vSql.Replace("[?2]", vCan.Replace(",", ".")); vSql = vSql.Replace("[?3]", " Empresa = " + vEmpresa + " and NumPrep =" + vEnt + " and LinPrep =" + vLin + " "); int viOk = SQLDataAccess.GEN_ExecuteNonQueryTransac(vSql, vConec, vTr); if (viOk == 1) { vOk = true; } return(vOk); }
public static bool fncCantidadServida(string vEmpresa, int vPed, int vLin, string vCan, SqlConnection vConec, SqlTransaction vTr) { bool vOk = false; string vSql = cConstantes.SQL_PedidoVenta_Update_CanServida; vSql = vSql.Replace("[?2]", vCan); vSql = vSql.Replace("[?3]", " Empresa = " + vEmpresa + " and NumPed =" + vPed + " and LinPed =" + vLin + " "); int viOk = SQLDataAccess.GEN_ExecuteNonQueryTransac(vSql, vConec, vTr); if (viOk == 1) { vOk = true; } return(vOk); }