public JsonResult ActualizarEstado(string estado)
        {
            var response = new JsonResponse();
            try
            {
                using (var service = new ProduccionServiceClient())
                {
                    service.ActualizarEstadoOrdenProduccion(OrdenProduccionActual.Id, estado);
                }

                response.Success = true;
                response.Message = "Ok";
            }
            catch (Exception ex)
            {
                response.Message = ex.Message;

                LogError(ex);
            }
            return Json(response);
        }
Exemple #2
0
        public JsonResult CrearCarpetasArcivosPLC()
        {
            var response = new JsonResponse();

            try
            {
                foreach (var secuencia in OrdenProduccionActual.Secuencia)
                {
                    var directorio = string.Format(@"C:\MetalForming\{0}\{1}", OrdenProduccionActual.Numero, secuencia.PLC);

                    Directory.CreateDirectory(directorio);

                    var archivo = Path.Combine(directorio, "plc.txt");

                    if (System.IO.File.Exists(archivo))
                    {
                        System.IO.File.Delete(archivo);
                    }

                    var file = System.IO.File.Create(archivo);
                    file.Close();
                    file.Dispose();
                }

                using (var service = new ProduccionServiceClient())
                {
                    service.ActualizarEstadoOrdenProduccion(OrdenProduccionActual.Id, Constantes.EstadoOrdenPoduccion.Conformado);
                }

                response.Success = true;
                response.Message = "Ok";
            }
            catch (Exception ex)
            {
                response.Message = ex.Message;

                LogError(ex);
            }
            return(Json(response));
        }
Exemple #3
0
        public JsonResult ActualizarEstado(string estado)
        {
            var response = new JsonResponse();

            try
            {
                using (var service = new ProduccionServiceClient())
                {
                    service.ActualizarEstadoOrdenProduccion(OrdenProduccionActual.Id, estado);
                }

                response.Success = true;
                response.Message = "Ok";
            }
            catch (Exception ex)
            {
                response.Message = ex.Message;

                LogError(ex);
            }
            return(Json(response));
        }
        public JsonResult CrearCarpetasArcivosPLC()
        {
            var response = new JsonResponse();
            try
            {
                foreach (var secuencia in OrdenProduccionActual.Secuencia)
                {
                    var directorio = string.Format(@"C:\MetalForming\{0}\{1}", OrdenProduccionActual.Numero, secuencia.PLC);

                    Directory.CreateDirectory(directorio);

                    var archivo = Path.Combine(directorio, "plc.txt");

                    if (System.IO.File.Exists(archivo))
                        System.IO.File.Delete(archivo);

                    var file = System.IO.File.Create(archivo);
                    file.Close();
                    file.Dispose();
                }

                using (var service = new ProduccionServiceClient())
                {
                    service.ActualizarEstadoOrdenProduccion(OrdenProduccionActual.Id, Constantes.EstadoOrdenPoduccion.Conformado);
                }

                response.Success = true;
                response.Message = "Ok";
            }
            catch (Exception ex)
            {
                response.Message = ex.Message;

                LogError(ex);
            }
            return Json(response);
        }