public Zhongyao Create(ZhongyaoCreateInfo createInfo) { ZhongyaoInfo zhongyaoInfo = ObjectMapperHelper.Map<ZhongyaoInfo>(createInfo); zhongyaoInfo.Id = Guid.NewGuid().ToString(); Zhongyao zhongyao = new Zhongyao(zhongyaoInfo); this._dataManager.ZhongyaoDataProvider.Insert(zhongyao); this._coreManager.ZhongyaoManager.Add(zhongyao); return zhongyao; }
public Zhongyao Create(ZhongyaoCreateInfo createInfo) { ZhongyaoInfo zhongyaoInfo = ObjectMapperHelper.Map <ZhongyaoInfo>(createInfo); zhongyaoInfo.Id = Guid.NewGuid().ToString(); Zhongyao zhongyao = new Zhongyao(zhongyaoInfo); this._dataManager.ZhongyaoDataProvider.Insert(zhongyao); this._coreManager.ZhongyaoManager.Add(zhongyao); return(zhongyao); }
public void CreateZhongyao(string content, string url) { ZhongyaoCreateInfo createInfo = new ZhongyaoCreateInfo(); string name = this._nameRegex.Match(content).Groups[1].Value; string bencaoJilu = this._bencaoJiluRegex.Match(content).Groups[1].Value; string[] qiwei = this._qiweiRegex.Match(content).Groups[1].Value.Split(','); string bencaoZhuzhi = this._bencaoZhuzhiRegex.Match(content).Groups[1].Value; createInfo.Name = name; createInfo.BencaoJilu = url+ " " + bencaoJilu; createInfo.Xingwei = string.Join(",", qiwei.Take(qiwei.Length - 1)); createInfo.Duxing = qiwei.Last(); createInfo.BencaoZhuzhi = bencaoZhuzhi; this._serviceManager.ZhongyaoService.Create(createInfo); }
public void CreateZhongyao(string content, string url) { ZhongyaoCreateInfo createInfo = new ZhongyaoCreateInfo(); string name = this._nameRegex.Match(content).Groups[1].Value; string bencaoJilu = this._bencaoJiluRegex.Match(content).Groups[1].Value; string[] qiwei = this._qiweiRegex.Match(content).Groups[1].Value.Split(','); string bencaoZhuzhi = this._bencaoZhuzhiRegex.Match(content).Groups[1].Value; createInfo.Name = name; createInfo.BencaoJilu = url + " " + bencaoJilu; createInfo.Xingwei = string.Join(",", qiwei.Take(qiwei.Length - 1)); createInfo.Duxing = qiwei.Last(); createInfo.BencaoZhuzhi = bencaoZhuzhi; this._serviceManager.ZhongyaoService.Create(createInfo); }