Пример #1
0
        public JsonResult PaseSalida(string[] articlesid, string folio)
        {
            bool estado = false;

            try
            {
                foreach (var article in articlesid)
                {
                    ReceipArticleDetail receipArticleDetail = db.ReceipArticleDetails.Where(c => c.Id.ToString().Contains(article)).First();
                    receipArticleDetail.Status                = 2;
                    receipArticleDetail.PaseSalida            = folio;
                    receipArticleDetail.FechaEntregaProveedor = DateTime.Now;
                    db.Entry(receipArticleDetail).State       = EntityState.Modified;
                }
                db.SaveChanges();
                estado = true;
            }
            catch (Exception e) { ModelState.AddModelError("RECEIP_ERROR", e.Message); return(new JsonResult()
                {
                    Data = new { estado }
                }); }
            return(new JsonResult {
                Data = new { estado }
            });
        }
Пример #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            ReceipArticleDetail receipArticleDetail = db.ReceipArticleDetails.Find(id);

            db.ReceipArticleDetails.Remove(receipArticleDetail);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #3
0
        public ActionResult Edit([Bind(Include = "Id,ReceipArticleID,ArticleID,Status,Description,ReportedFailure,FechaEntregaUsuario,FechaEntregaProveedor,PaseSalida,FolioBaja")] ReceipArticleDetail receipArticleDetail)
        {
            db.Entry(receipArticleDetail).State = EntityState.Modified;
            db.SaveChanges();
            ViewBag.BOOL = true;

            return(RedirectToAction("Details", "ReceipArticle", new { id = receipArticleDetail.ReceipArticleID }));
        }
Пример #4
0
        public ActionResult Create([Bind(Include = "Id,ReceipArticleID,ArticleID,Status")] ReceipArticleDetail receipArticleDetail)
        {
            if (ModelState.IsValid)
            {
                db.ReceipArticleDetails.Add(receipArticleDetail);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ReceipArticleID = new SelectList(db.ReceipArticles, "Id", "usuarioRecibe", receipArticleDetail.ReceipArticleID);
            return(View(receipArticleDetail));
        }
Пример #5
0
        // GET: ReceipArticleDetail/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ReceipArticleDetail receipArticleDetail = db.ReceipArticleDetails.Find(id);

            if (receipArticleDetail == null)
            {
                return(HttpNotFound());
            }
            return(View(receipArticleDetail));
        }
Пример #6
0
        // GET: ReceipArticleDetail/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ReceipArticleDetail receipArticleDetail = db.ReceipArticleDetails.Find(id);

            if (receipArticleDetail == null)
            {
                return(HttpNotFound());
            }
            ViewBag.USER      = db.Users.Single(b => b.ID == receipArticleDetail.ReceipArticle.usuarioRecibe);
            ViewBag.IdArticle = id;
            return(View(receipArticleDetail));
        }
Пример #7
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ReceipArticleDetail receipArticleDetail = db.ReceipArticleDetails.Find(id);

            if (receipArticleDetail == null)
            {
                return(HttpNotFound());
            }
            ViewBag.BOOL            = false;
            ViewBag.ReceipArticleID = new SelectList(db.ReceipArticles, "Id", "usuarioRecibe", receipArticleDetail.ReceipArticleID);
            return(View(receipArticleDetail));
        }