public ResponseForm <string> Update(DoNotCallList DO_NOT_CALL_LIST, string REGION_ID_C)
 {
     try
     {
         if (string.IsNullOrEmpty(DO_NOT_CALL_LIST.ID) || DO_NOT_CALL_LIST.ID == "00000000-0000-0000-0000-000000000000")
         {
             DO_NOT_CALL_LIST.ID = Guid.NewGuid().ToString();
         }
         string id = DO_NOT_CALL_LIST.ID;
         UpdateDoNotCallList(DO_NOT_CALL_LIST, REGION_ID_C);
         if (DO_NOT_CALL_LIST.IS_REASON)
         {
             IEnumerable <CallReasonDto> vwCallReason = GetvwCallReason(DO_NOT_CALL_LIST.CAMPAIGN_CATEGORY_ID_C, REGION_ID_C);
             if (vwCallReason != null)
             {
                 foreach (CallReasonDto callReason in vwCallReason)
                 {
                     DO_NOT_CALL_LIST.ID = Guid.NewGuid().ToString();
                     Console.WriteLine(DO_NOT_CALL_LIST.ID);
                     DO_NOT_CALL_LIST.CALL_REASON_ID         = callReason.ID.ToString();
                     DO_NOT_CALL_LIST.DURATION               = callReason.DURATION.ToString();
                     DO_NOT_CALL_LIST.CAMPAIGN_CATEGORY_ID_C = callReason.CAMPAIGN_CATEGORY_ID.ToString();
                     UpdateDoNotCallList(DO_NOT_CALL_LIST, REGION_ID_C);
                 }
             }
         }
         return(new ResponseForm <string>(id));
     }
     catch (Exception e)
     {
         return(new ResponseForm <string>(string.Empty, e.Message, 600));
     }
 }
Ejemplo n.º 2
0
        public IActionResult Update([FromBody] DoNotCallList DO_NOT_CALL_LIST)
        {
            DO_NOT_CALL_LIST.MODIFIED_USER_ID = User.FindFirst(ClaimTypes.NameIdentifier).Value;
            var response = _doNotCallListRepository.Update(DO_NOT_CALL_LIST, User.FindFirst(ClaimTypes.StateOrProvince).Value);
            var json     = JsonConvert.SerializeObject(response);

            return(Content(json, "application/json"));
        }
        void UpdateDoNotCallList(DoNotCallList DO_NOT_CALL_LIST, string REGION_ID_C)
        {
            DynamicParameters param = new DynamicParameters();

            param.Add("@ID", new Guid(DO_NOT_CALL_LIST.ID));
            param.Add("@MODIFIED_USER_ID", new Guid(DO_NOT_CALL_LIST.MODIFIED_USER_ID));
            param.Add("@@CUSTOMER_NAME", DO_NOT_CALL_LIST.CUSTOMER_NAME);
            param.Add("@CUSTOMER_ID", DO_NOT_CALL_LIST.CUSTOMER_ID);
            param.Add("@PHONE_NUMBER", DO_NOT_CALL_LIST.PHONE_NUMBER);
            param.Add("@IDENTITY_NUMBER", DO_NOT_CALL_LIST.IDENTITY_NUMBER);
            param.Add("@CAMPAIGN_CATEGORY_ID_C", new Guid(DO_NOT_CALL_LIST.CAMPAIGN_CATEGORY_ID_C));
            param.Add("@CALL_REASON_ID", DO_NOT_CALL_LIST.CALL_REASON_ID);
            param.Add("@NOTE", DO_NOT_CALL_LIST.NOTE);
            param.Add("@DURATION", DO_NOT_CALL_LIST.DURATION);
            param.Add("@IS_CHECK_C", DO_NOT_CALL_LIST.IS_CHECK_C);
            DapperORM.ExecuteWithoutReturn("spDO_NOT_CALL_LIST_Update", param);
        }