コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ErrorCodeTable errorCodeTable = db.ErrorCodeTable.Find(id);

            db.ErrorCodeTable.Remove(errorCodeTable);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "ID,ErrorCode,ErrorDefine,Department,Company")] ErrorCodeTable errorCodeTable)
 {
     if (ModelState.IsValid)
     {
         db.Entry(errorCodeTable).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(errorCodeTable));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "ID,ErrorCode,ErrorDefine,Department,Company")] ErrorCodeTable errorCodeTable)
        {
            if (ModelState.IsValid)
            {
                db.ErrorCodeTable.Add(errorCodeTable);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(errorCodeTable));
        }
コード例 #4
0
        // GET: ErrorCodeTables/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ErrorCodeTable errorCodeTable = db.ErrorCodeTable.Find(id);

            if (errorCodeTable == null)
            {
                return(HttpNotFound());
            }
            return(View(errorCodeTable));
        }
コード例 #5
0
        public ActionResult CreateErrorCodePost([Bind(Include = "ID,ErrorCode,ErrorDefine,Department,Company")] ErrorCodeTable errorCodeTable)
        {
            Common common = new Common();

            errorCodeTable.Company = common.getCurrentUserModel().Company;
            if (ModelState.IsValid)
            {
                db.ErrorCodeTable.Add(errorCodeTable);
                db.SaveChanges();
                return(Redirect(HttpContext.Request.UrlReferrer.AbsoluteUri));
            }

            return(Redirect(HttpContext.Request.UrlReferrer.AbsoluteUri));
        }
コード例 #6
0
        // GET: ErrorCodeTables/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ErrorCodeTable errorCodeTable = db.ErrorCodeTable.Find(id);

            if (errorCodeTable == null)
            {
                return(HttpNotFound());
            }

            ViewBag.DepartmentList = dropDownManager.getDepartmentDropDownList(); // department listesi atanır dropdown için
            return(View(errorCodeTable));
        }
コード例 #7
0
 /// <summary>
 /// Check if HRESULT value is a OneNote API Error Code.
 /// </summary>
 /// <param name="errorCode">An Exception.HResult property value.</param>
 /// <returns>True if value is a OneNote API error code; false otherwise.</returns>
 internal static bool IsErrorCode(HRESULT errorCode) =>
 ErrorCodeTable.ContainsKey(errorCode);