Example #1
0
        public ActionResult DetailsSubs(long id)
        {
            var subscr = NHSubscriptionRepository.Get(id);
            var opers  = NHOperationRepository.GetBySubscription(subscr);

            return(View(opers));
        }
Example #2
0
        public ActionResult DeleteSubs(long id)
        {
            var subs = NHSubscriptionRepository.Get(id);

            if (subs == null)
            {
                return(RedirectToAction("Subscr"));
            }
            HttpCookie cookieReq = Request.Cookies["currentUserId"];
            string     tmp       = null;

            if (cookieReq != null)
            {
                tmp = cookieReq.Value;
            }
            long currentUserId = Convert.ToInt64(tmp);
            var  user          = UserRepository.Get(currentUserId);
            var  UserSubs      = NHUserSubsRepository.UserSubsByIdUserIdSubs(subs.Id, user);

            NHUserSubsRepository.Delete(UserSubs.Id);
            return(RedirectToAction("Index"));
        }