コード例 #1
0
        //public string GetCurrencyAndExchangeRateLists()
        //{
        //    int count = 0;
        //    string C_GUID = Session["CurrentCompanyGuid"].ToString();
        //    string json = new JavaScriptSerializer().Serialize(new CurrencySvc().GetRateHistory(C_GUID, out count));
        //    return json;
        //}

        /// <summary>
        ///
        /// </summary>
        /// <param name="guid"></param>
        /// <param name="date"></param>
        /// <param name="famount"></param>
        /// <param name="fcurrency"></param>
        /// <param name="tamount"></param>
        /// <param name="tcurrency"></param>
        /// <returns></returns>
        public Boolean UpdCurrencyAndExchangeRate(List <T_RateHistory> rateHistory)
        {
            bool   result = false;
            string msg    = string.Empty;
            //T_RateHistory rateHistroy = new T_RateHistory();
            //rateHistroy.GUID = Guid.NewGuid().ToString();
            //rateHistroy.C_GUID = Session["CurrentCompanyGuid"].ToString();
            //rateHistroy.FCurrency = Session["Currency"].ToString();
            //rateHistroy = rate;

            //T_RateHistory form=new T_RateHistory();
            //form.GUID = guid;
            //form.Date = date;
            //form.FAmount = famount;
            //form.FCurrency = fcurrency;
            //form.TAmount = tamount;
            //form.TCurrency = tcurrency;
            CurrencySvc currencyAccount = new CurrencySvc();

            foreach (T_RateHistory account in rateHistory)
            {
                //account.Currency = Session["Currency"].ToString();
                account.GUID      = Guid.NewGuid().ToString();
                account.C_GUID    = Session["CurrentCompanyGuid"].ToString();
                account.FCurrency = Session["Currency"].ToString();
                result            = new CurrencySvc().UpdRateHistory(account);
            }


            return(result);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="guid"></param>
        /// <param name="date"></param>
        /// <param name="famount"></param>
        /// <param name="fcurrency"></param>
        /// <param name="tamount"></param>
        /// <param name="tcurrency"></param>
        /// <returns></returns>
        public string UpdCurrencyAndExchangeRate(string guid, DateTime date, Decimal famount, string fcurrency, Decimal tamount, string tcurrency)
        {
            bool          result = false;
            string        msg    = string.Empty;
            T_RateHistory form   = new T_RateHistory();

            form.GUID      = guid;
            form.Date      = date;
            form.FAmount   = famount;
            form.FCurrency = fcurrency;
            form.TAmount   = tamount;
            form.TCurrency = tcurrency;
            form.C_GUID    = Session["CurrentCompany"].ToString();
            result         = new CurrencySvc().UpdRateHistory(form);
            if (result)
            {
                msg = General.Resource.Common.Success;
            }
            else
            {
                msg = General.Resource.Common.Failed;
            }
            return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}"
                                 , result.ToString().ToLower(), msg));
        }
コード例 #3
0
        public string GetSearchCurrency()
        {
            var currencyList = new CurrencySvc().GetCurrency(true);
            var strJson      = ConvertToSelectJson(currencyList, "Code", "Code");

            return(strJson.ToString());
        }
        /// <summary>
        /// 获取费用列表
        /// </summary>
        /// <param name="rows">页大小</param>
        /// <param name="page">页索引</param>
        /// <returns></returns>
        public string GetCurrencyAndExchangeRateList(string rows, string page, string dateBegin, string dateEnd)
        {
            int                  count        = 0;
            string               C_GUID       = Session["CurrentCompany"].ToString();
            string               strFormatter = "{{\"total\":\"{0}\",\"rows\":{1}}}";
            StringBuilder        strJson      = new StringBuilder();
            List <T_RateHistory> List         = new List <T_RateHistory>();

            List = new CurrencySvc().GetRateHistory(C_GUID, int.Parse(page), int.Parse(rows), out count, dateBegin, dateEnd);
            strJson.AppendFormat(strFormatter, count, new JavaScriptSerializer().Serialize(List));
            return(strJson.ToString());
        }
コード例 #5
0
        /// <summary>
        /// 获取费用列表
        /// </summary>
        /// <param name="rows">页大小</param>
        /// <param name="page">页索引</param>
        /// <returns></returns>
        ///

        public string CheckRate(string TCurrency, string Date)
        {
            bool   result             = false;
            int    count              = 0;
            string C_GUID             = Session["CurrentCompanyGuid"].ToString();
            string FCurrency          = Session["Currency"].ToString();
            List <T_RateHistory> List = new List <T_RateHistory>();

            List = new CurrencySvc().CheckRate(C_GUID, out count, FCurrency, TCurrency, Date);
            if (List.Count > 0)
            {
                result = true;
            }
            return(new JavaScriptSerializer().Serialize(result));
        }
コード例 #6
0
        /// <summary>
        /// 获取常用币值
        /// </summary>
        /// <returns></returns>
        public string GetCommonCurrency()
        {
            //string strFormatter = "{{\"label\":\"{0}\",\"value\":\"{1}\"}},";
            //StringBuilder strJson = new StringBuilder("[");
            //foreach (T_Currency item in new CurrencySvc().GetCurrency(true))
            //{
            //    strJson.AppendFormat(strFormatter, item.Code, item.Code);
            //}
            //strJson.AppendFormat(strFormatter, General.Resource.Common.More, -1);
            //strJson.Remove(strJson.Length - 1, 1);
            //strJson.Append("]");
            var currencyList = new CurrencySvc().GetCurrency(true);
            var strJson      = ConvertToSelectJson1(currencyList, "Code", "Code");

            return(strJson.ToString());
        }
コード例 #7
0
        public string GetCurrencyAndExchangeRateList(string current)
        {
            string C_GUID             = Session["CurrentCompanyGuid"].ToString();
            string FCurrency          = (new CompanySvc().GetCompanyCurrceny(Session["CurrentCompanyGuid"].ToString()).FirstOrDefault()).Code;
            List <T_RateHistory> List = new List <T_RateHistory>();

            List = new CurrencySvc().GetRateHistory(C_GUID, current, FCurrency);
            for (int i = 0; i < List.Count(); i++)

            {
                if (List[i].FCurrency != null && List[i].FCurrency != "")
                {
                    List[i].VarString = List[i].FAmount + List[i].FCurrency + "=" + List[i].TAmount + List[i].TCurrency;
                }
                else
                {
                    List[i].VarString = "";
                }
            }
            ;
            string json = new JavaScriptSerializer().Serialize(List);

            return(json);
        }