示例#1
0
        public async Task <IActionResult> UpdatePhoneNumber(MobileInformation request)
        {
            if (request.isConsent != true)
            {
                dc = new Dictionary <string, string>();
                dc.Add("refCode", "");
                dc.Add("result", "กรุณายืนยันความถูกต้องของข้อมูล");
                return(BadRequest(dc));
            }
            string msg = "";

            result = new ResultUpdate();
            acc.REST_KeepLogRequest("request", func.JsonSerialize(request));
            if (string.IsNullOrEmpty(request.NewPhoneNumber) || string.IsNullOrEmpty(request.LineUserID))
            {
                result.phoneNumber = "";
                result.result      = "Data is Empty";
                acc.REST_KeepLogRequest("Data is Empty", func.JsonSerialize(request));
                return(NotFound(result));
            }
            msg = management.REST_UpdateMobileNumber(request.NewPhoneNumber, request.LineUserID, request.isConsent);
            result.phoneNumber = request.NewPhoneNumber;
            result.result      = msg;
            return(Ok(result));
        }