// POST: /BuyerInfo/Delete/5
        //[HttpPost, ActionName("Delete")]
        //[ValidateAntiForgeryToken]
        public ActionResult DeleteConfirmed(short id)
        {
            MER_COMPCODE mer_compcode = db.MER_COMPCODE.Find(id);

            db.MER_COMPCODE.Remove(mer_compcode);
            db.SaveChanges();
            TempData["msg"] = "<script>alert('Deleted Buyer Information Succesfully !!');</script>";
            return(RedirectToAction("Index"));
        }
        // GET: /BuyerInfo/Details/5
        public ActionResult Details(short?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MER_COMPCODE mer_compcode = db.MER_COMPCODE.Find(id);

            if (mer_compcode == null)
            {
                return(HttpNotFound());
            }
            return(View(mer_compcode));
        }
 public ActionResult Edit([Bind(Include = "COMPCD,COMPTYPE,COMPNM,SHORTNM,ADDRS1,ADDRS2,CONCD,POSTCODE,PHONE,FAX,EMAIL,CONPER,BHCD,STATUS,ATTN,CC,REF,TERRITORY,INSERTBY,INSERTDT,UPDATEBY,UPDATEDT")] MER_COMPCODE mer_compcode)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mer_compcode).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CONCD     = new SelectList(db.CMN_COUNTRY, "CONCD", "CONNM", mer_compcode.CONCD);
     ViewBag.BHCD      = new SelectList(db.MER_COMPCODE, "COMPCD", "COMPTYPE", mer_compcode.BHCD);
     ViewBag.Territory = new SelectList(bdmodel.TerritoryList, "Value", "Text", mer_compcode.TERRITORY);
     ViewBag.Status    = new SelectList(bdmodel.StatusList, "Value", "Text", mer_compcode.STATUS);
     ViewBag.COMPTYPE  = new SelectList(bdmodel.ComTypeList, "Value", "Text", mer_compcode.COMPTYPE);
     return(View(mer_compcode));
 }
        // GET: /BuyerInfo/Edit/5
        public ActionResult Edit(short?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MER_COMPCODE mer_compcode = db.MER_COMPCODE.Find(id);

            if (mer_compcode == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CONCD     = new SelectList(db.CMN_COUNTRY, "CONCD", "CONNM", mer_compcode.CONCD);
            ViewBag.BHCD      = new SelectList(db.MER_COMPCODE, "COMPCD", "COMPTYPE", mer_compcode.BHCD);
            ViewBag.Territory = new SelectList(bdmodel.TerritoryList, "Value", "Text", mer_compcode.TERRITORY);
            ViewBag.Status    = new SelectList(bdmodel.StatusList, "Value", "Text", mer_compcode.STATUS);
            ViewBag.COMPTYPE  = new SelectList(bdmodel.ComTypeList, "Value", "Text", mer_compcode.COMPTYPE);
            return(View(mer_compcode));
        }