Пример #1
0
        public async Task LoadCompanyStaticDataAsConstantAsync(IStaticDataRepository staticDataRepo)
        {
            var remarks = await staticDataRepo.LoadRemarkAsync();

            foreach (Remark remark in remarks)
            {
                mcalcEnggine.AddConstant(remark.Code, remark.Value);
            }
        }
Пример #2
0
        private static async Task <int> FindRemarkIdAsync(IStaticDataRepository staticData, string remarkCode)
        {
            if (remarkCode == null)
            {
                return(0);
            }
            else
            {
                var listOfRemark = await staticData.LoadRemarkAsync();

                var remark = listOfRemark.Where(x => x.Code.ToLower().Equals(remarkCode.ToLower()))
                             .FirstOrDefault();
                if (remark != null)
                {
                    return((int)remark.Value);
                }
                else
                {
                    return(0);
                }
            }
        }