Example #1
0
        public ResultDTO DeleteGetResponseInfoByID(GetResponseConfigRequestDTO obj)
        {
            ResultDTO result = new ResultDTO();

            try
            {
                result = _repository.DeleteGetResponseInfoByID(obj);
            }
            catch (Exception ex)
            {
                Utilities.AppLog.WriteLog("DeleteGetResponseInfoByID", ActionType.Update, ex.Message.ToString(), obj.SessionKey);
                result.StatusCode = Utilities.Common.ConvertErrorCodeToInt(RetCode.ECS9999);
                result.StatusMsg  = ex.Message.ToString();
            }
            return(result);
        }
Example #2
0
 public HttpResponseMessage DeleteGetResponseInfoByID(HttpRequestMessage request, GetResponseConfigRequestDTO obj)
 {
     return(CreateHttpResponse(request, () =>
     {
         HttpResponseMessage response;
         response = request.CreateResponse(HttpStatusCode.OK, _service.DeleteGetResponseInfoByID(obj));
         return response;
     }));
 }
        public static ResultDTO DeleteGetResponseInfoByID(this IEntityBaseRepository <Account> repository, GetResponseConfigRequestDTO obj)
        {
            var result    = new ResultDTO();
            var dbContext = new ApplicationContext();

            var errorCode = new SqlParameter("ErrorCode", System.Data.SqlDbType.Int)
            {
                Direction = System.Data.ParameterDirection.Output
            };

            dbContext.Database.ExecuteSqlCommand("EXEC [dbo].[sp_DeleteGetResponseInfoByID] @ID,@SessionKey,@errorCode out",
                                                 new SqlParameter("ID", obj.ID),
                                                 new SqlParameter("SessionKey", DB.SafeSQL(obj.SessionKey)),
                                                 errorCode);
            result.StatusCode = int.Parse(errorCode.Value.ToString(), 0);
            result.SetContentMsg();

            return(result);
        }