Exemple #1
0
        public HttpResponseMessage DeleteEmployeelocations([FromBody] PickuplocModel objPickuplocModel)
        {
            var re      = Request;
            var headers = re.Headers;

            if (headers.Contains("token"))
            {
                token = headers.GetValues("token").First();
            }
            var result = Authtoken.checkToken(token);

            if (result == true)
            {
                objemployeeDL.deletePickuplocation(objPickuplocModel);

                var resp = Request.CreateResponse <ResponseModel>(HttpStatusCode.OK,
                                                                  new ResponseModel()
                {
                    message = "location Deleted sucessfully", statuscode = Convert.ToInt16(HttpStatusCode.OK)
                });
                return(resp);
            }


            else
            {
                var resp = Request.CreateResponse <ResponseModel>(HttpStatusCode.OK, new ResponseModel()
                {
                    message = "UnAuthorized", statuscode = Convert.ToInt16(HttpStatusCode.OK), error = true
                });
                return(resp);
            }
        }