Пример #1
0
        public bool insertarRegistro(ref Ent_twhcol122 parametrosIn, ref string strError)
        {
            //int retorno = -1;
            //try
            //{
            return(dal.insertarRegistro(ref parametrosIn, ref strError));

            //}
            //catch (Exception ex)
            //{
            //    throw new Exception(strError += "\nPila: " + ex.Message);
            //}
        }
Пример #2
0
        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);
        }
Пример #3
0
        private List <Ent_ParametrosDAL> AdicionaParametrosComunes(Ent_twhcol122 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.unid.ToUpper());
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$STAT", DbType.String, parametros.logn.ToUpper());
                //Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LOSO", DbType.String, parametros.loso.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);

                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);
        }
Пример #4
0
        protected void btnConfirmPalletLoad_Click(object sender, EventArgs e)
        {
            lblError.Text   = String.Empty;
            lblConfirm.Text = String.Empty;

            if (txtPalletID.Text.Trim() != String.Empty)
            {
                lblError.Text = "";

                var strLocation = txtLocation.Text.Trim().ToUpper();
                var palletId    = txtPalletID.Text.Trim().ToUpper();
                //VALIDAR EL PALLETID CON BODEGA ORIGEN Y DESTINO - 20032019 Javier Castro
                var PALLETID  = txtPalletID.Text.Trim().ToUpper();
                var UNIQUEID  = txtUniqueID.Text.Trim().ToUpper();
                var bodegaori = _sourceWareHouse.Trim().ToUpper();
                var bodegades = _destinationWareHouse.Trim().ToUpper();

                if (strLocation != String.Empty)
                {
                    if (loadLocation == false)
                    {
                        var location = _idaltwhwmd300.validateExistsLocation(ref strLocation, ref _sourceWareHouse, ref strError);

                        if (location.Rows.Count < 1)
                        {
                            lblError.Text    = mensajes("invalidlocation");
                            txtLocation.Text = "";
                            txtLocation.Focus();
                            return;
                        }
                        else
                        {
                            var validateBlocking = location.Rows[0]["BOUT"].ToString();

                            if (validateBlocking == "1")
                            {
                                lblError.Text = mensajes("locationblocked");
                                return;
                            }

                            if (float.Parse(txtQuantity.Text) > float.Parse(hdfQuantity.Value))
                            {
                                lblError.Text = mensajes("quantityhigher");
                                return;
                            }

                            var validatePalletID = _idaltwhcol122.validarRegistroByPalledId(ref PALLETID, ref _UNIQUEID, ref bodegaori, ref bodegades, strError);

                            if (validatePalletID.Rows.Count > 0)
                            {
                                lblError.Text = String.Format(mensajes("palletexist"), validatePalletID.Rows[0]["UNID"]);
                                return;
                            }
                            else
                            {
                                validatePalletID = _idaltwhcol123.validarRegistroByPalletId(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_twhcol122 _datathwcol122 = new Ent_twhcol122()
                            {
                                unid    = txtUniqueID.Text.Trim(),
                                logn    = _operator,
                                loso    = txtLocation.Text.Trim().ToUpper(),
                                paid    = txtPalletID.Text.Trim().ToUpper(),
                                item    = txtItem.Text == String.Empty ? " " : txtItem.Text.ToUpper(),
                                clot    = txtLot.Text.Trim().ToUpper() == String.Empty ? " " : txtLot.Text.Trim().ToUpper(),
                                qtdt    = float.Parse(txtQuantity.Text.Trim().Contains(",") == true ? txtQuantity.Text.Trim().Replace(",", ".") : txtQuantity.Text.Trim().Replace(".", ",")),
                                proc    = 1,
                                mes1    = " ",
                                refcntd = 0,
                                refcntu = 0
                            };

                            var validateSave = _idaltwhcol122.insertarRegistro(ref _datathwcol122, ref strError);

                            if (validateSave)
                            {
                                limpiarCampos();
                                lblConfirm.Text  = String.Format(mensajes("palletconfirm"), txtPalletID.Text.Trim().ToUpper());
                                txtPalletID.Text = "";
                                txtPalletID.Focus();
                                return;
                            }
                            else
                            {
                                lblError.Text = mensajes("errorsave");;
                                return;
                            }
                        }
                    }
                    else
                    {
                        var validatePalletID = _idaltwhcol122.validarRegistroByPalledId(ref PALLETID, ref _UNIQUEID, ref bodegaori, ref bodegades, strError);

                        if (validatePalletID.Rows.Count > 0)
                        {
                            lblError.Text = String.Format(mensajes("palletexist"), validatePalletID.Rows[0]["UNID"]);
                            return;
                        }
                        else
                        {
                            validatePalletID = _idaltwhcol123.validarRegistroByPalletId(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_twhcol122 _datathwcol122 = new Ent_twhcol122()
                        {
                            unid    = txtUniqueID.Text.Trim().ToUpper(),
                            logn    = _operator,
                            loso    = txtLocation.Text.Trim().ToUpper(),
                            paid    = txtPalletID.Text.Trim().ToUpper(),
                            item    = txtItem.Text == String.Empty ? " " : txtItem.Text.ToUpper(),
                            clot    = txtLot.Text.Trim().ToUpper(),
                            qtdt    = float.Parse(txtQuantity.Text.Trim(), CultureInfo.InvariantCulture.NumberFormat),
                            proc    = 1,
                            mes1    = " ",
                            refcntd = 0,
                            refcntu = 0
                        };

                        var validateSave = _idaltwhcol122.insertarRegistro(ref _datathwcol122, ref strError);

                        if (validateSave)
                        {
                            limpiarCampos();
                            lblConfirm.Text  = String.Format(mensajes("palletconfirm"), txtPalletID.Text.Trim().ToUpper());
                            txtPalletID.Text = "";
                            txtPalletID.Focus();
                            return;
                        }
                        else
                        {
                            lblError.Text = mensajes("errorsave");
                            return;
                        }
                    }
                }
                else
                {
                    lblError.Text = mensajes("locationblank");
                    return;
                }
            }
            else
            {
                lblError.Text = mensajes("palletblank");
                return;
            }
        }