Exemple #1
0
        public XiaMenQBiNotice()
        {
            m_logFactory = new LoggerFactory();
            m_logFactory.AddConsole();
            m_logger   = m_logFactory.CreateLogger <XiaMenQBiNotice>();
            m_httpTool = new HttpTool(m_logger);
            CurrentOrderTemplateModel = DBHelper.GetOrderTemplateList().Where(p => p.TemplateName == TemplateName).First();
            String noticeParamn = CurrentOrderTemplateModel.NoticeParam.Replace(CurrentOrderTemplateModel.NoticeSign, "");

            String[] paramArray = noticeParamn.Split('&');
            foreach (var item in paramArray)
            {
                string[] paramPair = item.Split('=');
                m_ParamKeyList.Add(paramPair[0]);
            }

            string[] signPair = CurrentOrderTemplateModel.NoticeSign
                                .Replace("&", "")
                                .Replace("[", "")
                                .Replace("]", "")
                                .Split('=');
            if (signPair != null && signPair.Length == 2)
            {
                m_signKeyName = signPair[0];
                string[] signArray = signPair[1].Split('+');
                foreach (var item in signArray)
                {
                    m_SignKeyList.Add(item);
                }
            }
        }
        public async Task <string> RenderView <TE>(IGenerableOrderView <TE> generableOrderView,
                                                   string viewDirectory = null,
                                                   string viewName      = null) where TE : Entity
        {
            var fullTypeName = typeof(TE).FullName;
            var entityName   = typeof(TE).Name.Replace("Entity", "");

            if (!typeof(IOrderedEntity).IsAssignableFrom(typeof(TE)))
            {
                Console.WriteLine("Skipping 'ReOrder' view generation. '" + fullTypeName +
                                  "' does not implement IOrderedEntity");
                return(null);
            }

            var vm = new OrderTemplateModel(fullTypeName, entityName, entityName);

            return(await RenderGenericView(vm, viewName, viewDirectory));
        }