Esempio n. 1
0
 private void ponerMedidas(Folio cod)
 {
     //Tiempo aproximado que tarda la estacion en tomar la pieza y colocarlo en los instrumentos de medicion.
     Thread.Sleep(Constantes.TiempoProceso);
     // ya que la pieza fue aceptada en la estacion, entonces se colocan las medidas en los tags para que sime las tome.
     foreach (Medida medi in cod.Medidas)
     {
         foreach (Socket soc in sockets)
         {
             if (medi.IdRegistro == soc.IdRegistro)
             {
                 soc.Data.Value = medi.Valor;
                 soc.Update();
                 break;
             }
         }
     }
     // ya que termina la estacion de capturar todas las medidas, entonces le dice a SIME que las medidas estan listas
     // para que las tome.
     foreach (Socket s in sockets)
     {
         if (s.Clasificacion == "M" && s.TipoR == "P")
         {
             s.Data.Value = 1;
             s.Update();
             break;
         }
     }
     nvecesPrograma++;
 }
Esempio n. 2
0
        private string getFolio(int id_bodega, enumTipo tipo)
        {
            string folio  = string.Empty;
            string errMsg = string.Empty;

            try
            {
                FolioMng oMng = new FolioMng();
                Folio    o    = new Folio();
                o.Anio_actual = id_bodega;
                o.Tipo        = tipo.ToString();
                oMng.O_Folio  = o;
                //oMng.getFolio();
                folio = o.Tipo + o.Actual.ToString();
            }
            catch (Exception)
            {
                switch (tipo)
                {
                case enumTipo.E:
                    errMsg = "La bodega no tiene asignación de folios para la Entrada";
                    break;

                case enumTipo.S:
                    errMsg = "La bodega no tiene asignación de folios para la Salida";
                    break;

                default:
                    break;
                }
                throw new Exception(errMsg);
            }

            return(folio);
        }
Esempio n. 3
0
        private void btn_agregar_Click(object sender, EventArgs e)
        {
            /*
             *  obtenemos una lista de las variables.
             **/
            List <Medida> medidas = new List <Medida>();

            foreach (Control ctrlHijo in pnl_variables.Controls)
            {
                Type tipo = ctrlHijo.GetType();
                if (tipo.Name == "TextBox")
                {
                    Medida med = new Medida();
                    med.IdRegistro = Convert.ToInt32(ctrlHijo.Tag);
                    med.Valor      = (ctrlHijo.Text != "")?ctrlHijo.Text:"0";
                    medidas.Add(med);
                    ctrlHijo.Text = "";
                }
            }

            Folio folioCodigo = new Folio();

            folioCodigo.Codigo2D = txt_codigo.Text;
            folioCodigo.Medidas  = medidas;
            lst_folios.Items.Add(folioCodigo);

            txt_codigo.Text = "";
        }
Esempio n. 4
0
        public Folio insertFolio(Folio folio)
        {
            FolioDAO folioDAO = new FolioDAO();

            folio = folioDAO.insertFolio(folio);
            return(folio);
        }
Esempio n. 5
0
        private void rbtnFolioDevoluciones_Click(object sender, EventArgs e)
        {
            Folio folio = new Folio(false, false);

            Close();
            folio.Show();
        }
Esempio n. 6
0
        public Folio getFolio(int id)
        {
            FolioDAO folioDAO = new FolioDAO();
            Folio    folio    = folioDAO.getFolio(id);

            return(folio);
        }
Esempio n. 7
0
        private void rbtnFolioVentas_Click(object sender, EventArgs e)
        {
            Folio folio = new Folio(true, false);

            Close();
            folio.Show();
        }
Esempio n. 8
0
        public static void Add(Folio folio)
        {
            folio.Id = Guid.NewGuid().ToString();
            var cdal = new FolioRepository();

            cdal.Add(folio);
        }
Esempio n. 9
0
        public RespFolio getFolioFtp(string serverName, string userName, string userPassword, string fileName)
        {
            var        request = new RestRequest("getFolio", Method.POST);
            JsonObject json    = new JsonObject();
            RespFolio  resp    = new RespFolio();

            request.RequestFormat = DataFormat.Json;
            json.Add("server_name", serverName);
            json.Add("user_name", userName);
            json.Add("user_password", userPassword);
            json.Add("file_name", fileName);
            request.AddBody(json);

            IRestResponse <Folio> response = client.Execute <Folio>(request);
            Folio data = response.Data;

            resp.products = new List <RespFolio.Products>();
            if (data != null)
            {
                foreach (Folio.Product prod in data.products)
                {
                    resp.products.Add(new RespFolio.Products(prod.name, prod.upc, prod.quantity));
                }
            }
            return(resp);
        }
