Ejemplo n.º 1
0
        // GET: Admin/Variable/Details/5
        public async Task <ActionResult> Details(String LINENAME, String PARTNO, String VARNAME)
        {
            ENG_VARIABLES eNG_VARIABLES = await db.ENG_VARIABLES.FindAsync(LINENAME, PARTNO, VARNAME);

            if (eNG_VARIABLES == null)
            {
                return(HttpNotFound());
            }
            return(View(eNG_VARIABLES));
        }
Ejemplo n.º 2
0
        // GET: Admin/Variable
        public async Task <ActionResult> Index(ENG_VARIABLES Query)
        {
            ViewBag.Title    = ModelName;
            ViewBag.SubTitle = "查询";
            ViewBag.Query    = Query;
            await InitSelect(Query.LINENAME);

            return(View(await db.ENG_VARIABLES
                        .Where(l => (String.IsNullOrEmpty(Query.LINENAME) || l.LINENAME.Equals(Query.LINENAME)) &&
                               (String.IsNullOrEmpty(Query.VARNAME) || (l.VARNAME != null && l.VARNAME.IndexOf(Query.VARNAME) > -1)))
                        .ToListAsync()));
        }
Ejemplo n.º 3
0
        public async Task <ActionResult> DeleteConfirmed(String LINENAME, String PARTNO, String VARNAME)
        {
            ViewBag.Title    = ModelName;
            ViewBag.SubTitle = "删除";

            ENG_VARIABLES eNG_VARIABLES = await db.ENG_VARIABLES.FindAsync(LINENAME, PARTNO, VARNAME);

            db.ENG_VARIABLES.Remove(eNG_VARIABLES);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 4
0
        // GET: Admin/Variable/Delete/5
        public async Task <ActionResult> Delete(String LINENAME, String PARTNO, String VARNAME)
        {
            ViewBag.Title    = ModelName;
            ViewBag.SubTitle = "删除";
            ENG_VARIABLES eNG_VARIABLES = await db.ENG_VARIABLES.FindAsync(LINENAME, PARTNO, VARNAME);

            if (eNG_VARIABLES == null)
            {
                return(HttpNotFound());
            }
            return(View(eNG_VARIABLES));
        }
Ejemplo n.º 5
0
        // GET: Admin/Variable/Edit/5
        public async Task <ActionResult> Edit(String LINENAME, String PARTNO, String VARNAME)
        {
            ViewBag.Title    = ModelName;
            ViewBag.SubTitle = "编辑";
            ENG_VARIABLES eNG_VARIABLES = await db.ENG_VARIABLES.FindAsync(LINENAME, PARTNO, VARNAME);

            if (eNG_VARIABLES == null)
            {
                return(HttpNotFound());
            }
            await InitSelect(eNG_VARIABLES.LINENAME, eNG_VARIABLES.PARTNO, eNG_VARIABLES.L_STNO);

            return(View(eNG_VARIABLES));
        }
Ejemplo n.º 6
0
        public async Task <ActionResult> Create([Bind(Include = "LINENAME,PARTNO,VARNAME,VARTYPE,L_STNO,VARDESC,VARVALUE,UPDATETIME")] ENG_VARIABLES eNG_VARIABLES)
        {
            ViewBag.Title    = ModelName;
            ViewBag.SubTitle = "新建";
            if (ModelState.IsValid)
            {
                if (String.IsNullOrEmpty(eNG_VARIABLES.LINENAME))
                {
                    eNG_VARIABLES.LINENAME = "ALL";
                }
                db.ENG_VARIABLES.Add(eNG_VARIABLES);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            await InitSelect(eNG_VARIABLES.LINENAME, eNG_VARIABLES.PARTNO, eNG_VARIABLES.L_STNO);

            return(View(eNG_VARIABLES));
        }