Example #1
0
        public DataTable invRegrid_Indentifier(ref Ent_tticol118 Parametros, ref string strError)
        {
            string strSentenciaS = string.Empty;
            string strPaid       = Parametros.paid.Trim().ToUpperInvariant();
            string strDisp       = Parametros.disp.ToString();

            Dictionary <string, object> parametersOut = new Dictionary <string, object>();
            Dictionary <string, object> paramList     = new Dictionary <string, object>();

            paramList.Add(":T$PAID", strPaid);
            paramList.Add(":T$DISP", strDisp);

            strSentenciaS = recursos.readStatement(method.ReflectedType.Name, "invRegrid_Indentifier", ref owner, ref env, tabla, paramList);

            //strSentenciaS = "select count(*) cnt from " + owner + ".tticol118" + env + " WHERE T$PAID= '"+ strPaid +"' and T$DISP ="+strDisp +" ";
            //select count(*) cnt from BAAN.tticol118140 WHERE T$PAID= '[:T$PAID]' and T$DISP = '[:T$DISP]';

            try
            {
                consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentenciaS, ref parametersOut, null, true);
            }
            catch (Exception ex)
            {
                strError = "Error al buscar informacion para imprimir [tticol118]. Try again or contact your administrator \n " + strSentencia;
                log.escribirError(strError + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(consulta);
        }
Example #2
0
        public DataTable ListaProveedoresProducto(ref Ent_tticol118 ParametrosIn, ref string strError)
        {
            Dictionary <string, object> paramList = new Dictionary <string, object>();

            paramList.Add(":T$ITEM", ParametrosIn.item.Trim());

            strSentencia = recursos.readStatement(method.ReflectedType.Name, "ListaProveedoresProducto", ref owner, ref env, tabla, paramList);

            //strSentencia = "select com100.T$BPID proveedor, com100.T$NAMA nombre from " + owner + ".ttccom100" + env + " com100 INNER JOIN " + owner + ".ttdipu010" + env + "  dipu0101 ON  dipu0101.T$OTBP = com100.T$BPID WHERE Trim(dipu0101.T$ITEM) = Trim('" + ParametrosIn.item.Trim() + "')";
            //select com100.T$BPID proveedor, com100.T$NAMA nombre from baan.ttccom100140 com100
            //INNER JOIN baan.ttdipu010140  dipu0101 ON  dipu0101.T$OTBP = com100.T$BPID
            //WHERE Trim(dipu0101.T$ITEM) = Trim('[:T$ITEM]')


            try
            {
                consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true);
                if (consulta.Rows.Count < 1)
                {
                    strError = "Data " + ParametrosIn.item.Trim() + " " + ParametrosIn.clot.Trim() + " not found";
                }
            }
            catch (Exception ex)
            {
                strError = "Error when querying data [tdipu001]. Try again or contact your administrator \n " + strSentencia;
                log.escribirError(strError + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(consulta);
        }
Example #3
0
        protected void printLabel_Click(object sender, EventArgs e)
        {
            InterfazDAL_tticol118 idal = new InterfazDAL_tticol118();
            Ent_tticol118         obj  = new Ent_tticol118();
            string strError            = string.Empty;

            obj.item       = txtItem.Text;
            obj.clot       = txtLot.Text;
            lblResult.Text = string.Empty;
            DataTable resultado = idal.listaRegistros_Param(ref obj, ref strError);

            Session["resultado"] = resultado;
            StringBuilder paramurl = new StringBuilder();

            paramurl.Append("?");
            paramurl.Append("valor1=" + Request.QueryString[0].ToString() + "&");
            paramurl.Append("valor2=" + Request.QueryString[1].ToString() + "&");
            paramurl.Append("valor3=" + Request.QueryString[2].ToString());
            Session["IsPreviousPage"] = "";

            StringBuilder script = new StringBuilder();

            script.Append("ventanaImp = window.open('../Labels/whInvLabelMaterialRejectedD.aspx', ");
            script.Append("'ventanaImp', 'menubar=0,resizable=0,width=580,height=450');");
            script.Append("ventanaImp.moveTo(30, 0);");
            //script.Append("setTimeout (ventanaImp.close(), 20000);");
            ScriptManager.RegisterStartupScript(this, this.GetType(), "printTag", script.ToString(), true);
        }
Example #4
0
        public int UpdatePalletStatus_ticol022(ref Ent_tticol118 parametro, ref string strError)
        {
            method = MethodBase.GetCurrentMethod();
            bool retorno = false;

            try
            {
                paramList = new Dictionary <string, object>();
                paramList.Add(":T$DELE", "3");
                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));
        }
Example #5
0
        public DataTable findRecordByItemClotCwarQtyr(ref Ent_tticol118 data, ref string strError)
        {
            method = MethodBase.GetCurrentMethod();

            paramList = new Dictionary <string, object>();
            paramList.Add(":T$CLOT", data.clot.Trim().ToUpper());
            paramList.Add(":T$ITEM", data.item.Trim().ToUpper());
            paramList.Add(":T$CWAR", data.cwar.Trim().ToUpper());
            paramList.Add(":T$QTYR", data.qtyr);

            strSentencia = recursos.readStatement(method.ReflectedType.Name.Split('_')[0], 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 [tticol118_2]. 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);
        }
Example #6
0
        public DataTable listaRegistros_Param(ref Ent_tticol118 ParametrosIn, ref string strError)
        {
            Dictionary <string, object> paramList = new Dictionary <string, object>();

            paramList.Add(":T$ITEM", ParametrosIn.item.Trim());
            paramList.Add(":T$CLOT", ParametrosIn.clot.ToUpper());

            strSentencia = recursos.readStatement(method.ReflectedType.Name, "selectticol118", ref owner, ref env, tabla, paramList);

            //strSentencia = "SELECT * FROM (SELECT T$ITEM, T$CWAR, T$CLOT, T$QTYR, T$CDIS, T$OBSE, T$LOGR, T$DATR, T$DISP, T$STOC, T$RITM, T$PROC, T$MESS, T$SUNO,T$PAID " +
            //               "FROM " + owner + ".tticol118" + env + " col118 " +
            //               "WHERE trim(col118.t$item) ='" + ParametrosIn.item.Trim() + "' " +
            //               "AND upper(col118.t$clot) = '" + ParametrosIn.clot.ToUpper() + "' order by T$DATR DESC) WHERE ROWNUM = 1";

            //SELECT * FROM (SELECT T$ITEM, T$CWAR, T$CLOT, T$QTYR, T$CDIS, T$OBSE, T$LOGR, T$DATR, T$DISP, T$STOC, T$RITM, T$PROC, T$MESS, T$SUNO,T$PAID
            //FROM BAAN.tticol118140 col118
            //WHERE trim(col118.t$item) ='[:T$ITEM]'
            //AND upper(col118.t$clot) = '[:T$CLOT]' order by T$DATR DESC) WHERE ROWNUM = 1


            try
            {
                consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true);
                if (consulta.Rows.Count < 1)
                {
                    strError = "Data " + ParametrosIn.item.Trim() + " " + ParametrosIn.clot.Trim() + " not found";
                }
            }
            catch (Exception ex)
            {
                strError = "Error when querying data [tticol118]. Try again or contact your administrator \n " + strSentencia;
                log.escribirError(strError + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(consulta);
        }
Example #7
0
        public DataTable listaProveedores_ParamMRB(ref Ent_tticol118 ParametrosIn, ref string strError)
        {
            //strSentencia = "select ipu010.t$otbp proveedor, com100.t$nama nombre from " + owner + ".ttdipu010" + env + " ipu010 " +
            //               "inner join " + owner + ".ttccom100" + env + " com100 on ipu010.t$otbp = com100.t$bpid " +
            //               "where trim(ipu010.t$item) like '%" + ParametrosIn.item.Trim() + "%'";


            //select ipu010.t$otbp proveedor, com100.t$nama nombre from baan.ttdipu010140 ipu010
            //inner join baan.ttccom100140 com100 on ipu010.t$otbp = com100.t$bpid
            //where trim(ipu010.t$item) like '%[:T$ITEM]%'

            Dictionary <string, object> paramList = new Dictionary <string, object>();

            paramList.Add(":T$ITEM", ParametrosIn.item.Trim());

            strSentencia = recursos.readStatement(method.ReflectedType.Name, "listaProveedores_ParamMRB", ref owner, ref env, tabla, paramList);

            //ipu010.t$otbp, com100.t$nama

            try
            {
                consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true);
                if (consulta.Rows.Count < 1)
                {
                    strError = "Data " + ParametrosIn.item.Trim() + " " + ParametrosIn.clot.Trim() + " not found";
                }
            }
            catch (Exception ex)
            {
                strError = "Error when querying data [tdipu001]. Try again or contact your administrator \n " + strSentencia;
                log.escribirError(strError + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(consulta);
        }
Example #8
0
        public DataTable invLabel_registroImprimir_Param(ref Ent_tticol118 Parametros, ref string strError)
        {
            string strSentenciaS = string.Empty;
            string strLote       = Parametros.clot.Trim().ToUpperInvariant();
            string strBodega     = Parametros.cwar.Trim().ToUpperInvariant();
            string strItem       = Parametros.item.Trim();

            Dictionary <string, object> parametersOut = new Dictionary <string, object>();

            //strSentenciaS = "select * from (select case trim(col118.t$ritm) when 'NA' then trim(col118.t$item) else trim(col118.t$ritm) end item, trim(ibd001.t$dsca) desci, trim(ibd001.t$cuni) unidad, col118.t$qtyr cantidad, " +
            //               " col118.t$clot lote, mcs005.t$dsca descr, substr(col118.t$obse,1,255) comentario, col020.t$pent factorkg, col118.t$datr-5/24 fecha, trim(col118.T$PAID) paid, col008.t$wreg wreg " +
            //               " from " + owner + ".tticol118" + env + " col118 " +
            //               " inner join " + owner + ".ttcibd001" + env + " ibd001 on ibd001.t$item = col118.t$item " +
            //               " left join " + owner + ".ttcibd001" + env + " dbi001 on dbi001.t$item = col118.t$ritm " +
            //               " inner join " + owner + ".ttccol020" + env + " col020 on col020.t$item = col118.t$item " +
            //               " inner join " + owner + ".ttcmcs005" + env + " mcs005 on mcs005.t$cdis = col118.t$cdis " +
            //               " inner join " + owner + ".tticol008" + env + " col008 on col008.t$wmrb = col118.t$cwar " +
            //               " where trim(col118.t$item)=trim('" + strItem + "')" +
            //               " and upper(col118.t$clot)='" + (strLote == "" ? " " : strLote) + "'" +
            //               " and col118.t$cwar='" + strBodega + "' order by col118.T$DATR DESC)where rownum = 1";


            Dictionary <string, object> paramList = new Dictionary <string, object>();

            paramList.Add(":T$ITEM", strItem);
            paramList.Add(":T$CLOT", strLote == "" ? " " : strLote);
            paramList.Add(":T$CWAR", strBodega);

            strSentenciaS = recursos.readStatement(method.ReflectedType.Name, "invLabel_registroImprimir_Param", ref owner, ref env, tabla, paramList);

            //select * from (select case trim(col118.t$ritm) when 'NA' then trim(col118.t$item) else trim(col118.t$ritm) end item, trim(ibd001.t$dsca) desci, trim(ibd001.t$cuni) unidad, col118.t$qtyr cantidad, " +
            //col118.t$clot lote, mcs005.t$dsca descr, substr(col118.t$obse,1,255) comentario, col020.t$pent factorkg, col118.t$datr-5/24 fecha, trim(col118.T$PAID) paid, col008.t$wreg wreg " +
            //from baan.tticol118140 col118
            //inner join baan.ttcibd001140 ibd001 on ibd001.t$item = col118.t$item
            //left join baan.ttcibd001140 dbi001 on dbi001.t$item = col118.t$ritm
            //inner join baan.ttccol020140 col020 on col020.t$item = col118.t$item
            //inner join baan.ttcmcs005140 mcs005 on mcs005.t$cdis = col118.t$cdis
            //inner join baan.tticol008140 col008 on col008.t$wmrb = col118.t$cwar
            //where trim(col118.t$item)=trim('[:T$ITEM]')
            //and upper(col118.t$clot)='[:T$CLOT"]'
            //and col118.t$cwar='[::T$CWAR]' order by col118.T$DATR DESC)where rownum = 1

            try
            {
                consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentenciaS, ref parametersOut, null, true);
            }
            catch (Exception ex)
            {
                strError = "Error al buscar informacion para imprimir [tticol118]. Try again or contact your administrator \n " + strSentencia;
                log.escribirError(strError + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(consulta);
        }
        protected void btnConsultar_Click(object sender, EventArgs e)
        {
            var item = txtItem.Text.Trim().ToUpper();
            var lot  = txtLot.Text.Trim().ToUpper();
            var cwar = txtWarehouse.Text.Trim().ToUpper();
            var qtyr = txtQuantity.Text.Trim().ToUpper();

            if (item == String.Empty || lot == String.Empty || cwar == String.Empty || qtyr == String.Empty)
            {
                lblError.Text = mensajes("formempty");
                return;
            }

            Ent_tticol118 data118 = new Ent_tticol118()
            {
                item = item,
                clot = lot,
                cwar = cwar,
                qtyr = Convert.ToInt32(qtyr)
            };

            var consultaInformacion = _idaltticol118.findRecordByItemClotCwarQtyr(ref data118, ref strError);

            if (consultaInformacion.Rows.Count > 0)
            {
                //imgItem
                var rutaServItem = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + item.ToUpper() + "&code=Code128&dpi=96";
                imgItem.Src = !string.IsNullOrEmpty(item) ? rutaServItem : "";

                lblItemTab.Text = consultaInformacion.Rows[0]["DSCA"].ToString().Trim().ToUpper();

                //imgItem
                var rutaServQuant = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + qtyr.ToUpper() + "&code=Code128&dpi=96";
                imgTotalQyt.Src = !string.IsNullOrEmpty(item) ? rutaServQuant : "";

                lblValueTotalQty.Text = qtyr;
                lblValueUnit.Text     = consultaInformacion.Rows[0]["CUNI"].ToString().Trim().ToUpper();

                lblValuePrintedBy.Text = HttpContext.Current.Session["user"].ToString();
                lblValueDate.Text      = DateTime.Now.ToString();

                divTable.Visible   = true;
                divBotones.Visible = true;
                lblError.Text      = String.Empty;
                lblConfirm.Text    = String.Empty;
            }
            else
            {
                lblError.Text = mensajes("Order doesn't register to MRB.");
                return;
            }
        }
Example #10
0
        public DataTable ListaProveedoresProducto(ref Ent_tticol118 ParametrosIn, ref string strError)
        {
            DataTable retorno;

            try
            {
                retorno = dal.ListaProveedoresProducto(ref ParametrosIn, ref strError);
                return(retorno);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.InnerException.ToString());
            }
        }
Example #11
0
        public DataTable listaRegistros_Param(ref Ent_tticol118 ParametrosIn, ref string strError)
        {
            DataTable retorno;

            try
            {
                retorno = dal.listaRegistros_Param(ref ParametrosIn, ref strError);
                return(retorno);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.InnerException.ToString());
            }
        }
Example #12
0
        public int UpdatePalletStatus_ticol022(ref Ent_tticol118 parametrosIn, ref string strError)
        {
            int retorno = -1;

            try
            {
                retorno = dal2.UpdatePalletStatus_ticol022(ref parametrosIn, ref strError);
                return(retorno);
            }
            catch (Exception ex)
            {
                throw new Exception(strError += "\nPila: " + ex.Message);
            }
        }
Example #13
0
        public DataTable findRecordByItemClotCwarQtyr(ref Ent_tticol118 data, ref string strError)
        {
            DataTable retorno = new DataTable();

            try
            {
                retorno = dal2.findRecordByItemClotCwarQtyr(ref data, ref strError);
                return(retorno);
            }
            catch (Exception ex)
            {
                throw new Exception(strError += "\nPila: " + ex.Message);
            }
        }
Example #14
0
        public DataTable invLabel_registroImprimir_Param(ref Ent_tticol118 Parametros, ref string strError)
        {
            DataTable retorno;

            try
            {
                retorno = dal.invLabel_registroImprimir_Param(ref Parametros, ref strError);
                return(retorno);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.InnerException.ToString());
            }
        }
Example #15
0
        public DataTable invRegrid_Indentifier(ref Ent_tticol118 Parametros, ref string strError)
        {
            DataTable retorno;

            try
            {
                retorno = dal.invRegrid_Indentifier(ref Parametros, ref strError);
                return(retorno);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.InnerException.ToString());
            }
        }
