示例#1
0
        public DataTable GetItemsStat(ref Ent_ttwhcol016 Parametros, ref string strError)
        {
            method    = MethodBase.GetCurrentMethod();
            paramList = new Dictionary <string, object>();
            paramList.Add("stat", Parametros.stat.Trim().ToUpper());
            //JC 210122 Buscar el item en tabla ticol135
            paramList.Add("item", Parametros.item.Trim().ToUpper());

            strSentencia = recursos.readStatement(method.ReflectedType.Name, 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 = "Item code doesn´t exist. Cannot continue";
                }
                return(consulta);
            }
            catch (Exception ex)
            {
                log.escribirError(strError + Console.Out.NewLine + ex.Message, method.Module.Name, method.Name, method.ReflectedType.Name);
            }
            return(consulta);
        }
示例#2
0
        //JC 020821 Retornar consecutivo y serie
        public DataTable VerificaCons_Serie_Label(ref Ent_ttwhcol016 parametros, ref string strError)
        {
            method    = MethodBase.GetCurrentMethod();
            paramList = new Dictionary <string, object>();
            paramList.Add("p1", parametros.zone.Trim().ToUpperInvariant());

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

            strSentencia = recursos.readStatement(method.ReflectedType.Name, 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 = "-1";
                    return(consulta);
                }
            }
            catch (Exception ex)
            {
                strError = "Error when querying data [ttwhcol016]. Try again or contact your administrator";
                log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(consulta);
        }
示例#3
0
        public DataTable TakeMaterialInv_verificaBodegaZone_Param(ref Ent_ttwhcol016 parametros, ref string strError)
        {
            method    = MethodBase.GetCurrentMethod();
            paramList = new Dictionary <string, object>();
            paramList.Add("p1", parametros.zone.Trim().ToUpperInvariant());

            //strSentencia = "SELECT T$CWAR " +
            //               "FROM " + owner + ".twhwmd310" + env + " TWAR " +
            //               "WHERE TRIM(T$ZONE) = '" + Parametros.zone.Trim() + "'";

            strSentencia = recursos.readStatement(method.ReflectedType.Name, 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 = "Zone don´t have warehouse";
                }

                ttwhcol016 dal016 = new ttwhcol016();
                parametros.cwar = consulta.Rows[0]["T$CWAR"].ToString();
                consulta        = dal016.TakeMaterialInv_verificaBodega_Param(ref parametros, ref strError);
            }
            catch (Exception ex)
            {
                strError = "Error when querying data [ttwhcol017]. Try again or contact your administrator";
                log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(consulta);
        }
示例#4
0
        public int DesactivarSerie_Consecutivo(ref Ent_ttwhcol016 parametros, ref string strError)
        {
            method = MethodBase.GetCurrentMethod();
            bool   retorno     = false;
            string MsgstrError = string.Empty;

            paramList = new Dictionary <string, object>();
            paramList.Add("p1", parametros.zone.Trim().ToUpperInvariant());
            paramList.Add("p2", parametros.serietemp);
            paramList.Add("p3", '1');
            paramList.Add("p4", '2');
            paramList.Add("p5", parametros.serietemp + 1);

            try
            {
                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);
                strSentencia = recursos.readStatement(method.ReflectedType.Name, "ActivarNuevaSerie_Consecutivo", ref owner, ref env, tabla, paramList);
                retorno      = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false);
            }
            catch (Exception ex)
            {
                strError = MsgstrError + "Try again or contact your administrator";
                log.escribirError(strError + Console.Out.NewLine + ex.Message, method.Module.Name, method.Name, method.ReflectedType.Name);
            }
            return(Convert.ToInt32(retorno));
        }
示例#5
0
        private List <Ent_ParametrosDAL> AdicionaParametrosComunes(Ent_ttwhcol016 parametros, bool blnUsarPRetorno = false)
        {
            string strError = string.Empty;
            string param    = string.Empty;
            List <Ent_ParametrosDAL> parameterCollection = new List <Ent_ParametrosDAL>();

            try
            {
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$ZONE", DbType.String, parametros.zone);
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LABL", DbType.String, parametros.labl);
                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.Decimal, Convert.ToDecimal(parametros.qtyr).ToString("#.##0,0000"));
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LOGN", DbType.String, parametros.logn);
                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)
            {
                log.escribirError(strError + Console.Out.NewLine + ex.Message, method.Module.Name, method.Name, method.ReflectedType.Name);
                throw (ex);
            }
            return(parameterCollection);
        }
示例#6
0
        public static string GetItems()
        {
            Ent_ttwhcol016 obj016 = new Ent_ttwhcol016();

            obj016.stat = "RET";
            //JC 210122 Buscar los posibles regrind en la tabla ticol135
            obj016.item = HttpContext.Current.Session["ITM"].ToString();

            int       i       = 0;
            DataTable DTItemt = dal016.GetItemsStat(ref obj016, ref strError);
            List <Ent_twhcol130131> lstItems = new List <Ent_twhcol130131>();

            if (DTItemt.Rows.Count > 0)
            {
                foreach (DataRow item in DTItemt.Rows)
                {
                    if (i <= 50)
                    {
                        Ent_twhcol130131 MyObj = new Ent_twhcol130131();
                        MyObj.KTLC      = item["LOTE"].ToString();
                        MyObj.ITEM      = item["T$ITEM"].ToString();
                        MyObj.DSCA      = item["DESCRIPCION"].ToString();
                        MyObj.UNIT      = item["UNIDAD"].ToString();
                        MyObj.Error     = false;
                        MyObj.errorMsg  = string.Empty;
                        MyObj.TipeMsgJs = string.Empty;
                        lstItems.Add(MyObj);
                        i++;
                    }
                }
            }

            return(JsonConvert.SerializeObject(lstItems));;
        }
        protected void btnSearchZone_Click(object sender, EventArgs e)
        {
            lblError.Text = string.Empty;
            strError      = string.Empty;

            Ent_ttwhcol016 objZone = new Ent_ttwhcol016();

            objZone.zone = txtZone.Text.ToUpperInvariant().Trim();
            resultado    = idal016.TakeMaterialInv_verificaZona_Param(ref objZone, ref strError);

            if (!string.IsNullOrEmpty(strError))
            {
                lblZone.Text = strError;
                txtZone.Focus();
                strError         = string.Empty;
                divTabla.Visible = false;
                return;
            }

            //lblZone.Text = string.Empty;
            divTabla.Visible = true;
            lblZone.Text     = resultado.Rows[0]["DESCRIPCION"].ToString();
            resultado        = idal.TakeMaterialInv_verificaBodegaZone_Param(ref objZone, ref strError);

            txtCwar.Text            = resultado.Rows[0]["T$CWAR"].ToString();
            lblCwar.Text            = resultado.Rows[0]["DESCRIPCION"].ToString();
            btnSearch.Enabled       = true;
            Page.Form.DefaultButton = btnSearch.UniqueID;
            txtLabelId.Focus();
        }
