public int insertarRegistro(ref Ent_twhcol124 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); } }
private List <Ent_ParametrosDAL> AdicionaParametrosComunes(Ent_twhcol124 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$UNID", DbType.String, parametros.unid.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LOGN", DbType.String, parametros.logn.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$PAID", DbType.String, parametros.paid.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$ITEM", DbType.String, parametros.item.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CLOT", DbType.String, parametros.clot.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$QTDT", DbType.Double, parametros.qtdt); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$PROC", DbType.Int32, parametros.proc); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$MES1", DbType.String, parametros.mes1); 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$LOCA", DbType.String, parametros.loca.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LOCS", DbType.Int32, parametros.locs); 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_twhcol124 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 btnConfirmPalletReceive_Click(object sender, EventArgs e) { lblError.Text = String.Empty; lblConfirm.Text = String.Empty; if (txtPalletID.Text.Trim() != String.Empty) { var palletId = txtPalletID.Text.Trim().ToUpper(); if (float.Parse(txtQuantity.Text) > float.Parse(hdfQuantity.Value)) { lblError.Text = mensajes("quantityhigher"); return; } var buscadatosbodega = new DataTable(); buscadatosbodega = _idaltwhcol122.buscarbodegasuid(ref _UNIQUEID, ref strError); var bodegaori = buscadatosbodega.Rows[0]["WARORI"].ToString(); var bodegades = buscadatosbodega.Rows[0]["WARDES"].ToString(); var validatePalletID = _idaltwhcol124.validateExistsPalletId(ref palletId, ref _UNIQUEID, ref bodegaori, ref bodegades, ref strError); if (validatePalletID.Rows.Count > 0) { lblError.Text = String.Format(mensajes("palletexist"), validatePalletID.Rows[0]["UNID"]); return; } else { validatePalletID = _idaltwhcol125.validateExistsPalletId(ref palletId, ref _UNIQUEID, ref bodegaori, ref bodegades, ref strError); if (validatePalletID.Rows.Count > 0) { lblError.Text = String.Format(mensajes("palletexist"), validatePalletID.Rows[0]["UNID"]); return; } } Ent_twhcol124 datawhcol124 = new Ent_twhcol124() { unid = txtUniqueID.Text.Trim().ToUpper(), logn = _operator, paid = txtPalletID.Text.Trim().ToUpper(), item = txtItem.Text == String.Empty ? " " : txtItem.Text.ToUpper(), clot = txtLot.Text.Trim(), qtdt = float.Parse(txtQuantity.Text.Trim(), CultureInfo.InvariantCulture.NumberFormat), proc = 1, mes1 = " ", refcntd = 0, refcntu = 0 }; var validateSave = _idaltwhcol124.insertarRegistro(ref datawhcol124, ref strError); if (validateSave > 0) { limpiarCampos(); lblConfirm.Text = String.Format(mensajes("palletsavedrec"), txtPalletID.Text.Trim().ToUpper()); txtPalletID.Text = ""; txtPalletID.Focus(); return; } else { lblError.Text = mensajes("errorsave"); return; } } else { lblError.Text = mensajes("palletblank"); return; } }