public bool updateRecordConfPicking(ref Ent_twhcol080 parametro, ref string strError) { parametrosIn.Clear(); method = MethodBase.GetCurrentMethod(); bool retorno = false; try { paramList = new Dictionary <string, object>(); paramList.Add(":T$ORIG", parametro.orig); paramList.Add(":T$SOUR", parametro.sour); paramList.Add(":T$ORNO", parametro.orno); 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(retorno); } catch (Exception ex) { strError = ex.InnerException != null ? ex.Message + " (" + ex.InnerException + ")" : ex.Message; } return(retorno); }
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); }
protected void btnGuardarRecepcion_Click(object sender, EventArgs e) { lblError.Text = ""; for (int i = 0; i < findReceipt.Rows.Count; i++) { var cantidad = Request.Form[String.Concat("cant-", i)].Trim().ToUpper(); var cantident = Request.Form[String.Concat("cantident-", i)].Trim().ToUpper(); var clot = Request.Form[String.Concat("bodega-", i)].Trim().ToUpper(); Ent_twhcol080 data = new Ent_twhcol080() { sour = Convert.ToInt32(findReceipt.Rows[i]["OORG"].ToString()), orno = findReceipt.Rows[i]["ORNO"].ToString(), conj = Convert.ToInt32(findReceipt.Rows[i]["OSET"].ToString()), pono = Convert.ToInt32(findReceipt.Rows[i]["PONO"].ToString()), sqnb = Convert.ToInt32(findReceipt.Rows[i]["SEQN"].ToString()), rcno = findReceipt.Rows[i]["RCNO"].ToString(), item = findReceipt.Rows[i]["ITEM"].ToString(), qana = double.Parse(cantidad, CultureInfo.InvariantCulture.NumberFormat), cuni = findReceipt.Rows[i]["RCUN"].ToString(), clot = clot, logn = HttpContext.Current.Session["user"].ToString(), habl = double.Parse(cantident, CultureInfo.InvariantCulture.NumberFormat) }; var findRecord = _idaltwhcol080.findRecord(ref data, ref strError); if (findRecord.Rows.Count > 0) { var updateRecord = _idaltwhcol080.updateRecord(ref data, ref strError); if (!updateRecord) { lblConfirm.Text = String.Empty; lblError.Text = mensajes("errorupdt"); return; } } else { var insertRecord = _idaltwhcol080.insertRecord(ref data, ref strError); if (insertRecord < 1) { lblConfirm.Text = String.Empty; lblError.Text = mensajes("errorsave"); return; } } } lblConfirm.Text = mensajes("msjsave"); tblReceipts.InnerHtml = String.Empty; btnGuardarRecepcion.Visible = false; txtNumeroRecepcion.Text = String.Empty; return; }
protected void btnGuardar_Click(object sender, EventArgs e) { var contadorConfirmados = 0; var orno = txtOrder.Text.Trim().ToUpper(); var sour = slMovement.SelectedValue.Trim().ToUpper(); for (int i = 0; i < _validaRecepcion.Rows.Count; i++) { var slConfirm = Convert.ToBoolean(Request.Form["slConfirm-" + i].ToString()); if (slConfirm) { contadorConfirmados++; var item = _validaRecepcion.Rows[i]["ITEM"].ToString().Trim().ToUpper(); var conj = _validaRecepcion.Rows[i]["CONJ"].ToString().Trim().ToUpper(); var pono = _validaRecepcion.Rows[i]["PONO"].ToString().Trim().ToUpper(); var sqnb = _validaRecepcion.Rows[i]["SQNB"].ToString().Trim().ToUpper(); var sern = _validaRecepcion.Rows[i]["SERN"].ToString().Trim().ToUpper(); Ent_twhcol080 data080 = new Ent_twhcol080() { conf = 1, orno = orno, item = item, sour = Convert.ToInt32(sour), conj = Convert.ToInt32(conj), pono = Convert.ToInt32(pono), sqnb = Convert.ToInt32(sqnb), sern = Convert.ToInt32(sern), }; var validaUpdate = _idaltwhcol080.updateRecordConfirm(ref data080, ref strError); if (validaUpdate) { lblError.Text = String.Empty; lblConfirm.Text = mensajes("msjupdate"); divTable.InnerHtml = String.Empty; divBtnGuardar.Visible = false; txtOrder.Text = String.Empty; } else { lblError.Text = mensajes("errorupdt"); return; } } } }
public bool updateRecordConfirm(ref Ent_twhcol080 parametro, ref string strError) { bool retorno = false; try { retorno = dal.updateRecordConfirm(ref parametro, ref strError); return(retorno); } catch (Exception ex) { throw new Exception(strError += "\nPila: " + ex.Message); } }
public int insertRecord(ref Ent_twhcol080 datatwhcol080, ref string strError) { int retorno = -1; try { retorno = dal.insertRecord(ref datatwhcol080, ref strError); return(retorno); } catch (Exception ex) { throw new Exception(strError += "\nPila: " + ex.Message); } }
public DataTable findRecord(ref Ent_twhcol080 datatwhcol080, ref string strError) { DataTable retorno = new DataTable(); try { retorno = dal.findRecord(ref datatwhcol080, ref strError); return(retorno); } catch (Exception ex) { throw new Exception(strError += "\nPila: " + ex.Message); } }
private List <Ent_ParametrosDAL> AdicionaParametrosComunes(Ent_twhcol080 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$SOUR", DbType.Int32, parametros.sour); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$ORNO", DbType.String, parametros.orno); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CONJ", DbType.Int32, parametros.conj); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$PONO", DbType.Int32, parametros.pono); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$SQNB", DbType.Int32, parametros.sqnb); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$SERN", DbType.Int32, parametros.sern); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$RCNO", DbType.String, parametros.rcno); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CWAR", DbType.String, parametros.cwar); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LOCA", DbType.String, parametros.loca); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$ITEM", DbType.String, parametros.item); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$QANA", DbType.Double, parametros.qana); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CUNI", DbType.String, parametros.cuni); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CLOT", DbType.String, parametros.clot == null ? " " : parametros.clot.Trim().ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LOGN", DbType.String, parametros.logn); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$HABL", DbType.Double, parametros.habl); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$ESTI", DbType.Int32, parametros.esti); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$DIFE", DbType.Int32, parametros.dife); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$PROC", DbType.Int32, parametros.proc); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CONF", DbType.Int32, parametros.conf); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$ORIG", DbType.Int32, parametros.orig); 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 bool updateRecord(ref Ent_twhcol080 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 = AdicionaParametrosComunesUpdate(parametro); retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); return(retorno); } catch (Exception ex) { strError = ex.InnerException != null ? ex.Message + " (" + ex.InnerException + ")" : ex.Message; } return(retorno); }
protected void btnGuardarRecepcion_Click(object sender, EventArgs e) { var cantidad = Request.Form["cant-0"]; var LOCA = Request.Form[String.Concat("ubic-0")]; var CWAR = _consultaRecepcion.Rows[0]["CWAR"].ToString().ToUpper(); var validateLocation = _idaltwhwmd300.validateExistsLocation(ref LOCA, ref CWAR, ref strError); if (validateLocation.Rows.Count > 0) { Ent_twhcol080 data = new Ent_twhcol080() { sour = Convert.ToInt32(_consultaRecepcion.Rows[0]["OORG"].ToString()), orno = _consultaRecepcion.Rows[0]["ORNO"].ToString(), conj = Convert.ToInt32(_consultaRecepcion.Rows[0]["OSET"].ToString()), pono = Convert.ToInt32(_consultaRecepcion.Rows[0]["PONO"].ToString()), sqnb = Convert.ToInt32(_consultaRecepcion.Rows[0]["SEQN"].ToString()), rcno = " ", cwar = _consultaRecepcion.Rows[0]["CWAR"].ToString(), loca = LOCA, item = _consultaRecepcion.Rows[0]["ITEM"].ToString(), qana = double.Parse(cantidad, CultureInfo.InvariantCulture.NumberFormat), cuni = _consultaRecepcion.Rows[0]["CUNI"].ToString(), clot = _consultaRecepcion.Rows[0]["CLOT"].ToString(), logn = HttpContext.Current.Session["user"].ToString(), orig = 2 }; var validateRecord = _idaltwhcol080.findRecord(ref data, ref strError); if (validateRecord.Rows.Count > 0) { var validateUpdate = _idaltwhcol080.updateRecord(ref data, ref strError); if (validateUpdate) { lblConfirm.Text = mensajes("msjupdate"); tblReceipts.InnerHtml = String.Empty; btnGuardarRecepcion.Visible = false; lblError.Text = String.Empty; return; } else { lblError.Text = mensajes("errorupdt"); return; } } else { var validateInsert = _idaltwhcol080.insertRecord(ref data, ref strError); if (validateInsert > 0) { lblConfirm.Text = mensajes("msjsave"); tblReceipts.InnerHtml = String.Empty; btnGuardarRecepcion.Visible = false; lblError.Text = String.Empty; return; } else { lblError.Text = mensajes("errorsave"); return; } } } else { lblError.Text = mensajes("locinv"); return; } }
protected void btnGuardar_Click(object sender, EventArgs e) { lblConfirm.Text = String.Empty; lblError.Text = String.Empty; var cantidad = txtCantSugerida.Text; var LOCA = txtUbicacion.Text.Trim().ToUpper(); var CLOT = txtLote.Text.Trim().ToUpper(); Ent_twhcol080 data = new Ent_twhcol080() { sour = Convert.ToInt32(_validateRecord.Rows[0]["OORG"].ToString()), orno = _validateRecord.Rows[0]["ORNO"].ToString(), conj = Convert.ToInt32(_validateRecord.Rows[0]["OSET"].ToString()), pono = Convert.ToInt32(_validateRecord.Rows[0]["PONO"].ToString()), sqnb = Convert.ToInt32(_validateRecord.Rows[0]["SEQN"].ToString()), sern = Convert.ToInt32(_validateRecord.Rows[0]["SERN"].ToString()), rcno = " ", cwar = _validateRecord.Rows[0]["CWAR"].ToString(), loca = LOCA == String.Empty ? " " : LOCA, item = _validateRecord.Rows[0]["ITEM"].ToString(), qana = double.Parse(cantidad, CultureInfo.InvariantCulture.NumberFormat), cuni = _validateRecord.Rows[0]["ATUN"].ToString(), clot = CLOT == String.Empty ? " " : CLOT, logn = HttpContext.Current.Session["user"].ToString(), orig = 3 }; var validateRecord = _idaltwhcol080.findRecord(ref data, ref strError); if (validateRecord.Rows.Count > 0) { var validateUpdate = _idaltwhcol080.updateRecord(ref data, ref strError); if (validateUpdate) { txtNumero.Text = String.Empty; txtCantSugerida.Text = String.Empty; txtUbicacion.Text = String.Empty; txtLote.Text = String.Empty; lblConfirm.Text = mensajes("msjupdate"); divTable.Visible = false; lblError.Text = String.Empty; return; } else { lblError.Text = mensajes("errorupdt"); return; } } else { var validateInsert = _idaltwhcol080.insertRecord(ref data, ref strError); if (validateInsert > 0) { txtNumero.Text = String.Empty; txtCantSugerida.Text = String.Empty; txtUbicacion.Text = String.Empty; txtLote.Text = String.Empty; lblConfirm.Text = mensajes("msjsave"); divTable.Visible = false; lblError.Text = String.Empty; return; } else { lblError.Text = mensajes("errorsave"); return; } } }
protected void btnGuardarRecepcion_Click(object sender, EventArgs e) { var quant = Request.Form["cant-0"].ToString(); var quantConvert = double.Parse(quant, CultureInfo.InvariantCulture.NumberFormat); Ent_twhcol080 data080 = new Ent_twhcol080() { sour = Convert.ToInt32(hdfFuente.Value), conj = 0, pono = 0, sqnb = 0, sern = 0, orig = 4, rcno = "0", cwar = "0", loca = " ", item = "0", qana = 0, cuni = " ", clot = "0", habl = 0, dife = 2, proc = 2, conf = 2, refcntd = 0, refcntu = 0, orno = txtNumeroRecepcion.Text.Trim().ToUpper(), logn = HttpContext.Current.Session["user"].ToString(), esti = Convert.ToInt32(quantConvert) }; var validaRegistro = _idaltwhcol080.findRecord(ref data080, ref strError); if (validaRegistro.Rows.Count > 0) { var updateRecord = _idaltwhcol080.updateRecordPicking(ref data080, ref strError); if (updateRecord) { data080.orig = 3; var updateConf = _idaltwhcol080.updateRecordConfPicking(ref data080, ref strError); lblConfirm.Text = mensajes("msjsave"); lblError.Text = String.Empty; divTable.Visible = false; btnGuardarRecepcion.Visible = false; txtNumeroRecepcion.Text = String.Empty; return; } else { lblError.Text = mensajes("errorupdt"); return; } } else { var validateInsert = _idaltwhcol080.insertRecord(ref data080, ref strError); if (validateInsert > 0) { data080.orig = 3; var updateConf = _idaltwhcol080.updateRecordConfPicking(ref data080, ref strError); lblConfirm.Text = mensajes("msjsave"); lblError.Text = String.Empty; divTable.Visible = false; btnGuardarRecepcion.Visible = false; txtNumeroRecepcion.Text = String.Empty; return; } else { lblError.Text = mensajes("errorsave"); return; } } }