示例#8
0
        public static string VerificarTipoWarehouse(string WARE, string ROW)
        {
            string strError = string.Empty;

            Ent_ttwhcol016 Obj_twhcol016 = new Ent_ttwhcol016();

            Obj_twhcol016.cwar = WARE.ToUpper();
            Obj_twhcol016.Row  = ROW;

            Ent_twhwmd200 Obj_twhwmd200 = new Ent_twhwmd200();

            Obj_twhwmd200.cwar = WARE.ToUpper();

            DataTable DtConsigment = ITtwhcol016.UserConsigment(HttpContext.Current.Session["user"].ToString(), WARE.ToUpper());
            DataTable DtTtwhcol016 = ITtwhcol016.TakeMaterialInv_verificaBodega_Param(ref Obj_twhcol016, ref strError);
            DataTable DtTwhwmd200  = ITwhwmd200.listaRegistro_ObtieneAlmacenLocation(ref Obj_twhwmd200, ref strError);

            if (DtTtwhcol016.Rows.Count > 0)
            {
                Obj_twhcol016.Error      = false;
                Obj_twhcol016.TypeMsgJs  = "console";
                Obj_twhcol016.SuccessMsg = "Warehouse Encontrado";


                Obj_twhcol016.TYPW = DtTtwhcol016.Rows[0]["TYPW"].ToString();

                if (Obj_twhcol016.TYPW.ToString() == "21" && DtConsigment.Rows[0]["T$CONS"].ToString().Trim() != "1")
                {
                    Obj_twhcol016.Error     = true;
                    Obj_twhcol016.ErrorMsg  = WarehouseConsigment;
                    Obj_twhcol016.TypeMsgJs = "lbl";
                }

                if (DtTwhwmd200.Rows.Count > 0)
                {
                    Obj_twhcol016.sloc = DtTwhwmd200.Rows[0]["LOC"].ToString();
                }
                else
                {
                    Obj_twhcol016.sloc = string.Empty;
                }
            }
            else
            {
                Obj_twhcol016.Error     = true;
                Obj_twhcol016.TypeMsgJs = "label";
                Obj_twhcol016.ErrorMsg  = WarehouseNotExist;
            }
            Obj_twhcol016.cwar.ToUpper();
            return(JsonConvert.SerializeObject(Obj_twhcol016));
        }
示例#9
0
        public static string validaInfo(string valor, string tipo, string orden = null)
        {
            string    strSecondVal = string.Empty;
            string    strError     = string.Empty;
            string    retorno      = string.Empty;
            DataTable resultado    = new DataTable();

            InterfazDAL_ttwhcol016 idal016 = new InterfazDAL_ttwhcol016();
            Ent_ttwhcol016         obj016  = new Ent_ttwhcol016();

            InterfazDAL_tticol090 idal = new InterfazDAL_tticol090();
            Ent_tticol090         obj  = new Ent_tticol090();

            if (tipo == "1") // Items
            {
                obj.item = valor;
                obj.fpdn = orden;

                resultado = idal.lineClearance_verificaRegistrosOrden_Param(ref obj, ref strError);
            }

            if (tipo == "2") // Lote
            {
                String[] valores = valor.Split('|');

                obj016.clot = valores[0].Trim().ToUpperInvariant();
                obj016.item = valores[1].Trim().ToUpperInvariant();
                obj.fpdn    = orden;

                resultado = idal016.TakeMaterialInv_verificaLote_Param(ref obj016, ref strError);
                strError  = _idioma == "INGLES" ? "Lot code doesn´t exist. Cannot Continue" : "Codigo de lote no existe, no se puede continuar.";
                if (string.IsNullOrEmpty(strError))
                {
                    resultado = idal.lineClearance_verificaRegistrosOrden_Param(ref obj, ref obj016, ref strError);
                }
                strError = _idioma == "INGLES" ? "Lot code was not on Work Order. Cannot Continue" : "Codigo de lote no es de la orden de trabajo, no se puede continuar.";
            }

            // Validar si el numero de orden trae registros
            if (strError != string.Empty)
            {
                return("BAAN: " + strError);
            }
            if (resultado.Rows.Count > 0)
            {
                retorno = resultado.Rows[0]["DESCRIPCION"].ToString();
            }

            return(retorno);
        }
示例#10
0
        //JC 020821 Retornar consecutivo y serie
        public DataTable VerificaCons_Serie_Label(ref Ent_ttwhcol016 Parametros, ref string strError)
        {
            DataTable retorno;

            try
            {
                retorno = dal.VerificaCons_Serie_Label(ref Parametros, ref strError);
                return(retorno);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.InnerException.ToString());
            }
        }
示例#11
0
        public int DesactivarSerie_Consecutivo(ref Ent_ttwhcol016 parametrosIn, ref string strError)
        {
            int retorno = -1;

            try
            {
                retorno = dal.DesactivarSerie_Consecutivo(ref parametrosIn, ref strError);
                return(retorno);
            }
            catch (Exception ex)
            {
                throw new Exception(strError += "\nPila: " + ex.Message);
            }
        }
示例#12
0
        public int actualizarContadores(ref Ent_ttwhcol016 Parametros, ref string strError)
        {
            int retorno = -1;

            try
            {
                retorno = dal.actualizarContadores(ref Parametros, ref strError);
                return(retorno);
            }
            catch (Exception ex)
            {
                throw new Exception(strError += ex.Message);
            }
        }
        public static string validaInfo(string valor, string tipo, string orden = null)
        {
            string    strSecondVal = string.Empty;
            string    strError     = string.Empty;
            string    retorno      = string.Empty;
            DataTable resultado    = new DataTable();

            InterfazDAL_ttwhcol016 idal016 = new InterfazDAL_ttwhcol016();
            Ent_ttwhcol016         obj016  = new Ent_ttwhcol016();

            InterfazDAL_tticol090 idal = new InterfazDAL_tticol090();
            Ent_tticol090         obj  = new Ent_tticol090();

            if (tipo == "1") // Items
            {
                obj.item = valor;
                obj.fpdn = orden;

                resultado = idal.lineClearance_verificaRegistrosOrden_Param(ref obj, ref strError);
            }

            if (tipo == "2") // Lote
            {
                String[] valores = valor.Split('|');

                obj016.clot = valores[0].Trim().ToUpperInvariant();
                obj016.item = valores[1].Trim().ToUpperInvariant();
                obj.fpdn    = orden;

                resultado = idal016.TakeMaterialInv_verificaLote_Param(ref obj016, ref strError);

                if (string.IsNullOrEmpty(strError))
                {
                    resultado = idal.lineClearance_verificaRegistrosOrden_Param(ref obj, ref obj016, ref strError);
                }
            }

            // Validar si el numero de orden trae registros
            if (strError != string.Empty)
            {
                return("BAAN: " + strError);
            }
            if (resultado.Rows.Count > 0)
            {
                retorno = resultado.Rows[0]["DESCRIPCION"].ToString();
            }

            return(retorno);
        }
示例#14
0
        public DataTable GetItemsStat(ref Ent_ttwhcol016 Parametros, ref string strError)
        {
            //int retorno = -1;
            DataTable retorno;

            try
            {
                retorno = dal.GetItemsStat(ref Parametros, ref strError);
                return(retorno);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.InnerException.ToString());
            }
        }
示例#15
0
        public DataTable TakeMaterialInv_verificaBodegaZone_Param(ref Ent_ttwhcol016 Parametros, ref string strError)
        {
            //int retorno = -1;
            DataTable retorno;

            try
            {
                retorno = dal.TakeMaterialInv_verificaBodegaZone_Param(ref Parametros, ref strError);
                return(retorno);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.InnerException.ToString());
            }
        }
        public static string VerificarWarehouse(string CWAR)
        {
            Ent_twhcol130131 MyObj131Base = (Ent_twhcol130131)HttpContext.Current.Session["MyPalletTwhcol13"];
            string           strError     = string.Empty;

            Ent_ttwhcol016 Obj_twhcol016 = new Ent_ttwhcol016();

            Obj_twhcol016.cwar = CWAR;

            Ent_twhwmd200 Obj_twhwmd200 = new Ent_twhwmd200();

            Obj_twhwmd200.cwar = CWAR;

            DataTable DtTtwhcol016 = ITtwhcol016.TakeMaterialInv_verificaBodega_Param(ref Obj_twhcol016, ref strError);
            DataTable DtTwhwmd200  = ITwhwmd200.listaRegistro_ObtieneAlmacenLocation(ref Obj_twhwmd200, ref strError);

            if (DtTtwhcol016.Rows.Count > 0)
            {
                Obj_twhcol016.Error      = false;
                Obj_twhcol016.TypeMsgJs  = "console";
                Obj_twhcol016.SuccessMsg = "Warehouse Encontrado";

                if (DtTwhwmd200.Rows.Count > 0)
                {
                    Obj_twhcol016.sloc = DtTwhwmd200.Rows[0]["LOC"].ToString();
                }
                else
                {
                    Obj_twhcol016.sloc = string.Empty;
                    if (MyObj131Base.CWAR == CWAR)
                    {
                        Obj_twhcol016.Error     = true;
                        Obj_twhcol016.TypeMsgJs = "label";
                        Obj_twhcol016.ErrorMsg  = "Warehouse / Location can't be the same";
                    }
                }
            }
            else
            {
                Obj_twhcol016.Error     = true;
                Obj_twhcol016.TypeMsgJs = "label";

                Obj_twhcol016.ErrorMsg = Warehousecodedoesntexist;
            }

            return(JsonConvert.SerializeObject(Obj_twhcol016));
        }
        public static string validaInfo(string valor, string tipo, string orden = null)
        {
            string    strSecondVal = string.Empty;
            string    strError     = string.Empty;
            string    retorno      = string.Empty;
            DataTable resultado    = new DataTable();

            InterfazDAL_ttwhcol016 idal016 = new InterfazDAL_ttwhcol016();
            Ent_ttwhcol016         obj016  = new Ent_ttwhcol016();

            InterfazDAL_ttscol100 idal = new InterfazDAL_ttscol100();
            Ent_ttscol100         obj  = new Ent_ttscol100();

            if (tipo == "1") // Items
            {
                obj.item  = valor;
                resultado = idal.spareDelivery_listaRegistroItem_Param(ref obj, ref strError);
                if (resultado.Rows.Count > 0)
                {
                    retorno = resultado.Rows[0]["DESCRIPCION"].ToString().Trim() + "|" +
                              resultado.Rows[0]["UNIDAD"].ToString().Trim() + "|" +
                              resultado.Rows[0]["ARTICULO"].ToString().Trim();
                }
            }

            if (tipo == "2") // Lote
            {
                obj.loca  = valor;
                resultado = idal.spareDelivery_listaRegistroUbicacion_Param(ref obj, ref strError);
                if (resultado.Rows.Count > 0)
                {
                    retorno = resultado.Rows[0]["LOCATION"].ToString().Trim() + "|" +
                              resultado.Rows[0]["WAREHOUSE"].ToString().Trim();
                }
            }

            // Validar si el numero de orden trae registros
            if (strError != string.Empty)
            {
                return("BAAN: " + strError);
            }
            // if (resultado.Rows.Count > 0) { retorno = resultado.Rows[0]["DESCRIPCION"].ToString(); }

            return(retorno);
        }
        public static string VerificarWarehouse(string CWAR)
        {
            string strError = string.Empty;

            Ent_ttwhcol016 Obj_twhcol016 = new Ent_ttwhcol016();

            Obj_twhcol016.cwar = CWAR;

            Ent_twhwmd200 Obj_twhwmd200 = new Ent_twhwmd200();

            Obj_twhwmd200.cwar = CWAR.ToUpper();

            DataTable DtTtwhcol016 = ITtwhcol016.TakeMaterialInv_verificaBodega_Param(ref Obj_twhcol016, ref strError);
            DataTable DtTwhwmd200  = ITwhwmd200.listaRegistro_ObtieneAlmacenLocation(ref Obj_twhwmd200, ref strError);

            if (DtTtwhcol016.Rows.Count > 0)
            {
                Obj_twhcol016.Error      = false;
                Obj_twhcol016.TypeMsgJs  = "console";
                Obj_twhcol016.SuccessMsg = "Warehouse Encontrado";
                Obj_twhcol016.dsca       = DtTtwhcol016.Rows[0]["DESCRIPCION"].ToString();

                if (DtTwhwmd200.Rows.Count > 0)
                {
                    Obj_twhcol016.sloc = DtTwhwmd200.Rows[0]["LOC"].ToString();
                }
                else
                {
                    Obj_twhcol016.sloc = string.Empty;
                }

                HttpContext.Current.Session["CWAR"] = Obj_twhcol016.cwar;
            }
            else
            {
                Obj_twhcol016.Error     = true;
                Obj_twhcol016.TypeMsgJs = "label";
                Obj_twhcol016.ErrorMsg  = Warehousecodedoesntexist;
            }

            return(JsonConvert.SerializeObject(Obj_twhcol016));
        }
示例#19
0
        public static string verifyItem(string ITEM)
        {
            Ent_twhcol130131 MyObj  = new Ent_twhcol130131();
            Ent_ttwhcol016   obj016 = new Ent_ttwhcol016();

            obj016.item = ITEM.ToUpper().Trim();
            DataTable DTItemt = dal016.TakeMaterialInv_verificaItem_Param(ref obj016, ref strError);

            if (DTItemt.Rows.Count > 0)
            {
                Ent_twhcol130131 MyOriginalPallet = (Ent_twhcol130131)HttpContext.Current.Session["MyOriginalPallet"];
                var MyObjDT = DTItemt.Rows[0];

                if (MyObjDT["UNIDAD"].ToString().Trim() == MyOriginalPallet.UNIT.Trim())
                {
                    MyObj.KTLC      = MyObjDT["LOTE"].ToString();
                    MyObj.ITEM      = MyObjDT["T$ITEM"].ToString();
                    MyObj.DSCA      = MyObjDT["DESCRIPCION"].ToString();
                    MyObj.UNIT      = MyObjDT["UNIDAD"].ToString();
                    MyObj.Error     = false;
                    MyObj.errorMsg  = string.Empty;
                    MyObj.TipeMsgJs = string.Empty;
                }
                else
                {
                    MyObj.Error     = true;
                    MyObj.errorMsg  = "Item not allowed to adjust, due the unit is different";
                    MyObj.TipeMsgJs = "alert";
                }
            }
            else
            {
                MyObj.Error     = true;
                MyObj.errorMsg  = Itemcodedoesntexist;
                MyObj.TipeMsgJs = "Label";
            }

            return(JsonConvert.SerializeObject(MyObj));;
        }
