public async Task <ActionResult> Create([Bind(Include = "CustomerId, CustomerCode, Name, ContactPerson, Telephone, MobileNo, EmailAddress, Website, Address1, Address2")] CustomerClientViewModel obj)
        {
            obj.CreatedBy = CookieHelper.EmailAddress;

            var url      = "api/CustomerClient/add";
            var response = await HttpClientHelper.ApiCall(url, Method.POST, obj);

            if (response.StatusCode == HttpStatusCode.Forbidden)
            {
                TempData["Message"]      = obj.CustomerCode + " is already exist! Please check and try again.";
                TempData["MessageAlert"] = "warning";
                return(RedirectToAction("Index"));
            }

            if (response.IsSuccessful)
            {
                TempData["Message"]      = obj.Name + " successfully created!";
                TempData["MessageAlert"] = "success";
                return(RedirectToAction("Index"));
            }
            else
            {
                Error("An error has occurred");
                Log.Error(string.Format(Type.GetType(typeof(CustomerClientController).Name) + "||Create||Customer Client ID::{0}||API Response::{1}", obj.Id, response));
                return(RedirectToAction("Index"));
            }
        }
        public ActionResult Create()
        {
            var obj = new CustomerClientViewModel()
            {
                CustomerId = int.Parse(CookieHelper.CustomerId)
            };

            return(PartialView(obj));
        }
        public async Task <ActionResult> Enable(int?id)
        {
            var obj = new CustomerClientViewModel();
            var url = "api/CustomerClient/GetById/" + id;

            var response = await HttpClientHelper.ApiCall(url, Method.GET);

            if (response.IsSuccessful)
            {
                var result = response.Content;
                obj = JsonConvert.DeserializeObject <CustomerClientViewModel>(result);
            }

            return(PartialView(obj));
        }