public DataTable invLabel_listaRegistrosOrdenMaquina_Param(ref Ent_tticol011 ParametrosIn, ref string strError) { method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string, object>(); paramList.Add("p1", ParametrosIn.mcno.Trim().ToUpperInvariant()); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); try { consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true); if (consulta.Rows.Count < 1) { strError = "Order doesn't initiated for machine. " + ParametrosIn.mcno.Trim().ToUpperInvariant(); } if (consulta.Rows.Count > 1) { strError = "More than one work order found"; } } catch (Exception ex) { strError = "Error when querying data [tticol011]. Try again or contact your administrator \n " + strSentencia; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(consulta); }
public DataTable GetData(ref Ent_ttdcol524 ParametrosIn, ref string strError) { method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string, object>(); paramList.Add("p1", ParametrosIn.item.Trim().ToUpperInvariant()); paramList.Add("p2", ParametrosIn.adjustmentQuantity.Trim().ToUpperInvariant()); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); try { consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true); if (consulta.Rows.Count < 1) { strError = "Not found records for confirm"; } } catch (Exception ex) { strError = "Error when querying data [ttdcol524]. Try again or contact your administrator"; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(consulta); }
public int insertarRegistro(ref Ent_twhcol020 parametro, ref string strError) { method = MethodBase.GetCurrentMethod(); bool retorno = false; try { strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla); parametrosIn = AdicionaParametrosComunes(parametro); retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); return(Convert.ToInt32(retorno)); } catch (Exception ex) { strError = ex.InnerException != null ? ex.Message + " (" + ex.InnerException + ")" : ex.Message; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(Convert.ToInt32(retorno)); }
public DataTable validarRegistroByPalletId(ref string palletId, ref string uniqueId, ref string bodegaori, ref string bodegades, ref string strError) { method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string, object>(); paramList.Add(":T$PAID", palletId.Trim()); paramList.Add(":T$UNID", uniqueId.Trim()); paramList.Add(":T$WHSO", bodegaori.Trim()); paramList.Add(":T$WHTA", bodegades.Trim()); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); try { consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true); if (consulta.Rows.Count < 1) { strError = "Incorrect location, please verify."; } } catch (Exception ex) { strError = "Error to the search sequence [twhcol125]. Try again or contact your administrator \n "; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(consulta); }
public DataTable findRecord(ref Ent_twhcol080 parametro, ref string strError) { method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string, object>(); paramList.Add(":T$SOUR", parametro.sour); paramList.Add(":T$ORNO", parametro.orno.Trim()); paramList.Add(":T$CONJ", parametro.conj); paramList.Add(":T$PONO", parametro.pono); paramList.Add(":T$SQNB", parametro.sqnb); paramList.Add(":T$ORIG", parametro.orig); paramList.Add(":T$SERN", parametro.sern); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); try { consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true); if (consulta.Rows.Count < 1) { strError = "Incorrect location, please verify."; } } catch (Exception ex) { strError = "Error to the search sequence [twhwmd300]. Try again or contact your administrator \n "; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(consulta); }
public int consultaSeqn(ref string mcno, ref string cwar, ref string item, ref string strError) { method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string, object>(); paramList.Add(":T$MCNO", mcno.Trim().ToUpper()); paramList.Add(":T$CWAR", cwar.Trim() == String.Empty ? " " : cwar.Trim().ToUpper()); paramList.Add(":T$ITEM", item.Trim().ToUpper()); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); try { consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true); if (consulta.Rows.Count < 1) { strError = "Incorrect location, please verify."; } } catch (Exception ex) { strError = "Error to the search sequence [tticol095]. Try again or contact your administrator \n "; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(Convert.ToInt32(consulta.Rows[0]["SEQN"].ToString())); }
public DataTable findRecordByWarehouseItemLocation(ref string item, ref string cwar, ref string loca, ref string strError) { method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string, object>(); paramList.Add(":T$ITEM", item.Trim().ToUpper()); paramList.Add(":T$CWAR", cwar.Trim().ToUpper()); paramList.Add(":T$LOCA", loca.Trim().ToUpper()); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); try { consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true); if (consulta.Rows.Count < 1) { strError = "Incorrect location, please verify."; } } catch (Exception ex) { strError = "Error to the search sequence [tticol116]. Try again or contact your administrator \n "; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(consulta); }
public int insertarRegistro(ref List <Ent_twhcol015> parametros, ref string strError) { method = MethodBase.GetCurrentMethod(); bool retorno = false; try { strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla); foreach (Ent_twhcol015 reg in parametros) { parametrosIn = AdicionaParametrosComunes(reg); retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); } return(Convert.ToInt32(retorno)); } catch (Exception ex) { strError = "Error when inserting data [twhcol015]. Try again or contact your administrator"; log.escribirError(strError + Console.Out.NewLine + ex.Message, method.Module.Name, method.Name, method.ReflectedType.Name); } return(Convert.ToInt32(retorno)); }
public DataTable findByNumberReceipt(ref string numberReceipt, ref string strError) { method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string, object>(); paramList.Add(":T$RCNO", numberReceipt.Trim()); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); try { consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true); if (consulta.Rows.Count < 1) { strError = "Incorrect location, please verify."; } } catch (Exception ex) { strError = "Error to the search sequence [twhinh210]. Try again or contact your administrator \n "; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(consulta); }
public DataTable listaRegistros_ObtieneItem(ref Ent_twhinr140 ParametrosIn, ref string strError) { method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string, object>(); paramList.Add(":T$LOCA", ParametrosIn.loca.Trim().ToUpperInvariant()); paramList.Add(":T$CLOT", ParametrosIn.clot.Trim().ToUpperInvariant()); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); try { consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true); if (consulta.Rows.Count < 1) { strError = "That Lot doesn't have Item Asociated."; } } catch (Exception ex) { strError = "Error when querying data [twhinr140]. Try again or contact your administrator \n " + strSentencia; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(consulta); }
public DataTable findByItemAndPdno(ref string pdno, ref string item, ref string strError) { //JC 300721 Evitar Error Collection //consulta.Rows.Clear(); method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string, object>(); paramList.Add(":T$SITM", item.Trim().ToUpper()); paramList.Add(":T$PDNO", pdno.Trim().ToUpper()); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); try { consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true); if (consulta.Rows.Count < 1) { strError = "Incorrect location, please verify."; } } catch (Exception ex) { strError = "Error to the search sequence [twhwmd300]. Try again or contact your administrator \n "; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(consulta); }
private List <Ent_ParametrosDAL> AdicionaParametrosComunes(Ent_ttccol300 parametros, bool blnUsarPRetorno = false) { method = MethodBase.GetCurrentMethod(); string strError = string.Empty; List <Ent_ParametrosDAL> parameterCollection = new List <Ent_ParametrosDAL>(); try { Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$USER", DbType.String, parametros.user); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$NAMA", DbType.String, parametros.nama); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$PASS", DbType.String, parametros.pass); //Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$UFIN", DbType.String, parametros.ufin); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$REFCNTD", DbType.Int32, parametros.refcntd); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$REFCNTU", DbType.Int32, parametros.refcntu); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$ROLE", DbType.Int32, parametros.refcntu); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$SHIF", DbType.Int32, parametros.refcntu); if (blnUsarPRetorno) { Ent_ParametrosDAL pDal = new Ent_ParametrosDAL(); pDal.Name = "@p_Int_Resultado"; pDal.Type = DbType.Int32; pDal.ParDirection = ParameterDirection.Output; parameterCollection.Add(pDal); } } catch (Exception ex) { strError = "Error when creating parameters [301]. Try again or contact your administrator \n"; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(parameterCollection); }
public int insertarRegistro(ref List <Ent_tticol080> parametros, ref string strError, ref string strTagId) { method = MethodBase.GetCurrentMethod(); bool retorno = false; //Ent_twhcol018 obj018; //twhcol018 dal018 = new twhcol018(); try { strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla); //int cant = parametros.Count; foreach (Ent_tticol080 reg in parametros) { //obj018 = new Ent_twhcol018(); //parametrosIn = AdicionaParametrosComunes(reg); method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string, object>(); paramList.Add(":T$ORNO", reg.orno); paramList.Add(":T$PONO", reg.pono); paramList.Add(":T$CWAR", reg.cwar); paramList.Add(":T$ITEM", reg.item); paramList.Add(":T$QUNE", reg.qune); paramList.Add(":T$LOGN", reg.logn); paramList.Add(":T$DATE", reg.date); paramList.Add(":T$PROC", reg.proc); paramList.Add(":T$REFCNTD", reg.refcntd); paramList.Add(":T$REFCNTU", reg.refcntu); paramList.Add(":T$CLOT", reg.clot); paramList.Add(":T$OORG", reg.oorg); paramList.Add(":T$PICK", reg.pick); //strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList, 1); retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); } return(Convert.ToInt32(retorno)); } catch (Exception ex) { strError = "Error when inserting data [tticol080]. Try again or contact your administrator"; log.escribirError(strError + Console.Out.NewLine + ex.Message, method.Module.Name, method.Name, method.ReflectedType.Name); } return(Convert.ToInt32(retorno)); }
public int insertarRegistro(ref List <Ent_twhcol018> parametros, ref string strError, ref string strTagId) { method = MethodBase.GetCurrentMethod(); bool retorno = false; //string strTagId = string.Empty; List <Ent_ParametrosDAL> parameterCollection = new List <Ent_ParametrosDAL>(); try { //Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$TGID", DbType.String, parametros.tgid); //Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$ITEM", DbType.String, parametros.); //Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CLOT", DbType.String, parametros.tgid); //Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$QTDL", DbType.String, parametros.tgid); //Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CUNI", DbType.String, parametros.tgid); //Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$REFCNTD", DbType.String, parametros.tgid); //Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$REFCNTU", DbType.String, parametros.tgid); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla); foreach (Ent_twhcol018 reg in parametros) { //GRRC strTagId = nextTag_Id(reg, ref strError); if (!string.IsNullOrEmpty(strError)) { retorno = false; break; } reg.tgid = strTagId; parametrosIn = AdicionaParametrosComunes(reg); parametros[0].tgid = strTagId; retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); } return(Convert.ToInt32(retorno)); } catch (Exception ex) { strError = "Error al insertar en twhcol018. Try again or contact your administrator"; log.escribirError(strError + Console.Out.NewLine + ex.Message, method.Module.Name, method.Name, method.ReflectedType.Name); } return(Convert.ToInt32(retorno)); }
public int consultarConsecutivoMaximo(ref string strError) { method = MethodBase.GetCurrentMethod(); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); try { consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true); if (consulta.Rows.Count < 1) { strError = "Incorrect location, please verify."; } } catch (Exception ex) { strError = "Error to the search sequence [twhcol010]. Try again or contact your administrator \n "; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(Convert.ToInt32(consulta.Rows[0]["SEC"].ToString())); }
/// <summary> /// Consultar etiqueta toma de materiales /// </summary> /// <param name="Ent_ttwhcol016">Objetos de tipo Entidad[Ent_ttwhcol016] con parametros a usar</param> /// <param name="strError">Cadena de error para controlar el resultado</param> /// <returns>DataTable: Tabla virtual con el registro correspondiente al parametro (En caso de existir) u Objeto nulo en caso contrario . </returns> public DataTable listaRegistrosMaquinas(ref string strError) { method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string, object>(); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, "tticol003", paramList); try { consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true); if (consulta.Rows.Count < 1) { strError = "No existen maquinas para procesar"; } return(consulta); } catch (Exception ex) { strError = "Error consultando tticol003. Intente de nuevo o contacte al administrador"; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(consulta); }
//JC 210122 Buscar tipo Item public DataTable GetItemType(ref Ent_twhcol028 Parametros,ref string strError) { method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string,object>(); paramList.Add("item",Parametros.TITM.Trim().ToUpper()); strSentencia = recursos.readStatement(method.ReflectedType.Name,method.Name,ref owner,ref env,tabla,paramList); try { consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text",strSentencia,ref parametersOut,null,true); if (consulta.Rows.Count < 1) { strError = "Item code doesn´t exist. Cannot continue"; } return(consulta); } catch (Exception ex) { log.escribirError(strError + Console.Out.NewLine + ex.Message,method.Module.Name,method.Name,method.ReflectedType.Name); } return(consulta); }
private List <Ent_ParametrosDAL> AdicionaParametrosComunes(Ent_ttscol101 parametros, bool blnUsarPRetorno = false) { method = MethodBase.GetCurrentMethod(); string strError = string.Empty; List <Ent_ParametrosDAL> parameterCollection = new List <Ent_ParametrosDAL>(); try { Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$ORNO", DbType.String, parametros.orno.ToUpperInvariant()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$ITEM", DbType.String, parametros.item.Trim().ToUpperInvariant()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LOCA", DbType.String, parametros.loca); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CWAR", DbType.String, parametros.cwar.ToUpperInvariant()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$QDEL", DbType.Decimal, Convert.ToDecimal(parametros.qdel).ToString("#.##0,0000")); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CDAT", DbType.String, parametros.cdat); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$MESS", DbType.String, parametros.mess); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$REFCNTD", DbType.Int32, parametros.refcntd); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$REFCNTU", DbType.Int32, parametros.refcntu); if (!string.IsNullOrEmpty(parametros.logn)) { Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LOGN", DbType.String, parametros.logn); } if (!string.IsNullOrEmpty(parametros.cusr)) { Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CUSR", DbType.String, parametros.cusr); } if (parametros.conf > 0) { Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CONF", DbType.Int32, parametros.conf); } if (blnUsarPRetorno) { Ent_ParametrosDAL pDal = new Ent_ParametrosDAL(); pDal.Name = "@p_Int_Resultado"; pDal.Type = DbType.Int32; pDal.ParDirection = ParameterDirection.Output; parameterCollection.Add(pDal); } } catch (Exception ex) { strError = "Error when creating parameters [scol101]. Try again or contact your administrator \n"; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(parameterCollection); }
public DataTable datosMenu_Param(string USER, string PROG) { int positionWebPages = PROG.ToLower().IndexOf("webpages"); if (positionWebPages > 0) { PROG = PROG.Remove(0, positionWebPages - 1); } string retorno = string.Empty; method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string, object>(); paramList.Add(":T$USER", USER); paramList.Add(":T$PROG", PROG); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); log.escribirError("Ejecucion correcta de : ", "Fusion2pop", "datosMenu_Param", "una"); try { consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true); //if (consulta.Rows.Count < 1) { strError = "-1"; } if (consulta.Rows.Count > 0) { retorno = consulta.Rows[0]["MENG"].ToString().Trim(); } log.escribirError("Ejecucion correcta de Sql : " + strSentencia, "Fusion2pop", "datosMenu_Param", "una"); return(consulta); } catch (Exception ex) { log.escribirError("Script Error 13: " + strSentencia, "Fusion2pop", method.ToString(), "ttccol303"); //strError = "Error when querying data [ttccol303]. Try again or contact your administrator"; throw ex; } }
public int insertarRegistro(ref List <Ent_ttwhcol016> parametros, ref string strError) { method = MethodBase.GetCurrentMethod(); bool retorno = false; string MsgstrError = string.Empty; try { strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla); foreach (Ent_ttwhcol016 reg in parametros) { parametrosIn = AdicionaParametrosComunes(reg); MsgstrError = "Error when inserting data [ttwhcol016]. "; retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); paramList = new Dictionary <string, object>(); paramList.Add("p1", reg.zone.Trim().ToUpperInvariant()); strSentencia = recursos.readStatement(method.ReflectedType.Name, "actualizarSecuenciaInsert", ref owner, ref env, tabla, paramList); //" SET t$ffno = (SELECT MAX(t$ffno) " + // "FROM " + owner + ".ttcmcs050" + env + // " WHERE TRIM(T$NRGR) = '" + reg.zone.Trim() + "') + ROWNUM " + MsgstrError = "Error al Actualizar ttcmcs050. "; retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, null, false); } return(Convert.ToInt32(retorno)); } catch (Exception ex) { strError = MsgstrError + "Try again or contact your administrator"; log.escribirError(strError + Console.Out.NewLine + ex.Message, method.Module.Name, method.Name, method.ReflectedType.Name); } return(Convert.ToInt32(retorno)); }
public DataTable LimitePorArticuloyMaquinaTticol110(string mcno, string item, ref string strError) { method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string, object>(); paramList.Add(":T$MCNO", mcno.Trim().ToUpper()); paramList.Add(":T$ITEM", item.Trim().ToUpper()); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); try { //consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true); //if (consulta.Rows.Count < 1) { strError = "Incorrect location, please verify."; } } catch (Exception ex) { strError = "Error to the search quantity [tticol110]. Try again or contact your administrator \n "; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(consulta); }
public DataTable ConsultarPendientesTccol307(string STAT, string CWAR) { string strError = string.Empty; DataTable Resultado = new DataTable(); method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string, object>(); paramList.Add(":T$STAT", STAT); paramList.Add(":T$CWAR", CWAR); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); log.escribirError("consulta" + strSentencia, "seguimiento picking", "seguimiento picking", "seguimiento picking"); try { Resultado = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true); } catch (Exception ex) { strError = "Error when querying data [ttccol307]. Try again or contact your administrator"; //throw ex; } return(Resultado); }
private List <Ent_ParametrosDAL> AdicionaParametrosComunes(Ent_tticol085 parametros, bool blnUsarPRetorno = false) { method = MethodBase.GetCurrentMethod(); string strError = string.Empty; List <Ent_ParametrosDAL> parameterCollection = new List <Ent_ParametrosDAL>(); try { Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$MCNO", DbType.String, parametros.mcno); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$TYPE", DbType.Int32, parametros.type); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$TANO", DbType.Int32, parametros.tano); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CWTT", DbType.String, parametros.cwtt); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$HREA", DbType.Double, parametros.hrea); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$COMM", DbType.String, parametros.comm); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LOGN", DbType.String, parametros.logn); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$PROC", DbType.Int32, parametros.proc); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CHEC", DbType.Int32, parametros.chec); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$MESS", DbType.String, parametros.mess); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$REFCNTD", DbType.Int32, parametros.refcntd); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$REFCNTU", DbType.Int32, parametros.refcntu); if (blnUsarPRetorno) { Ent_ParametrosDAL pDal = new Ent_ParametrosDAL(); pDal.Name = "@p_Int_Resultado"; pDal.Type = DbType.Int32; pDal.ParDirection = ParameterDirection.Output; parameterCollection.Add(pDal); } } catch (Exception ex) { strError = "Error when creating parameters [301]. Try again or contact your administrator \n"; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(parameterCollection); }
public int insertarDatos(ref Ent_ttdcol137 parametros, ref string strError) { method = MethodBase.GetCurrentMethod(); bool retorno = false; paramList = new Dictionary <string, object>(); paramList.Add(":T$PAID", parametros.Paid.Trim().ToUpper().ToString()); paramList.Add(":T$ORNO", parametros.Orno.ToUpper().ToString()); paramList.Add(":T$CLOT", parametros.Clot.ToString()); paramList.Add(":T$CWAR", parametros.Cwar.ToString()); paramList.Add(":T$LOCA", parametros.Loca.ToString()); paramList.Add(":T$QTYA", parametros.Qtya.ToString()); paramList.Add(":T$USER", parametros.User.ToUpper().ToString()); paramList.Add(":T$REFCNTD", "0"); paramList.Add(":T$REFCNTU", "0"); try { strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); return(Convert.ToInt32(retorno)); } catch (Exception ex) { strError = "Error when inserting data [ttdcol137]. Try again or contact your administrator \n"; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(Convert.ToInt32(retorno)); }
public int insertarRegistro(ref List <Ent_ttwhcol017> parametros, ref string strError) { string tablaCoun = owner + ".twhcol002" + env; bool retorno = false; Dictionary <string, object> parametersOut = new Dictionary <string, object>(); int sqnb = 0, coun = 0; try { method = MethodBase.GetCurrentMethod(); // Sentencia de busquedade id de etiqueta existente //string strSentenciaBusca = "SELECT NVL(MAX(T$SQNB),0) + 1 SQNB " + // "FROM " + tabla + " " + // "WHERE TRIM(T$LABL) = TRIM('{0}')"; string strSentenciaBusca = string.Empty; //string strSentenciaBuscaCoun = "SELECT T$COUN COUN " + // "FROM " + tablaCoun + " " + // "WHERE TRIM(T$CWAR) = TRIM('{0}')"; string strSentenciaBuscaCoun = string.Empty; strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla); foreach (Ent_ttwhcol017 reg in parametros) { // Buscar id de etiqueta existente paramList = new Dictionary <string, object>(); paramList.Add("p1", reg.labl.Trim().ToUpperInvariant()); strSentenciaBusca = recursos.readStatement(method.ReflectedType.Name, "TakeMaterialInv_verificaidLabel_Param", ref owner, ref env, tabla, paramList); DataTable conf = DAL.BaseDAL.BaseDal.EjecutarCons("text", strSentenciaBusca, ref parametersOut, null, false); if (conf.Rows.Count > 0) { sqnb = Convert.ToInt32(conf.Rows[0]["SQNB"].ToString()); } reg.sqnb = sqnb; // Buscar campo coun de twhcol002 paramList = new Dictionary <string, object>(); paramList.Add("p1", reg.cwar.Trim().ToUpperInvariant()); strSentenciaBuscaCoun = recursos.readStatement(method.ReflectedType.Name, "TakeMaterialInv_verificaConsBodega_Param", ref owner, ref env, tablaCoun, paramList); conf = DAL.BaseDAL.BaseDal.EjecutarCons("text", strSentenciaBuscaCoun, ref parametersOut, null, false); if (conf.Rows.Count > 0) { coun = Convert.ToInt32(conf.Rows[0]["COUN"].ToString()); } reg.coun = coun; // Inicia la insercion del registro parametrosIn = AdicionaParametrosComunes(reg); retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); } return(Convert.ToInt32(retorno)); } catch (Exception ex) { strError = "Error when inserting data [ttwhcol017]. Try again or contact your administrator"; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(Convert.ToInt32(retorno)); }
public int insertarRegistro(ref List <Ent_tticol022> parametros, ref List <Ent_tticol020> parametros020, ref string strError) { method = MethodBase.GetCurrentMethod(); bool retorno = false; try { strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla); log.escribirError(strSentencia, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); foreach (Ent_tticol022 reg in parametros) { if (!invLabel_tiempoGrabacion(reg, ref strError)) { break; } // Inicia la insercion del registro parametrosIn = AdicionaParametrosComunes(reg); retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); if (retorno) { DAL.tticol020 dal020 = new tticol020(); int intRetorno = dal020.insertarRegistro(ref parametros020, ref strError); Ent_tticol022 nreg = reg; int retorno222 = InsertarRegistroTicol222(ref nreg, ref strError); } } return(Convert.ToInt32(retorno)); } catch (Exception ex) { strError = "Error when inserting data [col022]. Try again or contact your administrator"; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(Convert.ToInt32(retorno)); }
public bool insertarRegistro(ref Ent_twhcol122 parametro, ref string strError) { method = MethodBase.GetCurrentMethod(); bool retorno = false; method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string, object>(); paramList.Add(":T$UNID", parametro.unid.Trim()); paramList.Add(":T$LOGN", parametro.logn.Trim()); paramList.Add(":T$LOSO", parametro.loso); paramList.Add(":T$PAID", parametro.paid); paramList.Add(":T$ITEM", parametro.item); paramList.Add(":T$CLOT", parametro.clot); paramList.Add(":T$QTDT", parametro.qtdt); paramList.Add(":T$PROC", parametro.proc); paramList.Add(":T$MES1", parametro.mes1); paramList.Add(":T$REFCNTD", parametro.refcntd); paramList.Add(":T$REFCNTU", parametro.refcntu); try { strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); log.escribirError("My sql: " + strSentencia, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); } catch (Exception ex) { strError = ex.InnerException != null ? ex.Message + " (" + ex.InnerException + ")" : ex.Message; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(retorno); }
public int insertarRegistro(ref List <Ent_tticol125> parametros, ref string strError) { method = MethodBase.GetCurrentMethod(); bool retorno = false; foreach (var item in parametros) { if (item.paid == "") { item.paid = " "; } } List <Ent_tticol080> Parametros080 = new List <Ent_tticol080>(); Ent_tticol080 t080 = new Ent_tticol080(); tticol080 dal080 = new tticol080(); string strTagId = string.Empty; try { strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla); foreach (Ent_tticol125 reg in parametros) { parametrosIn = AdicionaParametrosComunes(reg); retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); //Requerimiento No. 46122. //Se quitó la inserción en la tabla ticol080 //CChaverra 28/07/2017 //if (Convert.ToInt32(retorno) > 0) //{ // t080 = new Ent_tticol080(); // t080.orno = reg.pdno; // t080.pono = reg.pono; // t080.item = reg.item; // t080.cwar = reg.cwar; // t080.qune = reg.reqt * -1; // t080.logn = reg.user; // t080.proc = 2; // t080.refcntd = 0; // t080.refcntu = 0; // t080.clot = reg.clot; // Parametros080.Add(t080); // dal080.insertarRegistro(ref Parametros080, ref strError, ref strTagId); // Parametros080.Clear(); // if (!string.IsNullOrEmpty(strError)) // break; //} } } catch (Exception ex) { strError += "Error when inserting data [025]. Try again or contact your administrator"; log.escribirError(strError + Console.Out.NewLine + ex.Message, method.Module.Name, method.Name, method.ReflectedType.Name); } return(Convert.ToInt32(retorno)); }
public int insertarRegistro(ref List <Ent_tticol090> parametros, ref string strError) { method = MethodBase.GetCurrentMethod(); bool retorno = false; int secuencia = 0; try { strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla); foreach (Ent_tticol090 reg in parametros) { secuencia = lineCleareance_verificaItemInsert(reg, strError); reg.srno = secuencia; parametrosIn = AdicionaParametrosComunes(reg); retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); } return(Convert.ToInt32(retorno)); } catch (Exception ex) { strError = "Error when inserting data [090]. Try again or contact your administrator"; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(Convert.ToInt32(retorno)); }
public int insertarRegistro(ref List <Ent_tticol074> parametros, ref string strError) { String dato = ""; method = MethodBase.GetCurrentMethod(); bool retorno = false; try { strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla); foreach (Ent_tticol074 reg in parametros) { try { parametrosIn = AdicionaParametrosComunes(reg); retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); } catch (Exception ex) { /** * Se Adiciona esta parte para controlar los errores en la insesión en este momento * solo se controla la llave duplicada que esta generando problemas, se toma el * registro y se actualiza, teniendo en cuenta que eso sucede cuando el dato anterior * tiene cantidad (0) cero LRM 03/01/2018 **/ dato = ex.Message.Substring(0, 9).Trim(); switch (dato) { case "ORA-00001": //MessageBox.Show("Error attempting to insert duplicate data."); paramList = new Dictionary <string, object>(); paramList.Add("p1", "'" + reg.orden + "'"); paramList.Add("p2", reg.fecha.ToString("MM/dd/yyyy HH:mm:ss")); paramList.Add("p3", reg.fecha.ToString("MM/dd/yyyy HH:mm:ss")); strSentencia = recursos.readStatement(method.ReflectedType.Name, "actualizarRegistro", ref owner, ref env, tabla, paramList); parametrosIn = AdicionaParametrosComunes(reg); retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); strSentencia = recursos.readStatement(method.ReflectedType.Name, "insertarRegistro", ref owner, ref env, tabla); break; case "ORA-12545": //MessageBox.Show("The database is unavailable."); break; default: //MessageBox.Show("Database error: " + ex.Message.ToString()); break; } } } return(Convert.ToInt32(retorno)); } catch (SqlException ex) { strError = "Error when inserting data [tticol074]. Try again or contact your administrator \n"; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(Convert.ToInt32(retorno)); }