示例#1
0
        public IActionResult UpdateGroup(string id, CampaignPickGroupDto campaignGroupDto)
        {
            if (!_validate.IsGuid(id))
            {
                return(StatusCode(400, new
                {
                    message = "ID IS NOT GUID",
                }));
            }
            var userID = User.FindFirst(ClaimTypes.NameIdentifier).Value;
            var data   = _campaign.UpdateGroup(id, campaignGroupDto, userID);
            var json   = JsonConvert.SerializeObject(data);

            return(Content(json, "application/app"));
        }
示例#2
0
        public IActionResult PickGroup([FromBody] CampaignPickGroupDto campaignGroupDto)
        {
            var userID = User.FindFirst(ClaimTypes.NameIdentifier).Value;

            if (string.IsNullOrEmpty(campaignGroupDto.CAMPAIGNS_ID))
            {
                return(StatusCode(400, new { message = "The CAMPAIGNS_ID parameter is required" }));
            }
            if (string.IsNullOrEmpty(campaignGroupDto.NAME))
            {
                return(StatusCode(400, new { message = "The NAME parameter is required" }));
            }
            if (string.IsNullOrEmpty(campaignGroupDto.TSRGROUPS_ID))
            {
                return(StatusCode(400, new { message = "The TSRGROUPS_ID parameter is required" }));
            }
            var data = _campaign.PickGroup(campaignGroupDto, userID);
            var json = JsonConvert.SerializeObject(data);

            return(Content(json, "application/app"));
        }