Exemple #1
0
        public async Task<IHttpActionResult> PutAsync(Patient user)
        {

            IHttpActionResult result = null;

            try
            {
                int modifiedCount = await IPatientManager.RegisterNewOrUpdateDetailsAsync(user);
                if (modifiedCount > 0)
                {
                    result = Ok("User details update succeded");

                }
                else
                {
                    result = Ok("User details update failed.Please retry.");

                }
            }
            catch (Exception ex)
            {
                result = InternalServerError(ex);
            }
            return result;
        }
Exemple #2
0
        public async Task<IHttpActionResult> PostAsync(Patient user)
        {


            IHttpActionResult result = null;
            try
            {
                if (ModelState.IsValid)
                {
                    int modifiedCount = await IPatientManager.RegisterNewOrUpdateDetailsAsync(user);
                    if (modifiedCount > 0)
                    {
                        result = Ok("New user registration succeded");

                    }
                    else
                    {
                        result = Ok("New user registration failed.Please retry.");

                    }
                }
                else
                {
                    result = BadRequest(ModelState);
                }

            }
            catch (Exception ex)
            {
                result = InternalServerError(ex);
            }
            return result;
        }