示例#20
0
        public DataTable TakeMaterialInv_verificaLote_Param(ref Ent_ttwhcol016 ParametrosIn, ref string strError)
        {
            method    = MethodBase.GetCurrentMethod();
            paramList = new Dictionary <string, object>();
            paramList.Add("p1", ParametrosIn.clot.Trim().ToUpperInvariant());

            strSentencia = recursos.readStatement(method.ReflectedType.Name, 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 = "Lot Code doesn´t exist. Cannot Continue";
                }
                return(consulta);
            }
            catch (Exception ex)
            {
                log.escribirError(strError + Console.Out.NewLine + ex.Message, method.Module.Name, method.Name, method.ReflectedType.Name);
            }
            return(consulta);
        }
示例#21
0
        public int actualizarContadores(ref Ent_ttwhcol016 Parametros, ref string strError)
        {
            method    = MethodBase.GetCurrentMethod();
            paramList = new Dictionary <string, object>();
            paramList.Add("p1", Parametros.zone.Trim().ToUpperInvariant());
            bool retorno = false;

            try
            {
                strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList);
                retorno      = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, null, false);
                return(Convert.ToInt32(retorno));
            }

            catch (Exception ex)
            {
                strError = "Error when inserting data [ttcmcs050]. 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(Convert.ToInt32(retorno));
        }
示例#22
0
        public DataTable lineClearance_verificaRegistrosOrden_Param(ref Ent_tticol090 Parametros, ref Ent_ttwhcol016 Parametros016, ref string strError)
        {
            method = MethodBase.GetCurrentMethod();

            paramList = new Dictionary <string, object>();
            paramList.Add("p1", Parametros016.item.Trim().ToUpperInvariant());
            paramList.Add("p2", Parametros016.clot.Trim().ToUpperInvariant());
            paramList.Add("p3", Parametros.fpdn.Trim().ToUpperInvariant());

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

            try
            {
                consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true);

                if (consulta.Rows.Count < 1)
                {
                    strError = "Lot Code was not on Work Order. Cannot Continue";
                }
                //return consulta;
            }
            catch (Exception ex)
            {
                log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(consulta);
        }
        public static string Click_Save(string CWAR, string ITEM, string CLOT, string LOCA, string QTYS, string UNIT)
        {
            //int consecutivoPalletID = 0;
            //DataTable DTPalletContinue = twhcol130DAL.PaidMayorwhcol130("INITIAPOP-P");
            //string SecuenciaPallet = "001";
            //if (DTPalletContinue.Rows.Count > 0)
            //{
            //    foreach (DataRow item in DTPalletContinue.Rows)
            //    {
            //        string paid = item["T$PAID"].ToString().Trim();
            //        int indesSep = item["T$PAID"].ToString().Trim().IndexOf("-P");
            //        string secuence = paid.Substring(indesSep + 1);
            //        consecutivoPalletID = Convert.ToInt32(secuence)+1;
            //        if (consecutivoPalletID.ToString().Length == 1)
            //        {
            //            SecuenciaPallet = "P00" + consecutivoPalletID;
            //        }
            //        if (consecutivoPalletID.ToString().Length == 2)
            //        {
            //            SecuenciaPallet = "P0" + consecutivoPalletID;
            //        }
            //        if (consecutivoPalletID.ToString().Length == 3)
            //        {
            //            SecuenciaPallet = "P"+consecutivoPalletID.ToString();
            //        }

            //    }

            //}
            Ent_ttwhcol016 data016  = new Ent_ttwhcol016();;
            string         retorno  = string.Empty;
            string         strError = string.Empty;

            data016.zone = serieLabelRM;
            DataTable dat016      = ITtwhcol016.VerificaCons_Serie_Label(ref data016, ref strError);
            int       actcontador = ITtwhcol016.actualizarContadores(ref data016, ref strError);
            //string SecuenciaPallet = "C";
            string consecutivo = dat016.Rows[0]["CONSEC"].ToString().PadLeft(3, '0');
            string serie       = dat016.Rows[0]["SEQ"].ToString();

            if (consecutivo == "990")
            {
                data016.serietemp = Convert.ToInt32(dat016.Rows[0]["SEQ"].ToString()) + 1;
                int retconser = ITtwhcol016.ActualizarSerie_Consecutivo(ref data016, ref strError);
            }
            if (consecutivo == "998")
            {
                data016.serietemp = Convert.ToInt32(dat016.Rows[0]["SEQ"].ToString());
                int retconser = ITtwhcol016.DesactivarSerie_Consecutivo(ref data016, ref strError);
            }
            string id   = CLOT.Trim() == "" ? cyclecountLabelRM : CLOT.Trim();
            string sqnb = cyclecountLabelRM.Trim() + serie.Trim() + "-" + consecutivo;

            Ent_twhcol130131 MyObj = new Ent_twhcol130131
            {
                OORG = "2",// Order type escaneada view
                //ORNO = "INITIAPOP",
                ORNO = cyclecountLabelRM.Trim() + serie.Trim(),
                ITEM = ITEM.ToUpper(),
                //PAID = "INITIAPOP" + "-" + SecuenciaPallet,
                PAID  = sqnb,
                PONO  = "1",
                SEQN  = "1",
                CLOT  = CLOT.ToUpper(),                                 // lote VIEW
                CWAR  = CWAR.ToUpper(),
                QTYS  = QTYS,                                           // cantidad escaneada view
                QTYA  = QTYS,
                UNIT  = UNIT,                                           //unit escaneada view
                QTYC  = QTYS,                                           //cantidad escaneada view aplicando factor
                UNIC  = UNIT,                                           //unidad view stock
                DATE  = DateTime.Now.ToString("dd/MM/yyyy").ToString(), //fecha de confirmacion
                CONF  = "1",
                RCNO  = " ",                                            //llena baan
                DATR  = DateTime.Now.ToString("dd/MM/yyyy").ToString(), //llena baan
                LOCA  = LOCA.ToUpper(),                                 // enviamos vacio
                DATL  = DateTime.Now.ToString("dd/MM/yyyy").ToString(), //llenar con fecha de hoy
                PRNT  = "1",                                            // llenar en 1
                DATP  = DateTime.Now.ToString("dd/MM/yyyy").ToString(), //llena baan
                NPRT  = "1",                                            //conteo de reimpresiones
                LOGN  = HttpContext.Current.Session["user"].ToString(), // nombre de ususario de la session
                LOGT  = " ",                                            //llena baan
                STAT  = "3",                                            // LLENAR EN 3
                DSCA  = " ",
                COTP  = " ",
                FIRE  = "2",
                PSLIP = " ",
                ALLO  = "0",
                //PAID_URL = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + "INITIAPOP" + "-" + SecuenciaPallet + "&code=Code128&dpi=96",
                PAID_URL = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + "INITIAPOP" + "-" + sqnb + "&code=Code128&dpi=96",
                ORNO_URL = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + "DTOrdencompra.Rows[0][].ToString()" + "&code=Code128&dpi=96",
                ITEM_URL = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + ITEM + "&code=Code128&dpi=96",
                CLOT_URL = CLOT.ToString().Trim() != "" ? UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + CLOT + "&code=Code128&dpi=96" : "",
                QTYC_URL = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + QTYS + "&code=Code128&dpi=96",
                UNIC_URL = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + UNIT + "&code=Code128&dpi=96"
            };

            string StrError     = string.Empty;
            bool   Insertsucces = twhcol130DAL.Insertartwhcol131(MyObj, ref StrError);

            if (Insertsucces)
            {
                HttpContext.Current.Session["MaterialDesc"] = "XXXXX XXX XXX XX";
                HttpContext.Current.Session["MaterialCode"] = MyObj.ITEM;
                HttpContext.Current.Session["codePaid"]     = MyObj.PAID;
                HttpContext.Current.Session["Lot"]          = MyObj.CLOT;
                HttpContext.Current.Session["Quantity"]     = MyObj.QTYS + " " + UNIT;
                HttpContext.Current.Session["Origin"]       = MyObj.CLOT;
                HttpContext.Current.Session["Supplier"]     = "";
                HttpContext.Current.Session["RecibedBy"]    = MyObj.LOGN;
                HttpContext.Current.Session["RecibedOn"]    = DateTime.Now.ToString("MM/dd/yyyy");
                HttpContext.Current.Session["Reprint"]      = "no";
            }
            else
            {
                MyObj.error     = true;
                MyObj.TypeMsgJs = "label";
                MyObj.errorMsg  = "Error insert";
            }


            return(JsonConvert.SerializeObject(MyObj));
        }
