Exemple #1
0
        public static List <Servicio> tarifaClienteMercancia(int id_cliente)
        {
            List <Servicio> lst = new List <Servicio>();

            try
            {
                Mercancia_servicioMng oMSMng = new Mercancia_servicioMng();
                int         total            = oMSMng.countClienteMercanciaServicio(id_cliente);
                ServicioMng oSMng            = new ServicioMng();
                oSMng.fillLstTarifaByClienteMercancia(id_cliente, total);
                lst = oSMng.Lst;
            }
            catch (Exception)
            {
                throw;
            }
            return(lst);
        }
Exemple #2
0
        public static Servicio ServicioSelById(int id)
        {
            Servicio o = new Servicio()
            {
                Id = id
            };

            try
            {
                ServicioMng oMng = new ServicioMng()
                {
                    O_Servicio = o
                };
                oMng.selById();
            }
            catch
            {
                throw;
            }
            return(o);
        }
Exemple #3
0
        public static Orden_trabajo OrdenTrabajoGet(string folio)
        {
            Orden_trabajo o = new Orden_trabajo()
            {
                Folio = folio
            };

            try
            {
                Orden_trabajoMng oMng = new Orden_trabajoMng()
                {
                    O_Orden_trabajo = o
                };
                oMng.selByFolio();

                Orden_trabajo_servicioMng oOTSMng = new Orden_trabajo_servicioMng()
                {
                    O_Orden_trabajo_servicio = new Orden_trabajo_servicio()
                    {
                        Id_orden_trabajo = o.Id
                    }
                };
                oOTSMng.fillLstByIdOT();

                o.PLstOTSer = oOTSMng.Lst;

                Entrada_liverpoolMng oELMng = new Entrada_liverpoolMng();
                MaquilaMng           oMMng  = new MaquilaMng();
                Maquila_pasoMng      oMPMng = new Maquila_pasoMng();
                ServicioMng          oSMng  = new ServicioMng();
                foreach (Orden_trabajo_servicio itemOTS in o.PLstOTSer)
                {
                    int ref2 = 0;
                    int.TryParse(itemOTS.Ref2, out ref2);

                    Entrada_liverpool oEL = new Entrada_liverpool()
                    {
                        Trafico = itemOTS.Ref1, Pedido = ref2
                    };
                    oELMng.O_Entrada_liverpool = oEL;
                    oELMng.selByUniqueKey();
                    itemOTS.PEntLiv = oEL;

                    Servicio oS = new Servicio()
                    {
                        Id = itemOTS.Id_servicio
                    };
                    oSMng.O_Servicio = oS;
                    oSMng.selById();
                    itemOTS.PServ = oS;

                    Maquila oM = new Maquila()
                    {
                        Id_ord_tbj_srv = itemOTS.Id
                    };
                    oMMng.O_Maquila = oM;
                    oMMng.fillLstByOTS();
                    itemOTS.PLstMaq = oMMng.Lst;

                    itemOTS.PalletMaq = itemOTS.PLstMaq.Sum(p => p.Pallets);
                    itemOTS.BultosMaq = itemOTS.PLstMaq.Sum(p => p.Bultos);
                    itemOTS.PiezasMaq = itemOTS.PLstMaq.Sum(p => p.Piezas);
                    int dif = itemOTS.Piezas - itemOTS.PiezasMaq;
                    itemOTS.Faltantes = 0;
                    itemOTS.Sobrantes = 0;
                    if (itemOTS.PiezasMaq > 0)
                    {
                        if (dif > 0)
                        {
                            itemOTS.Faltantes = dif;
                        }
                        else
                        {
                            itemOTS.Sobrantes = Math.Abs(dif);
                        }
                    }

                    Maquila_paso oMP = new Maquila_paso()
                    {
                        Id_ord_tbj_srv = itemOTS.Id
                    };
                    oMPMng.O_Maquila_paso = oMP;
                    oMPMng.fillByIdOTS();
                    itemOTS.PLstPasos = oMPMng.Lst;

                    int numPaso = 1;
                    foreach (Maquila_paso itemMP in oMPMng.Lst)
                    {
                        itemMP.NumPaso = numPaso;
                        numPaso++;
                    }

                    itemOTS.PasosMaq = itemOTS.PLstPasos.Count();
                }
            }
            catch
            {
                throw;
            }
            return(o);
        }