public int ActualCant_whcol131(ref Ent_tticol116 parametro, ref string strError) { method = MethodBase.GetCurrentMethod(); bool retorno = false; try { paramList = new Dictionary <string, object>(); paramList.Add(":T$QTYA", parametro.resCant.ToString().Trim().ToUpper()); paramList.Add(":T$SQNB", parametro.paid.Trim().ToUpper()); 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 = ex.InnerException != null ? ex.Message + " (" + ex.InnerException + ")" : ex.Message; } return(Convert.ToInt32(retorno)); }
public int ActualUpdateWarehouse_whcol131(ref Ent_tticol116 parametrosIn, ref string strError) { int retorno = -1; try { retorno = dal.ActualUpdateWarehouse_whcol131(ref parametrosIn, ref strError); return(retorno); } catch (Exception ex) { throw new Exception(strError += "\nPila: " + ex.Message); } }
public int UpdatePalletStatus_ticol022(ref Ent_tticol116 parametrosIn, ref string strError) { int retorno = -1; try { retorno = dal.UpdatePalletStatus_ticol022(ref parametrosIn, ref strError); return(retorno); } catch (Exception ex) { throw new Exception(strError += "\nPila: " + ex.Message); } }
public int insertarRegistro(ref Ent_tticol116 parametrosIn, ref string strError) { int retorno = -1; try { retorno = dal.insertarRegistro(ref parametrosIn, ref strError); return(retorno); } catch (Exception ex) { throw new Exception(strError += "\nPila: " + ex.Message); } }
public int insertarRegistro(ref Ent_tticol116 parametro, ref string strError) { method = MethodBase.GetCurrentMethod(); bool retorno = false; try { paramList = new Dictionary <string, object>(); paramList.Add(":T$ITEM", parametro.item.Trim().ToUpper()); paramList.Add(":T$CWAR", parametro.cwar.Trim().ToUpper()); paramList.Add(":T$LOCA", parametro.loca.Trim().ToUpper()); paramList.Add(":T$CLOT", parametro.clot.Trim().ToUpper()); paramList.Add(":T$QTYR", parametro.qtyr.ToString().Replace(',', '.')); paramList.Add(":T$CDIS", parametro.cdis.Trim().ToUpper()); paramList.Add(":T$OBSE", parametro.obse.Trim().ToUpper()); paramList.Add(":T$LOGR", parametro.logr.Trim().ToUpper()); paramList.Add(":T$DISP", parametro.disp); paramList.Add(":T$PROC", parametro.proc); paramList.Add(":T$MESS", parametro.mess.Trim().ToUpper()); paramList.Add(":T$SUNO", parametro.suno.Trim().ToUpper()); paramList.Add(":T$CWAM", parametro.cwam.Trim().ToUpper()); paramList.Add(":T$PAID", parametro.paid.Trim().ToUpper()); paramList.Add(":T$PAIO", parametro.paio.Trim().ToUpper() == String.Empty ? " " : parametro.paio.Trim().ToUpper()); paramList.Add(":T$REFCNTD", 0); paramList.Add(":T$REFCNTU", 0); 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; } return(Convert.ToInt32(retorno)); }
private List <Ent_ParametrosDAL> AdicionaParametrosComunes(Ent_tticol116 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$ITEM", DbType.String, parametros.item.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CWAR", DbType.String, parametros.cwar.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LOCA", DbType.String, parametros.loca.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CLOT", DbType.String, parametros.clot.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$QTYR", DbType.Decimal, parametros.qtyr); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CDIS", DbType.String, parametros.cdis.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$OBSE", DbType.String, parametros.obse); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LOGR", DbType.String, parametros.logr.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$DISP", DbType.Int32, parametros.disp); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$PROC", DbType.Int32, parametros.proc); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$MESS", DbType.String, parametros.mess); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$SUNO", DbType.String, parametros.suno); 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$PAID", DbType.String, parametros.paid); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$PAIO", DbType.String, parametros.paio); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CWAM", DbType.String, parametros.cwam); 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 Ent_tticol116 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; } return(Convert.ToInt32(retorno)); }
protected void btnGuardar_Click(object sender, EventArgs e) { lblError.Text = String.Empty; var item = txtItem.Text.Trim().ToUpper(); var warehouse = txtWarehouse.Text.Trim().ToUpper(); var location = txtLocation.Text.Trim().ToUpper(); var lot = Session["Lot"].ToString().ToUpper(); var cantidad = Convert.ToDouble(Request.Form["txtQuantity"].ToString().Trim(), CultureInfo.InvariantCulture.NumberFormat); var cdis = Request.Form["slReasons"].ToString().Trim(); var obse = Request.Form["txtComments"].ToString().Trim(); var VariableAuxSuno = Request.Form["txtSupplier"].ToString().Trim(); var suno = string.IsNullOrEmpty(VariableAuxSuno) ? string.Empty : Request.Form["txtSupplier"].ToString().Trim(); var reasondesc = Request.Form["lblReasonDesc"]; if (lot == string.Empty) { lblError.Text = Thelotcantbeempty; return; } if (reasondesc == null) { reasondesc = "Adhesion"; } if (cantidad > Convert.ToDouble(_stock, CultureInfo.InvariantCulture.NumberFormat)) { lblError.Text = mensajes("quantexceed"); return; } Ent_twhwmd300 data = new Ent_twhwmd300() { loca = location }; var validaLocation = _idaltwhwmd300.listaRegistro_ObtieneAlmacen(ref data, ref strError); if (txSloc.Value.ToString().Trim() == "1") { if (validaLocation.Rows.Count > 0) { if (Convert.ToInt32(validaLocation.Rows[0]["LOCT"]) != 5) { lblError.Text = mensajes("bulklocation"); return; } } else { lblError.Text = mensajes("locationnotexists"); return; } } var validarRegistro = _idaltticol116.findRecordByWarehouseItemLocation(ref item, ref warehouse, ref location, ref strError); if (validarRegistro.Rows.Count > 0) { //var validarUpdate = _idaltticol116.updateRecordRejectedWarehouse(ref item, ref warehouse, ref location, ref cantidad, ref strError); Ent_tticol116 data116 = new Ent_tticol116() { item = item, cwar = warehouse, loca = location == String.Empty ? " " : location, clot = lot == String.Empty ? " " : lot, qtyr = Convert.ToDouble(cantidad), cdis = cdis, obse = obse == String.Empty ? " " : obse, logr = HttpContext.Current.Session["user"].ToString(), suno = suno == String.Empty ? " " : suno }; var validInsertaux = _idaltticol116.insertarRegistro(ref data116, ref strError); if (validInsertaux > 0) { lblError.Text = String.Empty; lblConfirm.Text = mensajes("msjupdate"); divTable.InnerHtml = String.Empty; divBtnGuardar.Visible = false; txtItem.Text = String.Empty; txtWarehouse.Text = String.Empty; txtLocation.Text = String.Empty; txtLot.Text = String.Empty; var rutaServ = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + item.Trim().ToUpper() + "&code=Code128&dpi=96"; imgCodeItem.Src = !string.IsNullOrEmpty(item) ? rutaServ : ""; var rutaServQty = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + cantidad.ToString().Trim().ToUpper() + "&code=Code128&dpi=96"; imgQty.Src = !string.IsNullOrEmpty(cantidad.ToString()) ? rutaServQty : ""; lblValueDescription.Text = hdfDescItem.Value; lblDescRejectQty.Text = String.Concat(_textoLabels.readStatement(formName, _idioma, "lblRejectedQty"), " ", cantidad); lblDescPrintedBy.Text = String.Concat(_textoLabels.readStatement(formName, _idioma, "lblPrintedBy"), " ", HttpContext.Current.Session["user"].ToString()); lblValueLot.Text = String.Concat(_textoLabels.readStatement(formName, _idioma, "lblDescLot"), " ", lot); lblComments.Text = String.Concat(_textoLabels.readStatement(formName, _idioma, "lblDescComments"), " ", obse); lblValueReason.Text = reasondesc; divLabel.Visible = true; divBotones.Visible = true; } else { lblError.Text = mensajes("errorupdt"); return; } } else { Ent_tticol116 data116 = new Ent_tticol116() { item = item, cwar = warehouse, loca = location == String.Empty ? " " : location, clot = lot == String.Empty ? " " : lot, qtyr = cantidad, cdis = cdis, obse = obse == String.Empty ? " " : obse, logr = HttpContext.Current.Session["user"].ToString(), suno = suno == String.Empty ? " " : suno }; var validInsert = _idaltticol116.insertarRegistro(ref data116, ref strError); if (validInsert > 0) { lblError.Text = String.Empty; lblConfirm.Text = mensajes("msjsave"); divTable.InnerHtml = String.Empty; divBtnGuardar.Visible = false; txtItem.Text = String.Empty; txtWarehouse.Text = String.Empty; txtLocation.Text = String.Empty; txtLot.Text = String.Empty; var rutaServ = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + item.Trim().ToUpper() + "&code=Code128&dpi=96"; imgCodeItem.Src = !string.IsNullOrEmpty(item) ? rutaServ : ""; var rutaServQty = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + cantidad.ToString().Trim().ToUpper() + "&code=Code128&dpi=96"; imgQty.Src = !string.IsNullOrEmpty(cantidad.ToString()) ? rutaServQty : ""; lblValueDescription.Text = hdfDescItem.Value; lblDescRejectQty.Text = String.Concat(_textoLabels.readStatement(formName, _idioma, "lblRejectedQty"), " ", cantidad); lblDescPrintedBy.Text = String.Concat(_textoLabels.readStatement(formName, _idioma, "lblPrintedBy"), " ", HttpContext.Current.Session["user"].ToString()); lblValueLot.Text = String.Concat(_textoLabels.readStatement(formName, _idioma, "lblDescLot"), " ", lot); lblComments.Text = String.Concat(_textoLabels.readStatement(formName, _idioma, "lblDescComments"), " ", obse); lblValueReason.Text = reasondesc; divLabel.Visible = true; divBotones.Visible = true; } else { lblError.Text = mensajes("errorsave"); return; } } }