Esempio n. 10
0
        public override int GetHashCode()
        {
            //Get hash code for the Name field if it is not null.
            int hashProductName = Folio == null ? 0 : Folio.GetHashCode();

            //Calculate the hash code for the product.
            return(hashProductName);
        }
Esempio n. 11
0
        public Detalle_Pedido(string json)
        {
            InitializeComponent();
            elegido = JsonConvert.DeserializeObject <Pedido>(json);

            if (elegido.Estatus.Equals("A"))
            {
                elegido.OracionEstatus = "Agendado";
                elegido.OracionImagen  = "confirmado.png";
            }

            if (elegido.Estatus.Equals("C"))
            {
                elegido.OracionEstatus = "Cancelado";
                elegido.OracionImagen  = "cancel.png";
            }

            elegido.TotalLitros    += " Totales";
            elegido.OracionMagna   += " Magna";
            elegido.OracionPremium += " Premium";
            elegido.OracionDiesel  += " Diesel";

            ImagenEstado.SetBinding(Image.SourceProperty, "OracionImagen");
            ImagenEstado.BindingContext = elegido;

            Confirmado.SetBinding(Label.TextProperty, "OracionEstatus");
            Confirmado.BindingContext = elegido;

            Folio.SetBinding(Label.TextProperty, "Folio_Pedido");
            Folio.BindingContext = elegido;

            ValorEstacion.SetBinding(Label.TextProperty, "Nombre_Estacion");
            ValorEstacion.BindingContext = elegido;

            FechaAgendada.SetBinding(Label.TextProperty, "OracionFecha");
            FechaAgendada.BindingContext = elegido;

            Total.SetBinding(Label.TextProperty, "TotalLitros");
            Total.BindingContext = elegido;

            Diesel.SetBinding(Label.TextProperty, "OracionDiesel");
            Diesel.BindingContext = elegido;

            Premium.SetBinding(Label.TextProperty, "OracionPremium");
            Premium.BindingContext = elegido;

            Magna.SetBinding(Label.TextProperty, "OracionMagna");
            Magna.BindingContext = elegido;


            ValorAutanque.SetBinding(Label.TextProperty, "Autotanque");
            ValorAutanque.BindingContext = elegido;

            FechaRegistro.SetBinding(Label.TextProperty, "OracionRegistro");
            FechaRegistro.BindingContext = elegido;
        }
Esempio n. 12
0
        private void GetFolio()
        {
            DataTable dt    = new DataTable();
            Folio     folio = new Folio();

            Params.Clear();
            Data.DataModule.ParamByName(Params, "Datos", "MovimientoAlmacen");
            Data.DataModule.FillDataSet(spCatFolioDS, "spCatFolio", Params.ToArray());
            dt            = spCatFolioDS.Tables["spCatFolio"];
            txtFolio.Text = Convert.ToString(folio.FillList(dt));
        }
