public IActionResult ConfigCategoryCampaign([FromBody] ConfigCategoryCampaignDto configCategoryCampaignDto) { var data = _campaignCategoryRepository.ConfigCategoryCampaign(configCategoryCampaignDto, new Guid(User.FindFirst(ClaimTypes.NameIdentifier).Value)); var json = JsonConvert.SerializeObject(data); return(Content(json, "application/app")); }
//thành-sunivy //11/12/2020 public ResponseForm <string> ConfigCategoryCampaign(ConfigCategoryCampaignDto configCategoryCampaignDto, Guid UserId) { try { ResponseCallApi responseCallApi = new ResponseCallApi(); PomRepository pomRepository = new PomRepository(); responseCallApi = pomRepository.ConfigCategoryCampaign(configCategoryCampaignDto.ACW, configCategoryCampaignDto.TIME_CALL, configCategoryCampaignDto.NUMBER_CALL); if (responseCallApi.Code == 1) { return(new ResponseForm <string>(string.Empty, responseCallApi.Message, 400)); } // update table CONFIG_CATEGORY_CAMPAIGN DynamicParameters paramConfigCategoryCampaign = new DynamicParameters(); string queryUpdateConfigCategoryCampaign = @"update CONFIG_CATEGORY_CAMPAIGN set ACW = @ACW, TIME_CALL = @TIME_CALL, NUMBER_CALL = @NUMBER_CALL, MODIFIED_USER_ID = @MODIFIED_USER_ID, DATE_MODIFIED = @DATE_MODIFIED, DATE_MODIFIED_UTC = @DATE_MODIFIED_UTC where ID = @ID"; paramConfigCategoryCampaign.Add("@ACW", configCategoryCampaignDto.ACW); paramConfigCategoryCampaign.Add("@TIME_CALL", configCategoryCampaignDto.TIME_CALL); paramConfigCategoryCampaign.Add("@NUMBER_CALL", configCategoryCampaignDto.NUMBER_CALL); paramConfigCategoryCampaign.Add("@ID", new Guid(configCategoryCampaignDto.ID)); paramConfigCategoryCampaign.Add("@MODIFIED_USER_ID", UserId); paramConfigCategoryCampaign.Add("@DATE_MODIFIED", DateTime.Now); paramConfigCategoryCampaign.Add("@DATE_MODIFIED_UTC", DateTime.UtcNow); DapperORM.ExcecuteNonReturn(queryUpdateConfigCategoryCampaign, paramConfigCategoryCampaign); return(new ResponseForm <string>(configCategoryCampaignDto.ID.ToString())); } catch (Exception e) { return(new ResponseForm <string>(string.Empty, e.Message, 400)); } }