示例#24
0
        public DataTable lineClearance_verificaRegistrosOrden_Param(ref Ent_tticol090 Parametros, ref Ent_ttwhcol016 Parametros016, ref string strError)
        {
            DataTable retorno;

            try
            {
                retorno = dal.lineClearance_verificaRegistrosOrden_Param(ref Parametros, ref Parametros016, ref strError);
                return(retorno);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.InnerException.ToString());
            }
        }
        public static string validaInfo(string valor, string tipo)
        {
            InterfazDAL_ttwhcol016 idal = new InterfazDAL_ttwhcol016();
            Ent_ttwhcol016         obj  = new Ent_ttwhcol016();
            string    strError          = string.Empty;
            string    retorno           = string.Empty;
            DataTable resultado         = new DataTable();
            string    strSecondVal      = string.Empty;

            if (tipo == "1") // Bodega
            {
                obj.cwar  = valor.Trim().ToUpperInvariant();
                resultado = idal.TakeMaterialInv_verificaBodega_Param(ref obj, ref strError);
            }
            if (tipo == "2") // Zona
            {
                obj.zone  = valor.Trim().ToUpperInvariant();
                resultado = idal.TakeMaterialInv_verificaZona_Param(ref obj, ref strError);
                if (resultado.Rows.Count > 0)
                {
                    int consecutivo = 0;
                    consecutivo  = idal.TakeMaterialInv_verificaConsLabel_Param(ref obj, ref strError);
                    strSecondVal = "|" + consecutivo.ToString().Trim();

                    if (consecutivo < 1)
                    {
                        strError = _idioma == "INGLES" ? "Sequence Zone " + valor + " doesn't exist. Cannot Continue"
                            : "Secunecia de zona " + valor + " no existe, no se puede continuar.";
                    }
                }
            }
            if (tipo == "3") // Item
            {
                obj.item  = valor.Trim().ToUpperInvariant();
                resultado = idal.TakeMaterialInv_verificaItem_Param(ref obj, ref strError);
                if (resultado.Rows.Count <= 0)
                {
                    strError = _idioma == "INGLES" ? "Item code doesn´t exist. Cannot continue" : "Codigo de articulo no existe. No se puede continuar";
                }
            }
            if (tipo == "4") // Lote
            {
                obj.clot  = valor.Trim().ToUpperInvariant();
                resultado = idal.TakeMaterialInv_verificaLote_Param(ref obj, ref strError);
                if (resultado.Rows.Count <= 0)
                {
                    strError = _idioma == "INGLES" ? "Lot Code doesn´t exist. Cannot Continue" : "Codigo de lote no existe. No se puede continuar";
                }
            }



            // Validar si el numero de orden trae registros
            if (strError != string.Empty)
            {
                return("BAAN: " + strError);
            }

            if (resultado.Rows.Count > 0)
            {
                retorno = resultado.Rows[0]["DESCRIPCION"].ToString();

                if (tipo == "3")
                {
                    retorno = resultado.Rows[0]["DESCRIPCION"].ToString().Trim() + "|" +
                              resultado.Rows[0]["UNIDAD"].ToString().Trim() + "|" +
                              resultado.Rows[0]["LOTE"].ToString().Trim();
                }
            }

            return(retorno + strSecondVal);
        }
        protected void Save_Click(object sender, EventArgs e)
        {
            string        ITEM = HttpContext.Current.Session["ITEM"].ToString();
            string        CWAR = HttpContext.Current.Session["CWAR"].ToString();
            string        CLOT = HttpContext.Current.Session["CLOT"].ToString();
            string        LOCA = HttpContext.Current.Session["LOCA"].ToString();
            string        QTYS = HttpContext.Current.Session["QTYS"].ToString();
            string        UNIT = HttpContext.Current.Session["UNIT"].ToString();
            string        CUNI = HttpContext.Current.Session["CUNI"].ToString();
            Ent_tticol022 data022;
            Ent_tticol042 data042;
            string        strError = string.Empty;
            //JC 020801 Conseguir el último consecutivo de la serie NFP definida en baan
            Ent_ttwhcol016 data016 = new Ent_ttwhcol016();;
            string         retorno = string.Empty;

            data016.zone = serieLabelFP;
            DataTable dat016      = _idaltwhcol016.VerificaCons_Serie_Label(ref data016, ref strError);
            int       actcontador = _idaltwhcol016.actualizarContadores(ref data016, ref strError);
            //string SecuenciaPallet = "C";
            string consecutivo = dat016.Rows[0]["CONSEC"].ToString().PadLeft(3, '0');
            string serie       = dat016.Rows[0]["SEQ"].ToString();

            if (consecutivo == "990")
            {
                data016.serietemp = Convert.ToInt32(dat016.Rows[0]["SEQ"].ToString()) + 1;
                int retconser = _idaltwhcol016.ActualizarSerie_Consecutivo(ref data016, ref strError);
            }
            if (consecutivo == "998")
            {
                data016.serietemp = Convert.ToInt32(dat016.Rows[0]["SEQ"].ToString());
                int retconser = _idaltwhcol016.DesactivarSerie_Consecutivo(ref data016, ref strError);
            }
            string id   = CLOT.Trim() == "" ? cyclecountLabel : CLOT.Trim();
            string sqnb = cyclecountLabel.Trim() + serie.Trim() + "-" + consecutivo;

            //if (HttpContext.Current.Session["myItemType"].ToString().Trim() != "RET")
            //{
            //string id = cyclecountLabel;
            //JC 020821 Conseguir el último consecutivo de la serie NFP ya no se buscará el consecutivo por orden
            //DataTable Dtticol022 = _idaltticol022.SecuenciaMayor(id);
            //if (Dtticol022.Rows.Count > 0)
            //{

            //int res;
            //string sqnb = Dtticol022.Rows[0]["T$SQNB"].ToString().Trim() == "" ? SecuenciaPallet : Dtticol022.Rows[0]["T$SQNB"].ToString().Trim();
            //int iSep = sqnb.IndexOf("-");
            //string CurrentSecuence = sqnb.Substring(iSep + 1).Replace("C","");
            // //consecutivo = Convert.ToInt32(CurrentSecuence)+1;
            //consecutivo = CurrentSecuence + 1;
            //}
            //else
            //{
            //    //consecutivo = 1;
            //    consecutivo = "1";
            //}
            //}
            //else
            //{
            //    //string id = CLOT.Trim() == "" ? ITEM.Trim() : CLOT.Trim();
            //    //string id = cyclecountLabel;
            //    DataTable Dtticol042 = _idaltticol042.SecuenciaMayor(id);
            //    if (Dtticol042.Rows.Count > 0)
            //    {
            //        int res;
            //        string sqnb = Dtticol042.Rows[0]["T$SQNB"].ToString().Trim();
            //        int iSep = sqnb.IndexOf("-");
            //        string CurrentSecuence = sqnb.Substring(iSep + 1).Replace("C", "");
            //        //consecutivo = Convert.ToInt32(CurrentSecuence)+1;
            //        consecutivo = CurrentSecuence + 1;
            //    }
            //    else
            //    {
            //        //consecutivo = 1;
            //        consecutivo = "1";
            //    }
            //}

            //JC 020821 Conseguir el último consecutivo de la serie NFP ya no se buscará el consecutivo por orden
            //if (consecutivo.ToString().Length == 1)
            //{
            //    SecuenciaPallet = "C00" + consecutivo.ToString();
            //}
            //if (consecutivo.ToString().Length == 2)
            //{
            //    SecuenciaPallet = "C0" + consecutivo.ToString();
            //}
            //if (consecutivo.ToString().Length == 3)
            //{
            //    SecuenciaPallet = "C0" + consecutivo.ToString();
            //}


            if (HttpContext.Current.Session["myItemType"].ToString().Trim() != "RET")
            {
                data022      = new Ent_tticol022();
                data022.pdno = CLOT == "" ? cyclecountLabel.Trim() + serie.Trim() : CLOT.Trim();
                //data022.sqnb = (CLOT == "" ? cyclecountLabel : CLOT.Trim()) + "-" + SecuenciaPallet;
                data022.sqnb    = sqnb;
                data022.proc    = 2;
                data022.logn    = HttpContext.Current.Session["user"].ToString();
                data022.mitm    = ITEM.Trim();
                data022.qtdl    = Convert.ToDecimal(QTYS);
                data022.cuni    = CUNI;
                data022.log1    = "NONE";
                data022.qtd1    = Convert.ToInt32(Convert.ToDecimal(QTYS));
                data022.pro1    = 2;
                data022.log2    = "NONE";
                data022.qtd2    = Convert.ToInt32(Convert.ToDecimal(QTYS));
                data022.pro2    = 2;
                data022.loca    = " ";
                data022.norp    = 1;
                data022.dele    = 7;
                data022.logd    = "NONE";
                data022.refcntd = 0;
                data022.refcntu = 0;
                data022.drpt    = DateTime.Now;
                data022.urpt    = HttpContext.Current.Session["user"].ToString();
                data022.acqt    = Convert.ToDecimal(QTYS);
                data022.cwaf    = CWAR;
                data022.cwat    = CWAR;
                data022.aclo    = LOCA;
                data022.allo    = 0;

                HttpContext.Current.Session["strOrden"]  = data022.pdno;
                HttpContext.Current.Session["strSecuen"] = data022.sqnb;
                HttpContext.Current.Session["itemId"]    = data022.mitm;
                HttpContext.Current.Session["cantidad"]  = data022.acqt;
                HttpContext.Current.Session["bodega"]    = data022.cwaf;
                HttpContext.Current.Session["usuario"]   = data022.urpt;
                HttpContext.Current.Session["fecha"]     = data022.drpt;
                HttpContext.Current.Session["descItem"]  = data022.mitm;
                HttpContext.Current.Session["unidad"]    = data022.cuni;
                HttpContext.Current.Session["strTagId"]  = "";

                var validateSave         = _idaltticol022.insertarRegistroSimple(ref data022, ref strError);
                var validateSaveTicol222 = _idaltticol022.InsertarRegistroTicol222(ref data022, ref strError);

                //return JsonConvert.SerializeObject(data022);
                if (Convert.ToBoolean(validateSave) && Convert.ToBoolean(validateSaveTicol222))
                {
                    HttpContext.Current.Session["MaterialDesc"] = data022.mitm;
                    HttpContext.Current.Session["codeMaterial"] = data022.mitm;
                    HttpContext.Current.Session["codePaid"]     = data022.sqnb;
                    HttpContext.Current.Session["Lot"]          = CLOT;
                    HttpContext.Current.Session["Quantity"]     = data022.acqt + " " + data022.cuni;
                    HttpContext.Current.Session["Date"]         = DateTime.Now.ToString("MM/dd/yyyy");
                    HttpContext.Current.Session["Pallet"]       = data022.sqnb;
                    HttpContext.Current.Session["Machine"]      = _idaltticol022.getMachine(CLOT, ITEM.Trim().ToUpper(), ref strError);
                    HttpContext.Current.Session["Operator"]     = _operator;
                    HttpContext.Current.Session["Reprint"]      = "no";


                    StringBuilder script = new StringBuilder();
                    if (HttpContext.Current.Session["navigator"].ToString() == "EDG")
                    {
                        script.Append("myLabelFrame = document.getElementById('myLabelFrame'); myLabelFrame.src ='../Labels/RedesingLabels/4FinishedCupsME.aspx'; ");
                    }
                    else
                    {
                        script.Append("myLabelFrame = document.getElementById('myLabelFrame'); myLabelFrame.src ='../Labels/RedesingLabels/4FinishedCups.aspx'; ");
                    }

                    ScriptManager.RegisterStartupScript(this, this.GetType(), "printTag", script.ToString(), true);

                    //StringBuilder script = new StringBuilder();
                    //script.Append("ventanaImp = window.open('../Labels/RedesingLabels/4FinishedCups.aspx', ");
                    //script.Append("'ventanaImp', 'menubar=0,resizable=0,width=700,height=450');");
                    //script.Append("ventanaImp.moveTo(30, 0);");
                    ////script.Append("setTimeout (ventanaImp.close(), 20000);");
                    //ScriptManager.RegisterStartupScript(this, this.GetType(), "printTag", script.ToString(), true);

                    //StringBuilder script = new StringBuilder();
                    //script.Append("ventanaImp = window.open('../Labels/whInvLabelFinishProduct.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);
                }
                else
                {
                    StringBuilder script = new StringBuilder();
                    string        alert  = "alert('" + strError.Replace("\n", "") + "')";
                    script.Append(alert);
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "printTag", script.ToString(), true);
                }
            }
            else
            {
                data042 = new Ent_tticol042()
                {
                    pdno = CLOT == "" ? cyclecountLabel.Trim() + serie.Trim() : CLOT,
                    //sqnb = (CLOT == "" ? cyclecountLabel : CLOT) + "-" + SecuenciaPallet,
                    sqnb    = sqnb,
                    proc    = 2,
                    logn    = HttpContext.Current.Session["user"].ToString(),
                    mitm    = ITEM.Trim(),
                    qtdl    = Convert.ToDouble(QTYS),
                    cuni    = CUNI,
                    log1    = "NONE",
                    qtd1    = Convert.ToDecimal(QTYS),
                    pro1    = 2,
                    log2    = "NONE",
                    qtd2    = Convert.ToDecimal(QTYS),
                    pro2    = 2,
                    loca    = " ",
                    norp    = 1,
                    dele    = 7,
                    logd    = "NONE",
                    refcntd = 0,
                    refcntu = 0,
                    drpt    = DateTime.Now,
                    urpt    = HttpContext.Current.Session["user"].ToString(),
                    acqt    = Convert.ToDouble(QTYS),
                    cwaf    = CWAR,
                    cwat    = CWAR,
                    aclo    = LOCA,
                    allo    = 0
                };

                HttpContext.Current.Session["strOrden"]  = data042.pdno;
                HttpContext.Current.Session["strSecuen"] = data042.sqnb;
                HttpContext.Current.Session["itemId"]    = data042.mitm;
                HttpContext.Current.Session["cantidad"]  = data042.acqt;
                HttpContext.Current.Session["bodega"]    = data042.cwaf;
                HttpContext.Current.Session["usuario"]   = data042.urpt;
                HttpContext.Current.Session["fecha"]     = data042.drpt;
                HttpContext.Current.Session["descItem"]  = data042.mitm;
                HttpContext.Current.Session["unidad"]    = data042.cuni;
                HttpContext.Current.Session["strTagId"]  = "";

                var validateSave         = _idaltticol042.insertarRegistroSimpleD(ref data042, ref strError);
                var validateSaveTicol242 = _idaltticol042.InsertarRegistroTicol242(ref data042, ref strError);

                //return JsonConvert.SerializeObject(data042);
                if (Convert.ToBoolean(validateSave) && Convert.ToBoolean(validateSaveTicol242))
                {
                    HttpContext.Current.Session["MaterialDesc"] = data042.mitm;
                    HttpContext.Current.Session["codeMaterial"] = data042.mitm;
                    HttpContext.Current.Session["codePaid"]     = data042.sqnb;
                    HttpContext.Current.Session["Lot"]          = CLOT;
                    HttpContext.Current.Session["Quantity"]     = data042.acqt + " " + data042.cuni;
                    HttpContext.Current.Session["Date"]         = DateTime.Now.ToString("MM/dd/yyyy");
                    HttpContext.Current.Session["Pallet"]       = data042.sqnb;
                    HttpContext.Current.Session["Machine"]      = _idaltticol022.getMachine(CLOT, ITEM.Trim().ToUpper(), ref strError);;
                    HttpContext.Current.Session["Operator"]     = _operator;
                    HttpContext.Current.Session["Reprint"]      = "no";

                    StringBuilder script = new StringBuilder();
                    if (HttpContext.Current.Session["navigator"].ToString() == "EDG")
                    {
                        script.Append("myLabelFrame = document.getElementById('myLabelFrame'); myLabelFrame.src ='../Labels/RedesingLabels/4FinishedCupsME.aspx'; ");
                    }
                    else
                    {
                        script.Append("myLabelFrame = document.getElementById('myLabelFrame'); myLabelFrame.src ='../Labels/RedesingLabels/4FinishedCups.aspx'; ");
                    }
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "printTag", script.ToString(), true);

                    //StringBuilder script = new StringBuilder();
                    //script.Append("ventanaImp = window.open('../Labels/whInvLabelFinishProduct.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);
                }
            }
        }
