public ActionResult DeleteConfirmed(int id)
        {
            cm_contractor cm_contractor = db.cm_contractor.Find(id);

            db.cm_contractor.Remove(cm_contractor);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult Edit([Bind(Include = "id,creditor_acct,trade,address,telp,cp_name,user_id,audit_date")] cm_contractor cm_contractor)
        {
            if (ModelState.IsValid)
            {
                cm_contractor.audit_date = DateTime.Now;
                cm_contractor.user_id    = int.Parse(User.Identity.Name);

                db.Entry(cm_contractor).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.user_id = new SelectList(db.ass_user, "id", "username", cm_contractor.user_id);
            return(View(cm_contractor));
        }
        // GET: AssContractor/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            cm_contractor cm_contractor = db.cm_contractor.Find(id);

            if (cm_contractor == null)
            {
                return(HttpNotFound());
            }
            return(View(cm_contractor));
        }
        // GET: AssContractor/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            cm_contractor cm_contractor = db.cm_contractor.Find(id);

            if (cm_contractor == null)
            {
                return(HttpNotFound());
            }
            ViewBag.user_id = new SelectList(db.ass_user, "id", "username", cm_contractor.user_id);
            return(View(cm_contractor));
        }