Example #16
0
        private List <Ent_ParametrosDAL> AdicionaParametrosComunes(Ent_tticol118 parametros, bool blnUsarPRetorno = false)
        {
            string param = string.Empty;
            List <Ent_ParametrosDAL> parameterCollection = new List <Ent_ParametrosDAL>();

            try
            {
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$ITEM", DbType.String, parametros.item);
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CWAR", DbType.String, parametros.cwar);
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CLOT", DbType.String, parametros.clot);
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$QTYR", DbType.Double, parametros.qtyr);
                //Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$DQTYR", DbType.Decimal, parametros.dqtyr);
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CDIS", DbType.String, parametros.cdis);
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$OBSE", DbType.String, parametros.obse);
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LOGR", DbType.String, parametros.logr);
                //Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$DATR", DbType.String, parametros.datr);
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$DISP", DbType.Int32, parametros.disp);
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$STOC", DbType.String, parametros.stoc);
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$RITM", DbType.String, parametros.ritm);
                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$PLLD", DbType.String, parametros.plld);

                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);
        }
Example #17
0
        public DataTable inv_datospesos(ref Ent_tticol118 Parametros, ref string strError)
        {
            string strSentenciaS = string.Empty;
            string strLote       = Parametros.clot.Trim().ToUpperInvariant();
            string strBodega     = Parametros.cwar.Trim().ToUpperInvariant();
            string strItem       = Parametros.item.Trim();

            Dictionary <string, object> parametersOut = new Dictionary <string, object>();
            Dictionary <string, object> paramList     = new Dictionary <string, object>();

            paramList.Add(":T$ITEM", strItem);
            paramList.Add(":T$CLOT", strLote == "" ? " " : strLote);
            paramList.Add(":T$CWAR", strBodega);

            strSentenciaS = recursos.readStatement(method.ReflectedType.Name, "invLabel_registroImprimir_Param2", ref owner, ref env, tabla, paramList);


            //strSentenciaS =  "select trim(ibd001.t$item), col020.t$pent factorkg, col008.t$wreg wreg " +
            //                "from " + owner + ".ttcibd001" + env + "  ibd001 " +
            //                "inner join " + owner + ".ttccol020" + env + "  col020 on col020.t$item = ibd001.t$item " +
            //                "inner join " + owner + ".tticol008" + env + "  col008 on col008.t$wmrb = '" + strBodega + "' " +
            //                "where trim(ibd001.t$item)=trim('" + strItem + "')";

            //select trim(ibd001.t$item), col020.t$pent factorkg, col008.t$wreg wreg
            //from baan.ttcibd001140  ibd001
            //inner join baan.ttccol020140  col020 on col020.t$item = ibd001.t$item
            //inner join baan.tticol008140  col008 on col008.t$wmrb = '[:T$CWAR]'
            //where trim(ibd001.t$item)=trim('[::T$ITEM]')

            try
            {
                consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentenciaS, ref parametersOut, null, true);
            }
            catch (Exception ex)
            {
                strError = "Error al buscar informacion para imprimir [ttcibd001]. Try again or contact your administrator \n " + strSentencia;
                log.escribirError(strError + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(consulta);
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            List <Ent_tticol118> parameterCollection = new List <Ent_tticol118>();
            Ent_tticol118        obj = new Ent_tticol118();
            //Recorrer filas con valores en los textos
            string disposition = String.Empty;
            string reason      = String.Empty;
            string stockw      = String.Empty;
            string orden       = String.Empty;

            //var Regrind;

            foreach (GridViewRow row in grdRecords.Rows)
            {
                string toreturn = ((TextBox)row.Cells[7].FindControl("toReturn")).Text;
                string lote     = ((TextBox)row.Cells[7].FindControl("toReturn")).Text;
                reason      = ((DropDownList)row.Cells[9].FindControl("Reasonid")).SelectedValue;
                disposition = ((DropDownList)row.Cells[8].FindControl("Dispoid")).SelectedValue;
                stockw      = ((DropDownList)grdRecords.Rows[0].Cells[1].FindControl("Stockwareh")).SelectedValue;
                DataTable DTMyRegrind = new DataTable();
                Session["MyRegrind"] = ((DropDownList)grdRecords.Rows[0].Cells[1].FindControl("Regrind")).SelectedValue.ToString().Trim();
                if (stockw == String.Empty)
                {
                    stockw = "NA";
                }
                string regrind = ((DropDownList)grdRecords.Rows[0].Cells[2].FindControl("Regrind")).SelectedValue;
                if (regrind == String.Empty)
                {
                    regrind = "NA";
                }
                string obse = ((TextBox)grdRecords.Rows[0].Cells[3].FindControl("Comments")).Text;
                if (obse.Length > 255)
                {
                    obse = ((TextBox)grdRecords.Rows[0].Cells[3].FindControl("Comments")).Text.Substring(1, 255);
                }
                string supplier = ((DropDownList)grdRecords.Rows[0].Cells[0].FindControl("Supplier")).SelectedValue;
                if (supplier == string.Empty)
                {
                    supplier = " ";
                }
                if (Session["Lote"].ToString() == "" || Session["Lote"].ToString() == " ")
                {
                    Session["Lote"] = " ";
                }

                if (!toreturn.Equals(string.Empty))
                {
                    obj      = new Ent_tticol118();
                    obj.item = Session["txtItem"].ToString().Trim().ToUpperInvariant();
                    obj.cwar = row.Cells[2].Text.ToUpperInvariant();
                    //obj.clot = row.Cells[3].Text.ToUpperInvariant();
                    obj.clot    = Session["Lote"].ToString();
                    obj.qtyr    = Double.Parse(toreturn, System.Globalization.CultureInfo.InvariantCulture);//Convert.ToDecimal(toreturn);
                    obj.cdis    = reason;
                    obj.obse    = obse;
                    obj.logr    = Session["user"].ToString();
                    obj.disp    = Convert.ToInt32(disposition);
                    obj.stoc    = stockw;
                    obj.ritm    = regrind;
                    obj.proc    = 2;
                    obj.mess    = " ";
                    obj.suno    = supplier;
                    obj.refcntd = 0;
                    obj.refcntu = 0;
                    parameterCollection.Add(obj);
                }
            }



            InterfazDAL_tticol118 idal = new InterfazDAL_tticol118();

            //int actualizar = idal.actualizarRegistro_Param(ref parameterCollection, ref strError);
            //if (actualizar < 1)

            if (string.IsNullOrEmpty(reason) || string.IsNullOrWhiteSpace(reason))
            {
                corregible = true;
                strError   = _textoLabels.readStatement(formName, _idioma, "lblReasoNull");
            }
            else
            {
                idal.insertarRegistro(ref parameterCollection, ref strError);
            }



            if (strError != string.Empty)
            {
                lblResult.Text = mensajes("errorsave");
            }
            else
            {
                printResult.Visible = true;
                if (Convert.ToInt32(disposition) == 4 || Convert.ToInt32(disposition) == 5)
                {
                    DataTable resultado = idal.invLabel_registroImprimir_Param(ref obj, ref strError);
                    resultado.Columns.Add("USER", typeof(String));
                    DataRow reg = resultado.Rows[0];
                    resultado.Rows[0]["USER"] = Session["user"].ToString().ToUpper();
                    Session["FilaImprimir"]   = reg;
                    //printLabel.Visible = true;
                }
                lblResult.Text          = strError;
                lblResult.Text          = mensajes("msjupdt");
                this.HeaderGrid.Visible = false;
            }

            if (corregible == false)
            {
                grdRecords.DataSource = "";
                grdRecords.DataBind();
                grdRecords.DataSource = "";
                grdRecords.DataBind();
            }

            if (strError != string.Empty)
            {
                lblResult.Text = strError;
                //throw new System.InvalidOperationException(strError);
            }
            else
            {
                //Print Label Inmmediatly

                if (Convert.ToInt32(disposition) == 4 || Convert.ToInt32(disposition) == 5)
                {
                    //obj.item = txtItem.Text;

                    //obj.clot = txtLot.Text;

                    lblResult.Text = string.Empty;

                    DataTable resultadop = idal.listaRegistros_Param(ref obj, ref strError);

                    resultadop.Columns.Add("FactorKG", typeof(string));

                    resultadop.Rows[0]["FactorKG"] = FactorKG.Trim();

                    Session["resultadop"] = resultadop;

                    StringBuilder paramurl = new StringBuilder();

                    paramurl.Append("?");

                    paramurl.Append("valor1=" + Request.QueryString[0].ToString() + "&");

                    paramurl.Append("valor2=" + Request.QueryString[1].ToString() + "&");

                    paramurl.Append("valor3=" + Request.QueryString[2].ToString());

                    Session["IsPreviousPage"] = "";

                    StringBuilder script = new StringBuilder();

                    script.Append("ventanaImp = window.open('../Labels/whInvLabelMaterialRejectedD.aspx', ");

                    script.Append("'ventanaImp', 'menubar=0,resizable=0,width=580,height=450');");

                    script.Append("ventanaImp.moveTo(30, 0);");

                    //script.Append("setTimeout (ventanaImp.close(), 20000);");

                    ScriptManager.RegisterStartupScript(this, this.GetType(), "printTag", script.ToString(), true);
                    //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Notify", "alert('Information Saved Successfully.');", true);
                    lblResult.Text    = mensajes("msjupdt");
                    lblResult.Visible = true;
                }
            }
        }
Example #19
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            List <Ent_tticol118> parameterCollection = new List <Ent_tticol118>();
            Ent_tticol118        obj = new Ent_tticol118();
            //Recorrer filas con valores en los textos
            string disposition = String.Empty;
            string reason      = String.Empty;
            string stockw      = String.Empty;
            string orden       = String.Empty;

            foreach (GridViewRow row in grdRecords.Rows)
            {
                string toreturn = ((TextBox)row.Cells[7].FindControl("toReturn")).Text;
                string lote     = ((TextBox)row.Cells[7].FindControl("toReturn")).Text;
                reason      = ((DropDownList)row.Cells[10].FindControl("Reasonid")).SelectedValue;
                disposition = ((DropDownList)row.Cells[11].FindControl("Dispoid")).SelectedValue;
                stockw      = ((DropDownList)row.Cells[12].FindControl("Stockwareh")).SelectedValue;
                if (stockw == String.Empty)
                {
                    stockw = "NA";
                }
                string regrind = ((DropDownList)row.Cells[13].FindControl("Regrind")).SelectedValue;
                if (regrind == String.Empty)
                {
                    regrind = "NA";
                }
                string obse = ((TextBox)row.Cells[14].FindControl("Comments")).Text;
                if (obse.Length > 255)
                {
                    obse = ((TextBox)row.Cells[14].FindControl("Comments")).Text.Substring(1, 255);
                }
                string supplier = ((DropDownList)row.Cells[11].FindControl("Supplier")).SelectedValue;
                if (supplier == string.Empty)
                {
                    supplier = " ";
                }
                if (Session["Lote"].ToString() == " ")
                {
                    Session["Lote"] = " ";
                }
                if (!toreturn.Equals(string.Empty))
                {
                    obj      = new Ent_tticol118();
                    obj.item = "         " + txtItem.Text.Trim().ToUpperInvariant();
                    obj.cwar = row.Cells[2].Text.ToUpperInvariant();
                    //obj.clot = row.Cells[3].Text.ToUpperInvariant();
                    obj.clot    = Session["Lote"].ToString();
                    obj.qtyr    = Convert.ToInt32(toreturn);
                    obj.cdis    = reason;
                    obj.obse    = obse;
                    obj.logr    = Session["user"].ToString();
                    obj.disp    = Convert.ToInt32(disposition);
                    obj.stoc    = stockw;
                    obj.ritm    = regrind;
                    obj.proc    = 2;
                    obj.mess    = " ";
                    obj.suno    = supplier;
                    obj.refcntd = 0;
                    obj.refcntu = 0;
                    parameterCollection.Add(obj);
                }
            }



            InterfazDAL_tticol118 idal = new InterfazDAL_tticol118();
            int actualizar             = idal.actualizarRegistro_Param(ref parameterCollection, ref strError);

            if (actualizar < 1)
            {
                idal.insertarRegistro(ref parameterCollection, ref strError);
            }

            if (strError != string.Empty)
            {
                lblResult.Text = strError;
            }
            else
            {
                printResult.Visible = true;
                if (Convert.ToInt32(disposition) == 4)
                {
                    DataTable resultado = idal.invLabel_registroImprimir_Param(ref obj, ref strError);

                    DataRow reg = resultado.Rows[0];
                    Session["FilaImprimir"] = reg;
                    printLabel.Visible      = true;
                }
                lblResult.Text          = strError;
                lblResult.Text          = "Material Rejection Inside Warehouse was updated succesfully.";
                this.HeaderGrid.Visible = false;
            }

            grdRecords.DataSource = "";
            grdRecords.DataBind();

            if (strError != string.Empty)
            {
                lblResult.Text = strError;
                throw new System.InvalidOperationException(strError);
            }
        }
