示例#1
0
 public Fangji Create(FangjiCreateInfo createInfo)
 {
     FangjiInfo zhongyaoInfo = ObjectMapperHelper.Map<FangjiInfo>(createInfo);
     zhongyaoInfo.Id = Guid.NewGuid().ToString();
     Fangji zhongyao = new Fangji(zhongyaoInfo);
     this._dataManager.FangjiDataProvider.Insert(zhongyao);
     this._coreManager.FangjiManager.Add(zhongyao);
     return zhongyao;
 } 
示例#2
0
        public Fangji Create(FangjiCreateInfo createInfo)
        {
            FangjiInfo zhongyaoInfo = ObjectMapperHelper.Map <FangjiInfo>(createInfo);

            zhongyaoInfo.Id = Guid.NewGuid().ToString();
            Fangji zhongyao = new Fangji(zhongyaoInfo);

            this._dataManager.FangjiDataProvider.Insert(zhongyao);
            this._coreManager.FangjiManager.Add(zhongyao);
            return(zhongyao);
        }
        public void CreateFangji(string content, string url, int index)
        {
            FangjiCreateInfo createInfo = new FangjiCreateInfo();
            string name = this._nameRegex.Match(content).Groups[1].Value;
            string fangjiShuoming = this._fangjiShuomingRegex.Match(content).Groups[1].Value;
            string zhuzhi = this._zhuzhiRegex.Match(content).Groups[1].Value;
            string peifang = this._peifangRegex.Match(content).Groups[1].Value;
            if (string.IsNullOrEmpty(peifang))
            {
                peifang = zhuzhi;
            }
            peifang = peifang.TrimEnd('<');

            createInfo.Name = name;
            createInfo.Beizhu = url+ " " + fangjiShuoming;
            createInfo.Zhuzhi = zhuzhi;
            createInfo.Peifang = peifang;
            createInfo.Index = index;
            createInfo.Chuchu = "太平惠民合剂局";

            this._serviceManager.FangjiService.Create(createInfo);
        }
        public void CreateFangji(string content, string url, int index)
        {
            FangjiCreateInfo createInfo     = new FangjiCreateInfo();
            string           name           = this._nameRegex.Match(content).Groups[1].Value;
            string           fangjiShuoming = this._fangjiShuomingRegex.Match(content).Groups[1].Value;
            string           zhuzhi         = this._zhuzhiRegex.Match(content).Groups[1].Value;
            string           peifang        = this._peifangRegex.Match(content).Groups[1].Value;

            if (string.IsNullOrEmpty(peifang))
            {
                peifang = zhuzhi;
            }
            peifang = peifang.TrimEnd('<');

            createInfo.Name    = name;
            createInfo.Beizhu  = url + " " + fangjiShuoming;
            createInfo.Zhuzhi  = zhuzhi;
            createInfo.Peifang = peifang;
            createInfo.Index   = index;
            createInfo.Chuchu  = "太平惠民合剂局";

            this._serviceManager.FangjiService.Create(createInfo);
        }