public async Task CreateShopAsync(StockRuleShopDTO input) { using (var context = new O2OContext()) { var service = new BaseService <StockRuleShopEntity>(context); var entity = ToolsCommon.EntityToEntity(input, new StockRuleShopEntity()) as StockRuleShopEntity; service.Add(entity); } }
public async Task <ActionResult> ShopCreate(StockRuleShopDTO input) { //判断门店是否存在 var dto = await _stockRuleService.GetShopAsync(Global.USER_ID, input.ShopNo); if (dto != null) { return(Json(new AjaxResult() { state = "err", msg = "该门店已经设置过模板" })); } await _stockRuleService.CreateShopAsync(input); return(Json(new AjaxResult() { state = "ok" })); }