Example #1
0
        public async Task <ActionResult> PostToF88([FromBody] Entity.F88Model.LadipageModel model)
        {
            var f88Service = new F88Service.F88Service();
            var result     = await f88Service.LadipageReturnID(model);

            if (result.Success)
            {
                return(ToJsonResponse(true, null, result));
            }
            return(ToJsonResponse(false, result.Message, null));
        }
Example #2
0
        public async Task <JsonResult> SendToF88(int hosoId, string customerName, string phone, string provinceName, string district, string link = null)
        {
            if (hosoId <= 0)
            {
                return(ToJsonResponse(false, "Mã hồ sơ không hợp lệ"));
            }
            if (string.IsNullOrWhiteSpace(customerName))
            {
                return(ToJsonResponse(false, "Tên khách hàng không được bỏ trống"));
            }
            if (string.IsNullOrWhiteSpace(phone))
            {
                return(ToJsonResponse(false, "Số điện thoại khách hàng không được bỏ trống"));
            }
            if (!string.IsNullOrWhiteSpace(district))
            {
                if (district.Contains("Huyện"))
                {
                    district = district.Replace("Huyện", "").Trim();
                }
                if (district.Contains("Quận"))
                {
                    district = district.Replace("Quận", "").Trim();
                }
                if (district.Contains("Thành phố"))
                {
                    district = district.Replace("Thành phố", "").Trim();
                }
                if (district.Contains("Thị xã"))
                {
                    district = district.Replace("Thị xã", "").Trim();
                }
            }
            var f88Service = new F88Service.F88Service();
            var f88Model   = new Entity.F88Model.LadipageModel
            {
                Name          = customerName,
                Phone         = phone,
                Link          = link,
                Select1       = null,
                District      = district,
                Select2       = district + " - " + provinceName,
                TransactionId = hosoId,
                ReferenceType = 0,
                Province      = provinceName
            };
            var result = await f88Service.LadipageReturnID(f88Model);

            return(ToJsonResponse(result.Success, result.Message));
        }