2012-12-09 3 views
0

이 같은 함수가 필요하지만 올바른 구문이 없습니다. 그렇다면이 함수의 모든 의미를 지키고 싶다면이 오류를 어떻게 수정해야합니까?redirecttoaction을 이미 반환하지만 모든 코드 경로가 값을 반환하지는 않습니다.

public ActionResult Permission(long? id) 
    { 

      if (id == null) 
       throw new ApplicationException("Không có mục này. Bạn hãy chọn mục khác!"); 
      Shipping shipping = ShippingRepository.RetrieveById(id.Value); 
      if (shipping == null) 
       throw new ApplicationException("Không có mục này. Vui lòng chọn cái khác!"); 
      User _user = null; 
      _user = UserRepository.RetrieveByUserID(shipping.OwnerId); 
      if (DateTime.Now >= _user.Profiles.AccExpriedDate) 
       Acc_Payment(_user.UserId); 
      else 
       return RedirectToAction("Details", "Shipping"); 

    } 

답변

2

아래 블록에는 값을 반환하지 않습니다.

if (DateTime.Now >= _user.Profiles.AccExpriedDate) 
{ 
    Acc_Payment(_user.UserId); 
    //return an ActionResult here 
}  
else 
    return RedirectToAction("Details", "Shipping"); 
+0

Love u, :) 수정되었습니다. –

관련 문제