private List <Ent_ParametrosDAL> AdicionaParametrosComunesUpdate(Ent_tticol127 parametros, bool blnUsarPRetorno = false) { string param = 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$CWAR", DbType.String, parametros.cwar); 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) { log.escribirError(ex.Message, stackTrace.GetFrame(2).GetMethod().Name, metodo, method.ReflectedType.Name); // throw (ex); } return(parameterCollection); }
protected void btnSend_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtItem.Text.Trim())) { RequiredField.Enabled = true; RequiredField.IsValid = false; txtItem.Focus(); btnSave.Visible = false; grdRecords.DataSource = ""; grdRecords.DataBind(); return; } if (string.IsNullOrEmpty(txtLot.Text.Trim())) { RequiredFieldLot.Enabled = true; RequiredFieldLot.IsValid = false; txtLot.Focus(); btnSave.Visible = false; grdRecords.DataSource = ""; grdRecords.DataBind(); return; } // Validar si el usuario tiene almacen MRB asociado //Validar si el Item y Lote digitado son correctos InterfazDAL_tticol127 idal = new InterfazDAL_tticol127(); Ent_tticol127 obj = new Ent_tticol127(); string strError = string.Empty; obj.user = Session["user"].ToString().ToUpper(); obj.item = txtItem.Text.ToUpper(); obj.lote = txtLot.Text.ToUpper(); lblResult.Text = string.Empty; DataTable resultado = idal.listaRegistrosOrden_Param(ref obj, ref strError, ref strOrden); if (strError != string.Empty) { txtItem.Text = ""; txtLot.Text = ""; txtItem.Focus(); btnSave.Visible = false; grdRecords.DataSource = ""; grdRecords.DataBind(); lblResult.Text = strError; return; } else { grdRecords.DataSource = resultado; grdRecords.DataBind(); Session["Orden"] = strOrden; Session["Lote"] = txtLot.Text.ToUpperInvariant(); this.HeaderGrid.Visible = true; btnSave.Visible = true; lblResult.Text = ""; } }
protected void btnConsultar_Click(object sender, EventArgs e) { divTable.InnerHtml = String.Empty; if (txtArticulo.Text.Trim().ToUpper() != String.Empty) { Ent_tticol127 dataticol127 = new Ent_tticol127() { user = HttpContext.Current.Session["user"].ToString() }; //_consultaLoteUsuario = _idaltticol127.listaRegistro_ObtieneAlmacen(ref dataticol127, ref strError); //if (_consultaLoteUsuario.Rows.Count > 0) //{ Ent_ttcibd001 data001 = new Ent_ttcibd001() { item = txtArticulo.Text.Trim().ToUpper() }; _consultaItem = _idalttcibd001.listaRegistro_ObtieneDescripcionUnidad(ref data001, ref strError); if (_consultaItem.Rows.Count > 0) { var cwar = string.Empty; //var cwar = _consultaLoteUsuario.Rows[0]["BODEGA"].ToString(); //var cwardesc = _consultaLoteUsuario.Rows[0]["DSCA"].ToString(); var item = txtArticulo.Text.Trim().ToUpper(); var itemdesc = _consultaItem.Rows[0]["DESCRIPCION"].ToString(); var unidad = _consultaItem.Rows[0]["UNID"].ToString(); _consultaInformacion = _idaltwhinr140.consultaPorAlmacenItem(ref item, ref strError); if (_consultaInformacion.Rows.Count > 0) { divTable.InnerHtml = makeTableReceipt(); } else { lblError.Text = String.Format(mensajes("nodata"), cwar, item); return; } } else { lblError.Text = mensajes("itemnotexists"); return; } //} //else //{ // lblError.Text = mensajes("usernotwarehouse"); // return; //} } else { lblError.Text = mensajes("formempty"); return; } }
protected void btnConsultar_Click(object sender, EventArgs e) { lblError.Text = string.Empty; divTable.InnerHtml = String.Empty; if (txtLote.Text.Trim().ToUpper() != String.Empty || txtPallet.Text.Trim().ToUpper() != String.Empty) { Ent_tticol127 dataticol127 = new Ent_tticol127() { user = HttpContext.Current.Session["user"].ToString() }; var lote = txtLote.Text.Trim().ToUpper(); var paid = txtPallet.Text.Trim().ToUpper(); if (txtLote.Text.Trim().ToUpper() != String.Empty) { VerificarExistenciaLote(); } _consultaItem = _idalttisfc001.findByPdnoArticulo(ref lote, ref paid, ref strError); if (_consultaItem.Rows.Count > 0) { //VerificarExistenciaLote(); var cwar = string.Empty; var item = _consultaItem.Rows[0]["MITM"].ToString(); _consultaInformacion = _idaltwhinr140.consultaPorAlmacenItemPallet(ref item, ref lote, ref paid, ref strError); //_idaltwhinr140.consultaPalletPorLot(lote, ref strError); if (_consultaInformacion.Rows.Count > 0) { _consultaCantidadLote = _idaltwhinr140.consultaCantidadItemLote(ref cwar, ref item, ref strError, true); divTable.InnerHtml = makeTableReceipt(); } else { lblError.Text = String.Format(mensajes("nodata"), item); return; } } else { lblError.Text = mensajes("LotPalletnotexists"); return; } } else if (txtPallet.Text.Trim().ToUpper() != String.Empty) { } else { lblError.Text = mensajes("formemptyAny"); return; } }
protected void btnConsultar_Click(object sender, EventArgs e) { divTable.InnerHtml = String.Empty; if (txtUbicacion.Text.Trim().ToUpper() != String.Empty) { Ent_tticol127 dataticol127 = new Ent_tticol127() { user = HttpContext.Current.Session["user"].ToString() }; //_consultaLoteUsuario = _idaltticol127.listaRegistro_ObtieneAlmacen(ref dataticol127, ref strError); //if (_consultaLoteUsuario.Rows.Count > 0) //{ var cwar = string.Empty /*_consultaLoteUsuario.Rows[0]["BODEGA"].ToString()*/; var loca = txtUbicacion.Text.Trim().ToUpper(); _consultaUbicacion = _idaltwhwmd300.validateExistsLocation(ref loca, ref cwar, ref strError); if (_consultaUbicacion.Rows.Count > 0) { //var cwardesc = _consultaLoteUsuario.Rows[0]["DSCA"].ToString(); var locadesc = _consultaUbicacion.Rows[0]["DSCA"].ToString(); _consultaInformacion = _idaltwhinr140.consultaPorAlmacenUbicacion(ref cwar, ref loca, ref strError); if (_consultaInformacion.Rows.Count > 0) { divTable.InnerHtml = makeTableReceipt(); } else { //mMod lblError.Text = String.Format(mensajes("nodata"), cwar, loca); return; } } else { lblError.Text = mensajes("lotnotexists"); return; } //} //else //{ // lblError.Text = mensajes("usernotwarehouse"); // return; //} } else { lblError.Text = mensajes("formempty"); return; } }
public DataTable listaRegistro_ObtieneAlmacen(ref Ent_tticol127 Parametros, ref string strError) { DataTable retorno; try { retorno = dal.listaRegistro_ObtieneAlmacen(ref Parametros, ref strError); return(retorno); } catch (Exception ex) { throw new Exception(ex.InnerException.ToString()); } }
public DataTable listaRegistrosOrden_ParamMRB(ref Ent_tticol127 parametros, ref string strError, ref string strOrden, bool print = false) { //int retorno = -1; DataTable retorno; try { retorno = dal.listaRegistrosOrden_ParamMRB(ref parametros, ref strError, ref strOrden, print); return(retorno); } catch (Exception ex) { throw new Exception(ex.InnerException.ToString()); } }
public List <Ent_tticol127> TraerListaItems() { List <Ent_tticol127> lstItems = new List <Ent_tticol127>(); DataTable DtListaItems = idal127.Lista_Items(); foreach (DataRow row in DtListaItems.Rows) { Ent_tticol127 objTticol127 = new Ent_tticol127(); objTticol127.item = row["item"].ToString().Trim(); objTticol127.kltc = row["kltc"].ToString().Trim(); lstItems.Add(objTticol127); } ListaItemsJSON = JsonConvert.SerializeObject(lstItems); return(lstItems); }
public DataTable listaRegistro_ObtieneAlmacen(ref Ent_tticol127 Parametros, ref string strError) { method = MethodBase.GetCurrentMethod(); paramList = new Dictionary <string, object>(); paramList.Add(":T$USER", Parametros.user.Trim().ToUpperInvariant()); strSQL = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); try { consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSQL, ref parametersOut, null, true); if (consulta.Rows.Count < 1) { strError = "User has not defined the warehouse, please contact the administrator."; } } catch (Exception ex) { strError = "Error to the search sequence [tticol127]. 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 listaRegistrosOrden_ParamMRB(ref Ent_tticol127 ParametrosIn, ref string strError, ref string strOrden, bool print = false) { //strSQL = "SELECT RTRIM(col127.t$cwar) waremrb FROM " + owner + ".tticol127" + env + " col127 " + // "WHERE upper(col127.t$user) = '" + ParametrosIn.user + "'"; //Dictionary<string, object> parametersOut = new Dictionary<string, object>(); try { //consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSQL, ref parametersOut, null, true); //if (consulta.Rows.Count < 1) //{ // strError = "User doesn't have warehouse MRB Setting."; //} //else //{ strwareh = ParametrosIn.cwar.ToUpper(); //Valido el item digitado paramList = new Dictionary <string, object>(); paramList.Add(":T$ITEM", ParametrosIn.item.ToUpper()); //strSQL = // "select ibd001.t$item AS item, ibd001.t$dsca AS descitem, ibd001.t$cuni AS unit, ibd001.t$cwar AS ware, ibd001.t$kltc as mlot, ipu001.t$otbp as proveedor, com100.t$nama as nombre,col020.t$pent AS factorkg " + // " from " + owner + ".ttcibd001" + env + " ibd001 " + // " left join " + owner + ".ttdipu001" + env + " ipu001 on ipu001.t$item = ibd001.t$item " + // " left join " + owner + ".ttccom100" + env + " com100 on com100.t$bpid = ipu001.t$otbp " + // " left join " + owner + ".ttccol020" + env + " col020 on col020.t$item = ibd001.t$item " + // "where trim(ibd001.t$item)=TRIM('" + ParametrosIn.item.ToUpper() + "')"; //"select ibd001.t$item AS item, ibd001.t$dsca AS descitem, ibd001.t$cuni AS unit, ibd001.t$cwar AS ware, ibd001.t$kltc as mlot, ipu001.t$otbp as proveedor, com100.t$nama as nombre,col020.t$pent AS factorkg " + //" from " + owner + ".ttcibd001" + env + " ibd001 " + //" left join BAAN.ttdipu001140 ipu001 on ipu001.t$item = ibd001.t$item " + //" left join BAAN.ttccom100140 com100 on com100.t$bpid = ipu001.t$otbp " + //" left join BAAN.ttccol020140 col020 on col020.t$item = ibd001.t$item " + //"where trim(ibd001.t$item)=TRIM('[:T$ITEM]')" strSQL = recursos.readStatement(method.ReflectedType.Name, "listaRegistrosOrden_ParamMRB", ref owner, ref env, tabla, paramList); consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSQL, ref parametersOut, null, true); if (string.IsNullOrEmpty(consulta.Rows[0]["factorkg"].ToString())) { strError = _textoLabels.readStatement(formName, _idioma, "lblFactorNull"); } if (consulta.Rows.Count < 1) { strError = "Item doesn't Exist in Baan."; } else { if (consulta.Rows[0]["MLOT"].ToString() == "1") { paramList = new Dictionary <string, object>(); paramList.Add(":T$ITEM", ParametrosIn.item.ToUpper()); paramList.Add(":T$CLOT", ParametrosIn.lote.ToUpper()); //Validar el lote digitado //strSQL = "select ltc100.t$clot lot, ltc100.t$orno orden from " + owner + ".twhltc100" + env + " ltc100 " + // "where trim(ltc100.t$item)='" + ParametrosIn.item.ToUpper() + "' " + // "and trim(ltc100.t$clot)='" + ParametrosIn.lote.ToUpper() + "'"; //"select ltc100.t$clot lot, ltc100.t$orno orden from BAAN.twhltc100140 ltc100 " + //"where trim(ltc100.t$item)='[:T$ITEM]' " + //"and trim(ltc100.t$clot)='[:T$CLOT]'" strSQL = recursos.readStatement(method.ReflectedType.Name, "selecttwhltc100", ref owner, ref env, tabla, paramList); consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSQL, ref parametersOut, null, true); if (consulta.Rows.Count < 1) { strError = "Lot doesn't Exist."; } else { strOrden = consulta.Rows[0]["orden"].ToString(); //Validar Cantidad Item, Warehouse, Lot y bodega MRB //strSQL = "select inr140.t$stks stock, inr140.t$cwar warehouse, inr140.t$item item, inr140.t$clot lot, ibd001.t$dsca desci, ibd001.t$cuni unidad, " + // "ipu001.t$otbp proveedor, com100.t$nama nombre " + // "from " + owner + ".twhinr140" + env + " inr140 " + // "inner join " + owner + ".ttcibd001" + env + " ibd001 on ibd001.t$item = inr140.t$item " + // "left join " + owner + ".ttdipu001" + env + " ipu001 on ipu001.t$item = ibd001.t$item " + // "left join " + owner + ".ttccom100" + env + " com100 on com100.t$bpid = ipu001.t$otbp " + // "where trim(inr140.t$item)=trim('" + ParametrosIn.item.ToUpper() + "') " + // "and trim(inr140.t$clot)=trim('" + ParametrosIn.lote.ToUpper() + "') " + // "and trim(inr140.t$cwar) = trim('" + strwareh.ToUpper() + "')"; paramList = new Dictionary <string, object>(); paramList.Add(":T$ITEM", ParametrosIn.item.ToUpper()); paramList.Add(":T$CLOT", ParametrosIn.lote.ToUpper()); paramList.Add(":T$CWAR", strwareh.ToUpper()); //"select inr140.t$stks stock, inr140.t$cwar warehouse, inr140.t$item item, inr140.t$clot lot, ibd001.t$dsca desci, ibd001.t$cuni unidad, " + //"ipu001.t$otbp proveedor, com100.t$nama nombre " + //"from baan.twhinr140140 inr140 " + //"inner join bann.ttcibd001140 ibd001 on ibd001.t$item = inr140.t$item " + //"left join bann.ttdipu001140 ipu001 on ipu001.t$item = ibd001.t$item " + //"left join bann.ttccom100140 com100 on com100.t$bpid = ipu001.t$otbp " + //"where trim(inr140.t$item)=trim('[:T$ITEM]') " + //"and trim(inr140.t$clot)=trim('[:T$CLOT]') " + //"and trim(inr140.t$cwar) = trim('[:T$CWAR]')"; strSQL = recursos.readStatement(method.ReflectedType.Name, "selecttwhinr140", ref owner, ref env, tabla, paramList); consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSQL, ref parametersOut, null, true); if (consulta.Rows.Count < 1) { strError = "Item doesn't have stock on MRB Warehouse."; } } return(consulta); } else { //Validar Cantidad Item, Warehouse y bodega MRB paramList = new Dictionary <string, object>(); paramList.Add(":T$ITEM", ParametrosIn.item.ToUpper()); paramList.Add(":T$CWAR", strwareh.ToUpper()); //strSQL = "select inr140.t$stks stock, inr140.t$cwar warehouse, inr140.t$item item, inr140.t$clot lot, ibd001.t$dsca desci, ibd001.t$cuni unidad, " + // "ipu001.t$otbp proveedor, com100.t$nama nombre " + // "from " + owner + ".twhinr140" + env + " inr140 " + // "inner join " + owner + ".ttcibd001" + env + " ibd001 on ibd001.t$item = inr140.t$item " + // "left join " + owner + ".ttdipu001" + env + " ipu001 on ipu001.t$item = ibd001.t$item " + // "left join " + owner + ".ttccom100" + env + " com100 on com100.t$bpid = ipu001.t$otbp " + // "where trim(inr140.t$item)=trim('" + ParametrosIn.item.ToUpper() + "') " + // "and trim(inr140.t$cwar) = trim('" + strwareh.ToUpper() + "')"; //select inr140.t$stks stock, inr140.t$cwar warehouse, inr140.t$item item, inr140.t$clot lot, ibd001.t$dsca desci, ibd001.t$cuni unidad, //ipu001.t$otbp proveedor, com100.t$nama nombre //from baan.twhinr140140 inr140 //inner join baan.ttcibd001140 ibd001 on ibd001.t$item = inr140.t$item //left join baan.ttdipu001140 ipu001 on ipu001.t$item = ibd001.t$item //left join baan.ttccom100140 com100 on com100.t$bpid = ipu001.t$otbp //where trim(inr140.t$item)=trim('[:T$ITEM]') //and trim(inr140.t$cwar) = trim('[:T$CWAR]') strSQL = recursos.readStatement(method.ReflectedType.Name, "selecttwhinr140el", ref owner, ref env, tabla, paramList); consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSQL, ref parametersOut, null, true); if (consulta.Rows.Count < 1) { strError = "Item doesn't have stock on MRB Warehouse."; } } return(consulta); } //} } catch (Exception ex) { log.escribirError(strError + " - " + ex.Message, stackTrace.GetFrame(2).GetMethod().Name, metodo, method.ReflectedType.Name); }// throw ex; return(consulta); }
protected void btnConsultar_Click(object sender, EventArgs e) { lblConfirm.Text = String.Empty; lblError.Text = String.Empty; if (txtItem.Text.Trim() != String.Empty) { var withLot = true; var consultaInformacion = new DataTable(); var ITEM = txtItem.Text.Trim().ToUpper(); var CLOT = txtNumeroLote.Text.Trim().ToUpper(); Ent_twhltc100 data = new Ent_twhltc100() { item = ITEM, clot = CLOT }; Ent_tticol127 dataticol127 = new Ent_tticol127() { user = HttpContext.Current.Session["user"].ToString() }; var validaAlmacenUsuario = _idaltticol127.listaRegistro_ObtieneAlmacen(ref dataticol127, ref strError); if (validaAlmacenUsuario.Rows.Count < 1) { lblError.Text = mensajes("Usuario no tiene definido el almacen, por favor comuniquese con el administrador."); return; } if (txtNumeroLote.Text.Trim() != String.Empty) { var validaItem = _idaltwhltc100.listaRegistro_Clot(ref data, ref strError); if (validaItem.Rows.Count > 0) { consultaInformacion = _idalttcibd001.findRecordTransfers(ref ITEM, ref withLot, ref strError); } } else { withLot = false; consultaInformacion = _idalttcibd001.findRecordTransfers(ref ITEM, ref withLot, ref strError); } if (consultaInformacion.Rows.Count > 0) { hdfUnidad.Value = consultaInformacion.Rows[0]["CUNI"].ToString(); hdfFactor.Value = consultaInformacion.Rows[0]["CONV"].ToString(); txtSourceLocation.Text = validaAlmacenUsuario.Rows[0]["BODEGA"].ToString(); txtDescription.Text = consultaInformacion.Rows[0]["DSCA"].ToString(); txtNumeroLote.Text = txtNumeroLote.Text.Trim().ToUpper(); txtNumeroLote.Enabled = false; txtItem.Text = txtItem.Text.Trim().ToUpper(); txtItem.Enabled = false; trDescription.Visible = true; trSource.Visible = true; trUbicacion.Visible = true; btnConsultar.Visible = false; btnConsultarSource.Visible = true; } else { txtNumeroLote.Text = txtNumeroLote.Text.Trim().ToUpper(); txtNumeroLote.Enabled = true; txtItem.Text = txtItem.Text.Trim().ToUpper(); txtItem.Enabled = true; trDescription.Visible = false; trSource.Visible = false; trUbicacion.Visible = false; btnConsultar.Visible = true; btnConsultarSource.Visible = false; lblError.Text = withLot ? mensajes("lotitemincorrect") : mensajes("itemincorrect"); return; } } else { lblError.Text = mensajes("itemblank"); return; } }
protected void btnSend_Click(object sender, EventArgs e) { Session["txtItem"] = txtItem.Text.ToUpper(); Session["txtLot"] = string.IsNullOrEmpty(txtLot.Text.ToUpper()) || string.IsNullOrWhiteSpace(txtLot.Text.ToUpper()) ? " " : txtLot.Text.ToUpper(); if (string.IsNullOrEmpty(txtItem.Text.Trim())) { RequiredField.Enabled = true; RequiredField.IsValid = false; txtItem.Focus(); btnSave.Visible = false; grdRecords.DataSource = ""; grdRecords.DataBind(); return; } //if (string.IsNullOrEmpty(txtLot.Text.Trim())) //{ // RequiredFieldLot.Enabled = true; // RequiredFieldLot.IsValid = false; // txtLot.Focus(); // btnSave.Visible = false; // grdRecords.DataSource = ""; // grdRecords.DataBind(); // return; //} // Validar si el usuario tiene almacen MRB asociado //Validar si el Item y Lote digitado son correctos InterfazDAL_tticol127 idal = new InterfazDAL_tticol127(); Ent_tticol127 obj = new Ent_tticol127(); string strError = string.Empty; obj.user = Session["user"].ToString().ToUpper(); obj.item = Session["txtItem"].ToString(); obj.lote = Session["txtLot"].ToString(); lblResult.Text = string.Empty; DataTable resultado = idal.listaRegistrosOrden_Param(ref obj, ref strError, ref strOrden); if (strError != string.Empty) { txtItem.Text = ""; txtLot.Text = ""; txtItem.Focus(); btnSave.Visible = false; grdRecords.DataSource = ""; grdRecords.DataBind(); lblResult.Text = strError.StartsWith("User") ? mensajes("notwarehouseuser") : strError.StartsWith("Lot") ? mensajes("lotnotexists") : strError.StartsWith("Item") && strError.Contains("MRB") ? mensajes("notstockitem") : mensajes("itemnotexists"); return; } else { grdRecords.DataSource = resultado; grdRecords.DataBind(); grdRecords.DataSource = resultado; grdRecords.DataBind(); Session["Orden"] = strOrden; Session["Lote"] = txtLot.Text.ToUpperInvariant(); this.HeaderGrid.Visible = true; //btnSave.Visible = true; lblResult.Text = ""; } txtItem.Text = ""; txtLot.Text = ""; }