Esempio n. 13
0
        public Venta Add(Venta venta)
        {
            Folio folio = context.Folios.Where(f => f.descripcion == "Remision").SingleOrDefault();

            folio.valor++;
            context.Update(folio);
            venta.folio = folio.valor;
            venta       = context.Add(venta).Entity;
            context.SaveChanges();
            return(venta);
        }
 public ActionResult Create(Folio model)
 {
     try
     {
         FolioBusiness.Add(model);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
        public async Task <IActionResult> CreateFolio(Folio folio)
        {
            if (folio == null)
            {
                return(BadRequest("Folio object is null"));
            }

            await _repoWrapper.Folio.CreateFolioAsync(folio);

            _repoWrapper.Save();

            return(CreatedAtRoute("GetFolio", new { id = folio.Id }, folio));
        }
 public TicketDeliveredBuilder(Folio folio, Detail detail, ISettingsModel settingsModel)
 {
     this.folio  = folio;
     this.detail = detail;
     ticket      = new TicketDocument("Servitec: ticket de entrega", 8, 45 - 7)
     {
         Logo            = Properties.Resources.logotipo,
         PrinterSettings = new PrinterSettings()
         {
             PrinterName = settingsModel.PRINT_printer
         }
     };
 }
 public TicketReceiptBuilder(Folio folio, ICollection <Issue> issues, ISettingsModel settingsModel)
 {
     this.folio  = folio;
     this.issues = issues;
     ticket      = new TicketDocument("Servitec: ticket de recepción", 8, 45 - 7)
     {
         Logo            = Properties.Resources.logotipo,
         PrinterSettings = new PrinterSettings()
         {
             PrinterName = settingsModel.PRINT_printer
         }
     };
 }
 public ActionResult Delete(Folio model)
 {
     try
     {
         // TODO: Add delete logic here
         FolioBusiness.Delete(model);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Esempio n. 19
0
        public override string ToString()
        {
            string cadena = "";

            cadena += Cliente.ToString() + "\n";
            cadena += "Pedido: " + Folio.ToString() + " Subtotal: " + Subtotal.ToString("C") +
                      " Iva: " + MontoIva.ToString("C") + " MontoIeps: " + MontoIeps.ToString("C") +
                      " Total: " + Total.ToString("C") + "\n\n";
            foreach (clsProductosPedido item in Items)
            {
                cadena += item.ToString();
            }
            return(cadena);
        }
        public ActionResult Edit(Folio model)
        {
            try
            {
                // TODO: Add update logic here

                FolioBusiness.Edit(model);
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Esempio n. 21
0
        private void EmpiezaMedir()
        {
            for (int i = 0; i < lst_folios.Items.Count; i++)
            {
                Folio fol = foliosProc.Peek();
                ponerMedidas(fol);
                // se espera con el while hasta que el folio primero de la cola haya sido procesado.
                // cuando la pieza haya sido procesada entonces se sale del while y continua con otra pieza a ser procesada.

                while (!siguientePieza)
                {
                }
                siguientePieza = false;
            }
        }
Esempio n. 22
0
        public ActionResult Index(Folio folio)
        {
            //try
            //{
            //var lista = FolioBusiness.GetFolioList();
            //return View(lista);
            var list = FolioBusiness.BuscarNombre(folio.Nombre, folio.Apellido);

            return(View(list));
            //}
            //catch
            //{
            //    return View();
            //}
        }
Esempio n. 23
0
        public IActionResult Post(Folio folio)
        {
            FolioService folSrv = new FolioService();
            var          res    = new Dictionary <string, Object>();

            try
            {
                folio = folSrv.insertFolio(folio);
                res.Add("folio", folio);
                return(Ok(res));
            }
            catch (Exception e)
            {
                res.Add("message", "Error en el servidor");
                return(StatusCode(500, res));
            }
        }
Esempio n. 24
0
        public bool Equals(Entrada_compartida other)
        {
            //Check whether the compared object is null.
            if (Object.ReferenceEquals(other, null))
            {
                return(false);
            }

            //Check whether the compared object references the same data.
            if (Object.ReferenceEquals(this, other))
            {
                return(true);
            }

            //Check whether the products' properties are equal.
            return(Folio.Equals(other.Folio)); // Folio.Equals(other.fo Code.Equals(other.Code) && Name.Equals(other.Name);
        }
Esempio n. 25
0
        public IActionResult Put(int id, Folio folio)
        {
            FolioService folSrv = new FolioService();
            var          res    = new Dictionary <string, Object>();

            try
            {
                folSrv.updateFolio(folio);
                res.Add("folio", folio);
                return(Ok(res));
            }
            catch
            {
                res.Add("message", "Error en el servidor");
                return(StatusCode(500, res));
            }
        }
Esempio n. 26
0
        private void button1_Click(object sender, EventArgs e)
        {
            btn_iniciar.Enabled  = false;
            btn_terminar.Enabled = true;
            int Milisegundos = Convert.ToInt32("0" + txt_tiempo.Text);

            Milisegundos = (Milisegundos < 1000)?1000:Milisegundos;
            foliosProc   = new Queue <Folio>();

            foreach (object f in lst_folios.Items)
            {
                Folio folio = (Folio)f;
                foliosProc.Enqueue(folio);
                Thread.Sleep(Convert.ToInt32(Milisegundos));
                dg_procesados.Rows.Add(folio.Codigo2D, "Codigo enviado", "Validando Codigo");
                // se coloca en el socket del codigo de la pieza.
                foreach (Socket s in sockets)
                {
                    if (s.TipoR == "2D")
                    {
                        s.Data.Value = folio.Codigo2D;
                        s.Update();
                        break;
                    }
                }
                // ya colocado el codigo de la pieza, procede a decirle a sime que ya puede leer el codigo de la pieza
                foreach (Socket s in sockets)
                {
                    if (s.Clasificacion == "L" && s.TipoR == "P")
                    {
                        s.Data.Value = 1;
                        s.Update();
                        break;
                    }
                }
                // si es modo calibracion solamente una pieza entra a la Estacion.
                if (modo == 1)
                {
                    break;
                }
            }
            // ya que entra la pieza o piezas a la estación, entonces se inicia el proceso de medición de una por una de las que entraron.
            Task tarea = new Task(() => EmpiezaMedir());

            tarea.Start();
        }
Esempio n. 27
0
 private void Frm_DistribucionManual_Shown(object sender, EventArgs e)
 {
     txtFolioPedido.Text     = Folio.ToString();
     txtNombreProveedor.Text = NombreProveedor;
     txtTPedido.Text         = TPedido.ToString();
     txtCodigoArticulo.Text  = CodigoArticulo;
     txtArticuloNombre.Text  = ArticuloDescripcion;
     MakeTablaPedidos();
     dtgValSucursales.OptionsSelection.EnableAppearanceFocusedCell   = false;
     dtgValSucursales.OptionsSelection.EnableAppearanceHideSelection = false;
     dtgValSucursales.OptionsSelection.MultiSelect = true;
     dtgValSucursales.OptionsView.ShowGroupPanel   = false;
     txtFolioPedido.Enabled     = false;
     txtNombreProveedor.Enabled = false;
     txtTPedido.Enabled         = false;
     txtCodigoArticulo.Enabled  = false;
     txtArticuloNombre.Enabled  = false;
 }
        private ICommandResult GetPosition(int positionId, DateTime asOfDate)
        {
            // 15751, 189727
            var dataRetriever = new DataRetriever();

            Folio folio = null;

            // TODO : this is writing to the console
            using (var timeBenchMarker = new TimeBenchmarker("Time : "))
            {
                folio = dataRetriever.GetFolio(positionId, asOfDate);
            }

            if (folio != null)
            {
                return(new PositionResult(folio.Name));
            }
            return(new NoResult());
        }
        public ActionResult Consultar()
        {
            List <eFile> Files = new List <eFile>();

            #region Excel

            eFile        f_excel = new eFile();
            List <Folio> folios  = new List <Folio>();

            for (int i = 0; i < 274; i++)
            {
                Folio folio = new Folio();

                folio.Lote           = 114;
                folio.ContadorLote   = 683;
                folio.Color_Producto = "GRISP";
                folio.Contador       = i + 1;

                folios.Add(folio);
            }

            f_excel.FileStream = Excel.CrearExcelFolios(folios);
            f_excel.FileName   = "folios.xlsx";
            Files.Add(f_excel);
            //return File(FileBytesArray, "application/xlsx", "Folios" + ".xlsx");
            #endregion


            eFile f_pdf = new eFile();
            f_pdf.FileStream = Pdf.CreatePdf(folios);
            f_pdf.FileName   = "folios.pdf";
            Files.Add(f_pdf);



            byte[] FileBytesArray;
            FileBytesArray = Zip.CreateZip(Files);

            //return File(FileBytesArray, "pdf/application", "Folios" + ".pdf");

            return(File(FileBytesArray, "application/octet-stream", "Folios.zip"));
        }
Esempio n. 30
0
        public Detalle_Pedido(string json)
        {
            InitializeComponent();
            elegido = JsonConvert.DeserializeObject <Pedido>(json);

            elegido.TotalLitros    += " Totales";
            elegido.OracionMagna   += " Magna";
            elegido.OracionPremium += " Premium";
            elegido.OracionDiesel  += " Diesel";

            Folio.SetBinding(Label.TextProperty, "Folio_Pedido");
            Folio.BindingContext = elegido;

            ValorEstacion.SetBinding(Label.TextProperty, "Nombre_Estacion");
            ValorEstacion.BindingContext = elegido;

            FechaAgendada.SetBinding(Label.TextProperty, "Fecha_Programada");
            FechaAgendada.BindingContext = elegido;

            Total.SetBinding(Label.TextProperty, "TotalLitros");
            Total.BindingContext = elegido;

            Diesel.SetBinding(Label.TextProperty, "OracionDiesel");
            Diesel.BindingContext = elegido;

            Premium.SetBinding(Label.TextProperty, "OracionPremium");
            Premium.BindingContext = elegido;

            Magna.SetBinding(Label.TextProperty, "OracionMagna");
            Magna.BindingContext = elegido;


            ValorAutanque.SetBinding(Label.TextProperty, "Autotanque");
            ValorAutanque.BindingContext = elegido;

            FechaRegistro.SetBinding(Label.TextProperty, "Fecha_Registro");
            FechaRegistro.BindingContext = elegido;
        }