Exemple #1
0
        public IHttpActionResult UpdateCustomer(string mobile, Customer customer)
        {
            try
            {
                var customerBO  = new CustomerBO();
                var customerObj = customerBO.GetCustomer(new Customer {
                    MobileNo = mobile
                });
                if (customerObj != null)
                {
                    customerObj.Name     = customer.Name;
                    customerObj.EmailID  = customer.EmailID;
                    customerObj.Password = customer.Password;

                    var result = customerBO.SaveCustomer(customerObj);
                    if (result)
                    {
                        return(Ok(UTILITY.SUCCESSMSG));
                    }
                    else
                    {
                        return(BadRequest());
                    }
                }
                else
                {
                    return(NotFound());
                }
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }