public async Task <ActionResult> DeleteConfirmed(string id)
        {
            COPR16_MODEL_MSTR cOPR16_MODEL_MSTR = await db.COPR16_MODEL_MSTR.FindAsync(id);

            db.COPR16_MODEL_MSTR.Remove(cOPR16_MODEL_MSTR);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        public async Task <ActionResult> Create([Bind(Include = "MODEL_ID,BRAND_ID,MODEL_DESC,ADATE,CRE_BY,MOD_BY,MOD_DATE,FLGACT")] COPR16_MODEL_MSTR cOPR16_MODEL_MSTR)
        {
            if (ModelState.IsValid)
            {
                db.COPR16_MODEL_MSTR.Add(cOPR16_MODEL_MSTR);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(cOPR16_MODEL_MSTR));
        }
        public async Task <ActionResult> Edit([Bind(Include = "MODEL_ID,BRAND_ID,MODEL_DESC,ADATE,CRE_BY,MOD_BY,MOD_DATE,FLGACT")] COPR16_MODEL_MSTR cOPR16_MODEL_MSTR)
        {
            if (ModelState.IsValid)
            {
                cOPR16_MODEL_MSTR.MOD_BY          = System.Environment.UserName.ToLower();
                cOPR16_MODEL_MSTR.MOD_DATE        = System.DateTime.Now;
                db.Entry(cOPR16_MODEL_MSTR).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(cOPR16_MODEL_MSTR));
        }
        // GET: COPR16_MODEL_MSTR/Details/5
        public async Task <ActionResult> Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            COPR16_MODEL_MSTR cOPR16_MODEL_MSTR = await db.COPR16_MODEL_MSTR.FindAsync(id);

            if (cOPR16_MODEL_MSTR == null)
            {
                return(HttpNotFound());
            }
            return(View(cOPR16_MODEL_MSTR));
        }
        // GET: COPR16_MODEL_MSTR/Edit/5
        public async Task <ActionResult> Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            COPR16_MODEL_MSTR cOPR16_MODEL_MSTR = await db.COPR16_MODEL_MSTR.FindAsync(id);

            if (cOPR16_MODEL_MSTR == null)
            {
                return(HttpNotFound());
            }
            ItemsModel model = new ItemsModel(db);

            model.cOPR16_MODEL_MSTR = cOPR16_MODEL_MSTR;
            //return View(cOPR16_MODEL_MSTR);
            return(View(model));
        }
        // GET: COPR16_MODEL_MSTR/Delete/5
        public async Task <ActionResult> Active(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            COPR16_MODEL_MSTR cOPR16_MODEL_MSTR = await db.COPR16_MODEL_MSTR.FindAsync(id);

            if (cOPR16_MODEL_MSTR == null)
            {
                return(HttpNotFound());
            }
            cOPR16_MODEL_MSTR.FLGACT   = true;
            cOPR16_MODEL_MSTR.MOD_BY   = System.Environment.UserName.ToLower();
            cOPR16_MODEL_MSTR.MOD_DATE = System.DateTime.Now;
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }