Beispiel #1
0
        public ActionResult AsignarOrdenVenta()
        {
            var model = new AsignarOrdenVentaModel();

            try
            {
                Programa programaVigente;
                using (var service = new ProduccionServiceClient())
                {
                    programaVigente = service.ObtenerProgramaVigente();
                }

                if (programaVigente != null)
                {
                    model.ProgramaVigente = new ProgramaModel
                    {
                        Id          = programaVigente.Id,
                        Numero      = programaVigente.Numero,
                        FechaInicio = programaVigente.FechaInicio,
                        FechaFin    = programaVigente.FechaFin
                    };

                    IList <OrdenVenta> ordenesVenta;
                    using (var service = new ProduccionServiceClient())
                    {
                        ordenesVenta = service.ListarOrdenesVentaParaAsignar(model.ProgramaVigente.Id);
                    }

                    foreach (var item in ordenesVenta)
                    {
                        model.OrdenesVenta.Add(new OrdenVentaModel
                        {
                            Id           = item.Id,
                            Numero       = item.Numero,
                            Cliente      = item.Cliente,
                            FechaEntrega = item.FechaEntrega,
                            Estado       = item.Estado,
                            IdPrograma   = item.IdPrograma,
                            NombreAsistentePlaneamiento = item.AsistentePlaneamiento == null
                                        ? string.Empty
                                        : item.AsistentePlaneamiento.NombreCompleto
                        });
                    }
                }

                IList <Usuario> asistentesPlaneamiento;
                using (var service = new ProduccionServiceClient())
                {
                    asistentesPlaneamiento = service.ListarAsistentePlaneamiento();
                }

                foreach (var asistentePlaneamiento in asistentesPlaneamiento)
                {
                    model.AsistentePlaneamiento.Add(new UsuarioModel
                    {
                        Id             = asistentePlaneamiento.Id,
                        NombreCompleto = asistentePlaneamiento.NombreCompleto,
                        Username       = asistentePlaneamiento.Username,
                        CantidadOV     = asistentePlaneamiento.CantidadOV
                    });
                }
            }
            catch (Exception ex)
            {
                LogError(ex);
            }
            return(View(model));
        }
