예제 #1
0
        public ActionResult CheckTsrInCharge(string id)
        {
            if (!_validate.IsGuid(id))
            {
                return(Ok(new ResponseForm <string>("", "Id must be GUID", 400)));
            }
            bool check = _userRepository.CheckTsrInCharge(id);

            return(Ok(new ResponseForm <bool>(check, "ok", 200)));
        }
예제 #2
0
        public async Task <IActionResult> GetDoNotCallDetail([Required] string id)
        {
            if (!_validate.IsGuid(id))
            {
                return(StatusCode(400, new
                {
                    message = "ID must be GUID",
                }));
            }
            var doNotCall = await _doNotCallListRepository.GetDoNotCallListDetail(id);

            return(Ok(new ResponseForm <object>(doNotCall, "ok", 200)));
        }
예제 #3
0
        public IActionResult UpdateTSR(string id, [FromBody] CampaignTSRDto campaignGroupDto)
        {
            if (!_validate.IsGuid(id))
            {
                return(StatusCode(400, new
                {
                    message = "ID IS NOT GUID",
                }));
            }
            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.GROUP_ID_C))
            {
                return(StatusCode(400, new { message = "The GROUP_ID_C parameter is required" }));
            }
            var data = _campaign.UpdateTSR(id, campaignGroupDto, userID);
            var json = JsonConvert.SerializeObject(data);

            return(Content(json, "application/app"));
        }
        public IActionResult GetDetailCustomer(string id)
        {
            if (!_validate.IsGuid(id))
            {
                return(StatusCode(400, new
                {
                    message = "id IS NOT GUID"
                }));
            }
            var response = _callManagerRepository.GetDetailCustomer(id);
            var json     = JsonConvert.SerializeObject(response);

            return(StatusCode(response.code, json));
        }