示例#27
0
        public static string Click_Save(string PAID, string ITEM, string CWAR, string LOCA, string UNIT, string QTYS, string CLOT, string ZONE, string USER)
        {
            string strError = string.Empty;

            //Valido si el articulo maneja lote
            Ent_ttcibd001 ObjTtcibd001 = new Ent_ttcibd001();
            DataTable     dtTtcibd001  = ITtcibd001.findItem(ITEM);

            if (dtTtcibd001.Rows.Count > 0)
            {
                ObjTtcibd001.item = dtTtcibd001.Rows[0]["ITEM"].ToString();
                ObjTtcibd001.dsca = dtTtcibd001.Rows[0]["DSCA"].ToString();
                ObjTtcibd001.cuni = dtTtcibd001.Rows[0]["CUNI"].ToString();
                ObjTtcibd001.kltc = dtTtcibd001.Rows[0]["KLTC"].ToString();
                ObjTtcibd001.kitm = dtTtcibd001.Rows[0]["KITM"].ToString();

                if (ObjTtcibd001.kltc.Trim() == "1")
                {
                    //Valido el Lote que exista en baan y este asociado al item
                    Ent_tticol125 Obj_tticol125 = new Ent_tticol125();
                    Obj_tticol125.item = ITEM;
                    Obj_tticol125.clot = CLOT;

                    DataTable DtTticol125 = ITticol125.listaRegistrosLoteItem_Param(ref Obj_tticol125);

                    if (DtTticol125.Rows.Count > 0)
                    {
                        Obj_tticol125.error      = false;
                        Obj_tticol125.typeMsgJs  = "console";
                        Obj_tticol125.SuccessMsg = "Lote Encontrado";
                    }
                    else
                    {
                        Obj_tticol125.error      = true;
                        Obj_tticol125.typeMsgJs  = "label";
                        Obj_tticol125.SuccessMsg = Lotcodedoesntexist;
                        return(JsonConvert.SerializeObject(Obj_tticol125));
                    }
                }
            }

            //Valido los datos de la bodega
            Ent_twhwmd200  Obj_twhwmd200 = new Ent_twhwmd200();
            Ent_ttwhcol016 Obj_twhcol016 = new Ent_ttwhcol016();

            Obj_twhcol016.cwar = CWAR;
            Obj_twhwmd200.cwar = CWAR;

            DataTable DtTtwhcol016 = ITtwhcol016.TakeMaterialInv_verificaBodega_Param(ref Obj_twhcol016, ref strError);
            DataTable DtTwhwmd200  = ITwhwmd200.listaRegistro_ObtieneAlmacenLocation(ref Obj_twhwmd200, ref strError);

            if (DtTtwhcol016.Rows.Count > 0)
            {
                Obj_twhcol016.error      = false;
                Obj_twhcol016.typeMsgJs  = "console";
                Obj_twhcol016.SuccessMsg = "Warehouse Encontrado";

                //if (CWAR != PCWAR)
                //{
                //    Obj_twhcol016.error = true;
                //    Obj_twhcol016.typeMsgJs = "label";
                //    Obj_twhcol016.SuccessMsg = Warehousenotequalzone;
                //    return JsonConvert.SerializeObject(Obj_twhcol016);
                //}
                if (DtTwhwmd200.Rows.Count > 0)
                {
                    Obj_twhcol016.sloc = DtTwhwmd200.Rows[0]["LOC"].ToString();
                }
                else
                {
                    Obj_twhcol016.sloc = string.Empty;
                }
            }
            else
            {
                Obj_twhcol016.error      = true;
                Obj_twhcol016.typeMsgJs  = "label";
                Obj_twhcol016.SuccessMsg = Warehousecodedoesntexist;
                return(JsonConvert.SerializeObject(Obj_twhcol016));
            }

            if (Obj_twhcol016.sloc == "1")
            {
                //Valido que la ubicación sea válida.
                DataTable DtTransfer = Itransfer.ConsultarLocation(CWAR, LOCA);
                if (DtTransfer.Rows.Count > 0)
                {
                    if (DtTransfer.Rows[0]["LOCT"].ToString() == "5")
                    {
                        if (DtTransfer.Rows[0]["BINB"].ToString() == "2")
                        {
                            Obj_twhwmd200.Error      = false;
                            Obj_twhwmd200.TypeMsgJs  = "console";
                            Obj_twhwmd200.SuccessMsg = "Location Encontrado";
                        }
                        else
                        {
                            Obj_twhwmd200.error      = true;
                            Obj_twhwmd200.typeMsgJs  = "label";
                            Obj_twhwmd200.SuccessMsg = Locationcodedoesntexist;
                            return(JsonConvert.SerializeObject(Obj_twhwmd200));
                        }
                    }
                    else
                    {
                        Obj_twhwmd200.error      = true;
                        Obj_twhwmd200.typeMsgJs  = "label";
                        Obj_twhwmd200.SuccessMsg = Locationcodedoesntexist;
                        return(JsonConvert.SerializeObject(Obj_twhwmd200));
                    }
                }
                else
                {
                    Obj_twhwmd200.error      = true;
                    Obj_twhwmd200.typeMsgJs  = "label";
                    Obj_twhwmd200.SuccessMsg = Locationcodedoesntexist;
                    return(JsonConvert.SerializeObject(Obj_twhwmd200));
                }
            }

            //Valido que exista un conteo activo para la bodega.
            Ent_twhcol002 ObjTwhcol002      = new Ent_twhcol002();
            DataTable     DTSecuenciaConteo = _idaltwhcol019.ConsecutivoConteo(CWAR, ref strError);
            string        SecuenciaConteo   = "0";

            if (DTSecuenciaConteo.Rows.Count > 0)
            {
                SecuenciaConteo = DTSecuenciaConteo.Rows[0]["T$COUN"].ToString();
                if (SecuenciaConteo == "0")
                {
                    ObjTwhcol002.error      = true;
                    ObjTwhcol002.typeMsgJs  = "label";
                    ObjTwhcol002.SuccessMsg = CountWarehouseNotDefined;
                    return(JsonConvert.SerializeObject(ObjTwhcol002));
                }
            }
            else
            {
                ObjTwhcol002.error      = true;
                ObjTwhcol002.typeMsgJs  = "label";
                ObjTwhcol002.SuccessMsg = CountWarehouseNotDefined;
                return(JsonConvert.SerializeObject(ObjTwhcol002));
            }


            DataTable DTPalletContinue = _idaltwhcol019.Consetwhcol019(PAID, ref strError);
            int       SecuenciaPallet  = 0;

            if (DTPalletContinue.Rows.Count > 0)
            {
                SecuenciaPallet = DTPalletContinue.Rows.Count + 1;
            }
            else
            {
                SecuenciaPallet = 1;
            }

            Ent_twhcol019 ObjTwhcol019 = new Ent_twhcol019();

            QTYS = QTYS.Trim() == "" ? "0" : QTYS.Trim();
            //QTYS = QTYS.Contains(".") == true ? QTYS.Replace(".", ",") : QTYS.Replace(",", ".");
            decimal QTYD = Convert.ToDecimal(QTYS);

            if (QTYD <= Convert.ToDecimal(0))
            {
                ObjTwhcol019.error      = false;
                ObjTwhcol019.typeMsgJs  = "label";
                ObjTwhcol019.SuccessMsg = Registeredquantitycannotbelessthanorequaltozero;
                return(JsonConvert.SerializeObject(ObjTwhcol019));
            }
            //string CLOT = " ";
            ObjTwhcol019.PAID    = PAID;
            ObjTwhcol019.SQNB    = SecuenciaPallet;//Convert.ToInt32(PAID.Substring(10,3));
            ObjTwhcol019.ZONE    = ZONE;
            ObjTwhcol019.CWAR    = CWAR;
            ObjTwhcol019.LOCA    = Obj_twhcol016.sloc == "2" ? " ": LOCA.Trim() == "" ? " " : LOCA.Trim();
            ObjTwhcol019.ITEM    = ITEM;
            ObjTwhcol019.CLOT    = CLOT.Trim() == "" ? " " : CLOT.Trim();
            ObjTwhcol019.QTDL    = QTYD;
            ObjTwhcol019.CUNI    = UNIT;
            ObjTwhcol019.LOGN    = USER.Trim() != "" ? USER.Trim() : HttpContext.Current.Session["user"].ToString().Trim();
            ObjTwhcol019.DATE    = new DateTime();
            ObjTwhcol019.COUN    = Convert.ToInt32(SecuenciaConteo);
            ObjTwhcol019.PROC    = 0;
            ObjTwhcol019.REFCNTD = 0;
            ObjTwhcol019.REFCNTU = 0;

            bool res = _idaltwhcol019.insertRegistertwhcol019(ref ObjTwhcol019, ref strError);

            if (res)
            {
                ObjTwhcol019.error      = false;
                ObjTwhcol019.typeMsgJs  = "alert";
                ObjTwhcol019.SuccessMsg = Therecordwassuccessfullyinserted;
            }
            else
            {
                ObjTwhcol019.error     = true;
                ObjTwhcol019.typeMsgJs = "alert";

                ObjTwhcol019.SuccessMsg = Therecordwasnotinserted + " " + strError;
            }
            return(JsonConvert.SerializeObject(ObjTwhcol019));
        }