Beispiel #2
0
        public ActionResult MantenerOrdenProduccion()
        {
            var model = new ProgramacionModel();

            try
            {
                Programa programaVigente;
                using (var service = new ProduccionServiceClient())
                {
                    programaVigente = service.ObtenerProgramaVigente();
                }

                if (programaVigente != null)
                {
                    model.ProgramaVigente = new ProgramaModel
                    {
                        Id          = programaVigente.Id,
                        Numero      = programaVigente.Numero,
                        FechaInicio = programaVigente.FechaInicio,
                        FechaFin    = programaVigente.FechaFin
                    };

                    IList <OrdenVenta> ordenesVenta;
                    using (var service = new ProduccionServiceClient())
                    {
                        ordenesVenta = service.ListarOrdenesVentaPorPrograma(model.ProgramaVigente.Id);
                    }

                    foreach (var item in ordenesVenta)
                    {
                        model.OrdenesVenta.Add(new OrdenVentaModel
                        {
                            Id           = item.Id,
                            Numero       = item.Numero,
                            Cliente      = item.Cliente,
                            FechaEntrega = item.FechaEntrega,
                            Estado       = item.Estado,
                            IdPrograma   = item.IdPrograma
                        });
                    }

                    IList <OrdenProduccion> ordenesProduccion;
                    using (var service = new ProduccionServiceClient())
                    {
                        ordenesProduccion = service.ListarOrdenesProduccionPorPrograma(model.ProgramaVigente.Id);
                    }

                    foreach (var item in ordenesProduccion)
                    {
                        model.OrdenesProduccion.Add(new OrdenProduccionModel
                        {
                            Id                  = item.Id,
                            Numero              = item.Numero,
                            NumeroOrdenVenta    = item.OrdenVenta.Numero,
                            FechaEntrega        = item.OrdenVenta.FechaEntrega,
                            DescripcionProducto = item.OrdenVenta.Producto.Descripcion,
                            Estado              = item.Estado
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                LogError(ex);
            }
            return(View(model));
        }
        public ActionResult AsignarOrdenVenta()
        {
            var model = new AsignarOrdenVentaModel();
            try
            {
                Programa programaVigente;
                using (var service = new ProduccionServiceClient())
                {
                    programaVigente = service.ObtenerProgramaVigente();
                }

                if (programaVigente != null)
                {
                    model.ProgramaVigente = new ProgramaModel
                    {
                        Id = programaVigente.Id,
                        Numero = programaVigente.Numero,
                        FechaInicio = programaVigente.FechaInicio,
                        FechaFin = programaVigente.FechaFin
                    };

                    IList<OrdenVenta> ordenesVenta;
                    using (var service = new ProduccionServiceClient())
                    {
                        ordenesVenta = service.ListarOrdenesVentaParaAsignar(model.ProgramaVigente.Id);
                    }

                    foreach (var item in ordenesVenta)
                    {
                        model.OrdenesVenta.Add(new OrdenVentaModel
                        {
                            Id = item.Id,
                            Numero = item.Numero,
                            Cliente = item.Cliente,
                            FechaEntrega = item.FechaEntrega,
                            Estado = item.Estado,
                            IdPrograma = item.IdPrograma,
                            NombreAsistentePlaneamiento = item.AsistentePlaneamiento == null
                                        ? string.Empty
                                        : item.AsistentePlaneamiento.NombreCompleto
                        });
                    }
                }

                IList<Usuario> asistentesPlaneamiento;
                using (var service = new ProduccionServiceClient())
                {
                    asistentesPlaneamiento = service.ListarAsistentePlaneamiento();
                }

                foreach (var asistentePlaneamiento in asistentesPlaneamiento)
                {
                    model.AsistentePlaneamiento.Add(new UsuarioModel
                    {
                        Id = asistentePlaneamiento.Id,
                        NombreCompleto = asistentePlaneamiento.NombreCompleto,
                        Username = asistentePlaneamiento.Username,
                        CantidadOV = asistentePlaneamiento.CantidadOV
                    });
                }
            }
            catch (Exception ex)
            {
                LogError(ex);
            }
            return View(model);
        }
        public ActionResult MantenerOrdenProduccion()
        {
            var model = new ProgramacionModel();
            try
            {
                Programa programaVigente;
                using (var service = new ProduccionServiceClient())
                {
                    programaVigente = service.ObtenerProgramaVigente();
                }

                if (programaVigente != null)
                {
                    model.ProgramaVigente = new ProgramaModel
                    {
                        Id = programaVigente.Id,
                        Numero = programaVigente.Numero,
                        FechaInicio = programaVigente.FechaInicio,
                        FechaFin = programaVigente.FechaFin
                    };

                    IList<OrdenVenta> ordenesVenta;
                    using (var service = new ProduccionServiceClient())
                    {
                        ordenesVenta = service.ListarOrdenesVentaPorPrograma(model.ProgramaVigente.Id);
                    }

                    foreach (var item in ordenesVenta)
                    {
                        model.OrdenesVenta.Add(new OrdenVentaModel
                        {
                            Id = item.Id,
                            Numero = item.Numero,
                            Cliente = item.Cliente,
                            FechaEntrega = item.FechaEntrega,
                            Estado = item.Estado,
                            IdPrograma = item.IdPrograma
                        });
                    }

                    IList<OrdenProduccion> ordenesProduccion;
                    using (var service = new ProduccionServiceClient())
                    {
                        ordenesProduccion = service.ListarOrdenesProduccionPorPrograma(model.ProgramaVigente.Id);
                    }

                    foreach (var item in ordenesProduccion)
                    {
                        model.OrdenesProduccion.Add(new OrdenProduccionModel
                        {
                            Id = item.Id,
                            Numero = item.Numero,
                            NumeroOrdenVenta = item.OrdenVenta.Numero,
                            FechaEntrega = item.OrdenVenta.FechaEntrega,
                            DescripcionProducto = item.OrdenVenta.Producto.Descripcion,
                            Estado = item.Estado
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                LogError(ex);
            }
            return View(model);
        }
        public ActionResult AsignarOrdenProduccion()
        {
            var model = new AsignarOrdenProduccionModel();
            try
            {
                Programa programaVigente;
                using (var service = new ProduccionServiceClient())
                {
                    programaVigente = service.ObtenerProgramaVigente();
                }

                if (programaVigente != null)
                {
                    model.ProgramaVigente = new ProgramaModel
                    {
                        Id = programaVigente.Id,
                        Numero = programaVigente.Numero,
                        FechaInicio = programaVigente.FechaInicio,
                        FechaFin = programaVigente.FechaFin
                    };

                    IList<OrdenProduccion> ordenesProduccion;
                    using (var service = new ProduccionServiceClient())
                    {
                        ordenesProduccion = service.ListarOrdenesProduccionParaAsignar(model.ProgramaVigente.Id);
                    }

                    foreach (var item in ordenesProduccion)
                    {
                        model.OrdenesProduccion.Add(new OrdenProduccionModel
                        {
                            Id = item.Id,
                            Numero = item.Numero,
                            NumeroOrdenVenta = item.OrdenVenta.Numero,
                            FechaEntrega = item.OrdenVenta.FechaEntrega,
                            Estado = item.Estado,
                            DescripcionProducto = item.OrdenVenta.Producto.Descripcion,
                            NombreOperador = item.Operador == null
                                        ? string.Empty
                                        : item.Operador.NombreCompleto
                        });
                    }
                }

                IList<Usuario> operadores;
                using (var service = new ProduccionServiceClient())
                {
                    operadores = service.ListarOperadores();
                }

                foreach (var operador in operadores)
                {
                    model.Operadores.Add(new UsuarioModel
                    {
                        Id = operador.Id,
                        NombreCompleto = operador.NombreCompleto,
                        Username = operador.Username,
                        CantidadOP = operador.CantidadOP
                    });
                }
            }
            catch (Exception ex)
            {
                LogError(ex);
            }
            return View(model);
        }
Beispiel #6
0
        public ActionResult AsignarOrdenProduccion()
        {
            var model = new AsignarOrdenProduccionModel();

            try
            {
                Programa programaVigente;
                using (var service = new ProduccionServiceClient())
                {
                    programaVigente = service.ObtenerProgramaVigente();
                }

                if (programaVigente != null)
                {
                    model.ProgramaVigente = new ProgramaModel
                    {
                        Id          = programaVigente.Id,
                        Numero      = programaVigente.Numero,
                        FechaInicio = programaVigente.FechaInicio,
                        FechaFin    = programaVigente.FechaFin
                    };

                    IList <OrdenProduccion> ordenesProduccion;
                    using (var service = new ProduccionServiceClient())
                    {
                        ordenesProduccion = service.ListarOrdenesProduccionParaAsignar(model.ProgramaVigente.Id);
                    }

                    foreach (var item in ordenesProduccion)
                    {
                        model.OrdenesProduccion.Add(new OrdenProduccionModel
                        {
                            Id                  = item.Id,
                            Numero              = item.Numero,
                            NumeroOrdenVenta    = item.OrdenVenta.Numero,
                            FechaEntrega        = item.OrdenVenta.FechaEntrega,
                            Estado              = item.Estado,
                            DescripcionProducto = item.OrdenVenta.Producto.Descripcion,
                            NombreOperador      = item.Operador == null
                                        ? string.Empty
                                        : item.Operador.NombreCompleto
                        });
                    }
                }

                IList <Usuario> operadores;
                using (var service = new ProduccionServiceClient())
                {
                    operadores = service.ListarOperadores();
                }

                foreach (var operador in operadores)
                {
                    model.Operadores.Add(new UsuarioModel
                    {
                        Id             = operador.Id,
                        NombreCompleto = operador.NombreCompleto,
                        Username       = operador.Username,
                        CantidadOP     = operador.CantidadOP
                    });
                }
            }
            catch (Exception ex)
            {
                LogError(ex);
            }
            return(View(model));
        }