Exemplo n.º 1
0
        public async Task <TipoCambioMoneda> ObtenerIdTipoCambio(string monedaOrigen, string monedaDestino)
        {
            var result         = new TipoCambioMoneda();
            var listTipoCampio = _context.TipoCambioMoneda.ToList();

            if (listTipoCampio.Any(x => x.MonedaOrigen == monedaOrigen && x.MonedaDestino == monedaDestino))
            {
                result = listTipoCampio.First(x => x.MonedaOrigen == monedaOrigen && x.MonedaDestino == monedaDestino);
            }
            return(await Task.Run(() => result));
        }
Exemplo n.º 2
0
        public async Task <string> GuardarTipoCambio(TipoCambioMoneda moneda, bool isModify)
        {
            string result = "OK";

            try {
                if (isModify)
                {
                    _context.Entry(moneda).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
                }
                else
                {
                    _context.TipoCambioMoneda.Add(moneda);
                }
                _context.SaveChanges();
            }
            catch (Exception ex)
            {
                result = ex.Message;
            }
            return(await Task.Run(() => result));
        }
Exemplo n.º 3
0
        private void createElements(int y, TipoCambioMoneda param)
        {
            ///
            /// lblEfectivoName
            ///
            Label lblEfectivoName = new System.Windows.Forms.Label()
            {
                AutoSize  = true,
                Font      = new System.Drawing.Font("Arial Narrow", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))),
                ForeColor = Color.FromArgb(84, 110, 122),
                Location  = new System.Drawing.Point(13, y),
                Name      = "lblEfectivoName",
                Size      = new System.Drawing.Size(44, 16),
                TabIndex  = 10,
                Text      = param.moneda,
            };

            ///
            /// lblEfectivoValue
            ///
            Label lblEfectivoValue = new System.Windows.Forms.Label()
            {
                AutoSize  = true,
                ForeColor = System.Drawing.SystemColors.ControlDarkDark,
                Location  = new System.Drawing.Point(150, y),
                Name      = "lblEfectivoValue",
                Size      = new System.Drawing.Size(65, 13),
                TabIndex  = 11,
                Text      = String.Format("{0:0.00}", param.cambio)
            };

            ///
            /// Add Controls
            ///
            panelMenuRight.Controls.Add(lblEfectivoName);
            panelMenuRight.Controls.Add(lblEfectivoValue);
        }