Example #20
0
        protected void grdRecords_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                // Verificar que si la cantidad es igual a 0, el control "toReturn" se deshabilite
                string stock   = ((HiddenField)e.Row.Cells[4].FindControl("actualqty")).Value.Trim();
                string stritem = ((DataRowView)e.Row.DataItem).DataView.Table.Rows[e.Row.RowIndex]["Item"].ToString();

                if (Convert.ToInt32(stock) == 0)
                {
                    ((TextBox)e.Row.Cells[6].FindControl("toReturn")).Enabled = false;
                    ((TextBox)e.Row.Cells[6].FindControl("toReturn")).Attributes.Add("onfocus", "limpiar(this);");
                }
                // Verificar que si el lote es nulo o vacio
                string strLote = ((DataRowView)e.Row.DataItem).DataView.Table.Rows[e.Row.RowIndex]["LOT"].ToString();

                DataRow drv  = ((DataRowView)e.Row.DataItem).Row;
                var     fila = drv.ItemArray.ToArray();

                var serializador    = new JavaScriptSerializer();
                var FilaSerializada = serializador.Serialize(fila);

                ((RangeValidator)e.Row.Cells[6].FindControl("validateQuantity")).MinimumValue = "0";
                ((RangeValidator)e.Row.Cells[6].FindControl("validateQuantity")).MaximumValue = ((DataRowView)e.Row.DataItem).DataView.Table.Rows[e.Row.RowIndex]["stock"].ToString();

                //Llenar Stock Warehouse Dropdownlist
                InterfazDAL_tticol118 idalp = new InterfazDAL_tticol118();
                Ent_tticol118         obj   = new Ent_tticol118();
                obj.item = stritem;
                DataTable    proveedor     = idalp.listaProveedores_Param(ref obj, ref strError);
                DropDownList listproveedor = (DropDownList)e.Row.Cells[9].FindControl("Supplier");
                listproveedor.DataSource     = proveedor;
                listproveedor.DataTextField  = "nombre";
                listproveedor.DataValueField = "proveedor";
                listproveedor.DataBind();
                listproveedor.Items.Insert(0, new ListItem("Select Supplier here...", string.Empty));


                //Llenar Reason Dropdownlist
                InterfazDAL_tticol118 idal       = new InterfazDAL_tticol118();
                DataTable             reason     = idal.listaReason_Param(ref strError);
                DropDownList          listreason = (DropDownList)e.Row.Cells[10].FindControl("Reasonid");
                listreason.DataSource     = reason;
                listreason.DataTextField  = "descr";
                listreason.DataValueField = "reason";
                listreason.DataBind();
                listreason.Items.Insert(0, new ListItem("Select Reason here...", string.Empty));

                //Llenar Disposition Dropdownlist desde el webconfig
                ////if (ConfigurationManager.AppSettings.AllKeys.Contains("Disposition"))
                ////{
                ////    string listdisposition = ConfigurationManager.AppSettings["Disposition"];

                ////    var dispositionarray = listdisposition.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries).ToList<string>();
                ////    dispositionarray.Insert(0, "-- Select Disposition --");

                ////    DropDownList dispoid = (DropDownList)e.Row.Cells[11].FindControl("Dispositionid");
                ////    dispoid.DataSource = dispositionarray;
                ////    dispoid.DataBind();
                ////}
                ////else { lblResult.Visible = true; lblResult.Text = "Disposition List not found"; }

                //Llenar Stock Warehouse Dropdownlist
                InterfazDAL_tticol118 idalsw     = new InterfazDAL_tticol118();
                DataTable             stockw     = idalsw.listaStockw_Param(ref strError);
                DropDownList          liststockw = (DropDownList)e.Row.Cells[11].FindControl("Stockwareh");
                liststockw.DataSource     = stockw;
                liststockw.DataTextField  = "descrw";
                liststockw.DataValueField = "warehouse";
                liststockw.DataBind();
                liststockw.Items.Insert(0, new ListItem("Select Stock Warehouse here...", string.Empty));

                //Llenar Stock Warehouse Dropdownlist
                InterfazDAL_tticol118 idalr       = new InterfazDAL_tticol118();
                DataTable             regrind     = idalr.listaRegrind_Param(ref strError);
                DropDownList          listregrind = (DropDownList)e.Row.Cells[12].FindControl("Regrind");
                listregrind.DataSource     = regrind;
                listregrind.DataTextField  = "descrc";
                listregrind.DataValueField = "item";
                listregrind.DataBind();
                listregrind.Items.Insert(0, new ListItem("Select Item here...", string.Empty));
            }
        }
        protected void Dispoid_SelectedIndexChanged(object sender, EventArgs e)
        {
            // dispoc = (GridViewRow)sender;
            DropDownList listdispo     = (DropDownList)sender;
            GridViewRow  contenedor    = (GridViewRow)listdispo.Parent.DataItemContainer;
            DropDownList liststock     = (DropDownList)grdRecords.Rows[0].Cells[0].FindControl("Stockwareh");
            DropDownList listregrind   = (DropDownList)grdRecords.Rows[0].Cells[1].FindControl("Regrind");
            DropDownList listproveedor = (DropDownList)grdRecords.Rows[0].Cells[2].FindControl("Supplier");

            btnSave.Visible = true;
            btnSave.Enabled = true;

            if (listdispo.SelectedValue == "2")
            {
                listregrind.Enabled   = false;
                liststock.Enabled     = false;
                listproveedor.Enabled = true;
            }
            if (listdispo.SelectedValue == "3")
            {
                listregrind.Enabled   = false;
                listproveedor.Enabled = false;
                liststock.Enabled     = true;
            }
            if (listdispo.SelectedValue == "4")
            {
                liststock.Enabled     = false;
                listproveedor.Enabled = false;
                listregrind.Enabled   = true;


                if (listregrind.Items.Count > 1)
                {
                    btnSave.Visible = true;
                    btnSave.Enabled = true;
                }
                else
                {
                    btnSave.Visible = false;
                    btnSave.Enabled = false;
                }
            }
            if (listdispo.SelectedValue == "5")
            {
                liststock.Enabled     = false;
                listproveedor.Enabled = false;
                listregrind.Enabled   = false;
            }

            if (listdispo.SelectedItem.Text == "Return to Vendor")
            {
                InterfazDAL_tticol118 idalp = new InterfazDAL_tticol118();
                Ent_tticol118         obj   = new Ent_tticol118();
                obj.item = Session["txtItem"].ToString().Trim();
                DataTable proveedor = idalp.ListaProveedoresProducto(ref obj, ref strError);
                listproveedor.DataSource = proveedor;
                listproveedor.DataBind();
                listproveedor.Items.Insert(0, new ListItem(_idioma == "INGLES" ? "Select Supplier here..." : "Seleccione un proveedor...", string.Empty));
            }
            else
            {
                InterfazDAL_tticol118 idalp = new InterfazDAL_tticol118();
                Ent_tticol118         obj   = new Ent_tticol118();
                obj.item = Session["txtItem"].ToString().Trim();
                listproveedor.DataSource = idalp.listaProveedores_Param(ref obj, ref strError);
                listproveedor.DataBind();
                listproveedor.Items.Insert(0, new ListItem(_idioma == "INGLES" ? "Select Supplier here..." : "Seleccione un proveedor...", string.Empty));
            }
        }