Esempio n. 1
0
        public List <GJ_CURR> getGJ_CURR()
        {
            List <GJ_CURR> lstGJ_CURR = new List <GJ_CURR>();
            GJ_CURR        oGJ_CURR   = new GJ_CURR();

            oGJ_CURR.GJ_ID       = _ID;
            oGJ_CURR.CURRENCY_ID = _CurrencyID;
            oGJ_CURR.AMOUNT      = _Total_DR_Amount;
            oGJ_CURR.SELL_RATE   = _Sell_Rate;
            oGJ_CURR.BUY_RATE    = _Buy_Rate;

            lstGJ_CURR.Add(oGJ_CURR);

            if (_lstCurrencyTracking.Count > 0)
            {
                foreach (MonedaRastreo item in _lstCurrencyTracking)
                {
                    GJ_CURR oGJ_CURR_Trace = new GJ_CURR();

                    oGJ_CURR_Trace.GJ_ID       = _ID;
                    oGJ_CURR_Trace.CURRENCY_ID = item.ID;
                    oGJ_CURR_Trace.AMOUNT      = Math.Round((_Total_DR_Amount / item.SELL_RATE), 2);
                    oGJ_CURR_Trace.SELL_RATE   = item.SELL_RATE;
                    oGJ_CURR_Trace.BUY_RATE    = item.BUY_RATE;

                    lstGJ_CURR.Add(oGJ_CURR_Trace);
                }
            }

            return(lstGJ_CURR);
        }
Esempio n. 2
0
        public List <GJ_CURR> getGJ_CURR()
        {
            List <GJ_CURR> lstGJ_CURR = new List <GJ_CURR>();
            GJ_CURR        oGJ_CURR   = new GJ_CURR();

            oGJ_CURR.GJ_ID       = ID;
            oGJ_CURR.CURRENCY_ID = CURRENCY_ID;
            oGJ_CURR.AMOUNT      = TOTAL_DR_AMOUNT;
            oGJ_CURR.SELL_RATE   = SELL_RATE;
            oGJ_CURR.BUY_RATE    = BUY_RATE;

            lstGJ_CURR.Add(oGJ_CURR);

            if (_lstCurrencyTracking.Count > 0)
            {
                foreach (MonedaRastreo item in _lstCurrencyTracking)
                {
                    GJ_CURR oGJ_CURR_Trace = new GJ_CURR();

                    oGJ_CURR_Trace.GJ_ID       = ID;
                    oGJ_CURR_Trace.CURRENCY_ID = item.ID;
                    oGJ_CURR_Trace.AMOUNT      = Math.Round((TOTAL_DR_AMOUNT / item.SELL_RATE), 2);
                    oGJ_CURR_Trace.SELL_RATE   = item.SELL_RATE;
                    oGJ_CURR_Trace.BUY_RATE    = item.BUY_RATE;

                    lstGJ_CURR.Add(oGJ_CURR_Trace);
                }
            }

            return(lstGJ_CURR);
        }
Esempio n. 3
0
        public void createGJ_CURR(GJ_CURR oGJ_CURR)
        {
            string sCons = string.Empty;

            try
            {
                string query = MapeoQuerySql.ObtenerPorId("AdminGeneralJournal.createGJ_CURR");

                sCons = string.Format(query, oGJ_CURR.GJ_ID, oGJ_CURR.CURRENCY_ID, oGJ_CURR.AMOUNT, oGJ_CURR.SELL_RATE, oGJ_CURR.BUY_RATE);

                _trace.AppendLine(sCons);
                _oSQL.EjecutarDML(sCons);
            }
            catch (Exception ex)
            {
                throw new Exception("Error al insertar en GJ_CURR. Detalle: " + ex.Message);
            }
        }