Esempio n. 1
0
 public HttpResponseMessage Delete(string id)
 {
     try
     {
         return(Request.CreateResponse <string>(HttpStatusCode.OK, dta.Delete(id).ToString()));
     }
     catch (Exception e)
     {
         ExceptionHandler.Log(e);
         return(Request.CreateResponse <string>(HttpStatusCode.OK, ""));
     }
 }
Esempio n. 2
0
        public HttpResponseMessage Delete(string userId)
        {
            SqlTransaction tran = DataProvider.beginTrans();

            try
            {
                deleteOldRoles(userId, tran);
                userDT.Delete(userId, tran);
                DataProvider.CommitTrans(tran);
                return(Request.CreateResponse <string>(HttpStatusCode.OK, ""));
            }
            catch (Exception e)
            {
                DataProvider.RollbackTrans(tran);
                ExceptionHandler.Log(e);
                return(null);
            }
        }