示例#1
0
        /// <summary>
        /// 删除一个项目
        /// </summary>
        /// <param name="id">项目ID</param>
        /// <returns></returns>
        public JsonResult DeleteProject(int id)
        {
            bool deletereturn = db.Delete(id);

            if (deletereturn == true)
            {
                return(Json("yes"));
            }
            else
            {
                return(Json(null));
            }
        }
示例#2
0
        public ActionResult DeleteConfirmed(
            Int32?ProjectID
            )
        {
            Project Project = new Project();

            Project.ProjectID = System.Convert.ToInt32(ProjectID);
            Project           = ProjectData.Select_Record(Project);

            bool bSucess = false;

            bSucess = ProjectData.Delete(Project);
            if (bSucess == true)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ModelState.AddModelError("", "Can Not Delete");
            }
            return(null);
        }