Ejemplo n.º 1
0
        public ActionResult Editmax([Bind(Include = "ID,width,mainCategoryID,maxArchiveNo,maxRegisNo")] gxMaxArchiveRegisNo max, string action)
        {
            if (action == "修改")
            {
                if (ModelState.IsValid)
                {
                    bb.Entry(max).State = EntityState.Modified;
                    bb.SaveChanges();
                    return(Content("<script>alert('已成功保存修改!');window.location.href='/gxCodeManagement/maxArchiveRegisNo'</script>"));
                }
            }
            if (action == "删除")
            {
                if (ModelState.IsValid)
                {
                    bb.Entry(max).State = EntityState.Deleted;
                    bb.SaveChanges();
                    return(Content("<script>alert('已成功删除该信息!');window.location.href='/gxCodeManagement/maxArchiveRegisNo'</script>"));
                }
            }
            if (action == "返回")
            {
                return(RedirectToAction("maxArchiveRegisNo"));
            }


            return(View(max));
        }
Ejemplo n.º 2
0
        public ActionResult CreateNewClass(string id)
        {
            var maxno = from ad in bb.gxMaxArchiveRegisNo
                        orderby ad.ID descending
                        select ad;
            gxMaxArchiveRegisNo Maxno = new gxMaxArchiveRegisNo();

            Maxno.ID = maxno.First().ID + 1;
            return(View(Maxno));
        }
Ejemplo n.º 3
0
        public ActionResult CreateNewClass([Bind(Include = "ID,width,mainCategoryID,maxArchiveNo,maxRegisNo")] gxMaxArchiveRegisNo maxarchive, string action)
        {
            gxMaxArchiveRegisNo max = new gxMaxArchiveRegisNo();

            max.ID             = maxarchive.ID;
            max.mainCategoryID = maxarchive.mainCategoryID;
            max.maxArchiveNo   = maxarchive.maxArchiveNo;
            max.maxRegisNo     = maxarchive.maxRegisNo;

            if (action == "添加")
            {
                if (ModelState.IsValid)
                {
                    bb.gxMaxArchiveRegisNo.Add(max);
                    bb.SaveChanges();
                    return(Content("<script>alert('已成功保存修改!');window.location.href='/gxCodeManagement/maxArchiveRegisNo'</script>"));
                }
            }
            if (action == "返回")
            {
                return(RedirectToAction("maxArchiveRegisNo"));
            }
            return(View(max));
        }