Beispiel #1
0
        public ActionResult DeletePostConfirmed(int id)
        {
            InvoicePosts post = db.InvoicePosts.Find(id);

            db.InvoicePosts.Remove(post);
            db.SaveChanges();
            return(RedirectToAction("Details", new { id = post.InvoiceID }));
        }
Beispiel #2
0
        // GET: InvoicePosts/Delete/5
        public ActionResult DeletePost(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            InvoicePosts post = db.InvoicePosts.Find(id);

            if (post == null)
            {
                return(HttpNotFound());
            }
            return(View(post));
        }
Beispiel #3
0
        public ActionResult _AddPost(int postID)
        {
            ViewBag.ContractPosts = GetContractPosts();

            var newPost = new InvoicePosts();

            InvoiceModelNEAS invoiceModel = db.InvoiceNEAS.Find(postID); //Change names here

            newPost.InvoiceID = invoiceModel.ID;                         // this will be sent from the ArticleDetails View, hold on :).

            return(View());

            //return RedirectToAction("Details", new { id = newPost.InvoiceID });
        }
Beispiel #4
0
        public ActionResult _AddPost(InvoicePosts contractPost, string selectedContractPost)
        {
            ViewBag.ContractPosts = GetContractPosts();

            if (ModelState.IsValid)
            {
                //var curUser = GetCurrentUser();
                //hour.user = curUser;

                contractPost.ContractPostID = System.Convert.ToInt32(selectedContractPost);
                contractPost.InvoiceID      = currentInvoiceModel.ID;

                db.InvoicePosts.Add(contractPost);

                db.SaveChanges();

                return(View());
            }

            return(View());
        }