Ejemplo n.º 1
0
 public UserController(UserContext context, ActionResponse actionContext, LogContext logContext, BalanceContext balanceContext)
 {
     _context        = context;
     _actionContext  = actionContext;
     _logContext     = logContext;
     _balanceContext = balanceContext;
 }
Ejemplo n.º 2
0
        public async Task <IActionResult> OnPost(Post post)
        {
            if (ModelState.IsValid)
            {
                if (post.Image != null)
                {
                    //var file = Path.Combine(_hostingEnvironment.ContentRootPath, "uploads");
                }

                using (var db = new BalanceContext())
                {
                    post.CreateDate = DateTime.Now;
                    db.Posts.Add(post);
                    var count = db.SaveChanges();
                    // return success/failure based on adding post
                    // return updated list of posts
                    // clear input form if successful
                }

                var jason = await GetPostImage();

                return(RedirectToPage("Posts"));
            }


            return(Page());
        }
Ejemplo n.º 3
0
 public TopupController(BalanceContext context, LogContext logContext, UserLogContext userLogContext, ActionResponse actionResponse)
 {
     _context        = context;
     _logContext     = logContext;
     _userLogContext = userLogContext;
     _actionResponse = actionResponse;
 }
Ejemplo n.º 4
0
        public IActionResult OnGet(Guid id)
        {
            using (var db = new BalanceContext())
            {
                Post = db.Posts.Find(id);
            }

            return(Page());
        }
Ejemplo n.º 5
0
 public PaymentController(PaymentContext context, ItemContext itemContext, StockContext stockContext, UserContext userContext, ActionResponse actionContext, LogContext logContext, UserLogContext userLogContext, BalanceContext balanceContext)
 {
     _context        = context;
     _itemContext    = itemContext;
     _stockContext   = stockContext;
     _userContext    = userContext;
     _actionContext  = actionContext;
     _logContext     = logContext;
     _userLogContext = userLogContext;
     _balanceContext = balanceContext;
 }
Ejemplo n.º 6
0
 public void OnGet()
 {
     using (var db = new BalanceContext())
     {
         foreach (var p in db.Posts)
         {
             postsList.Add(p);
         }
     }
     postsList.Reverse();
 }