コード例 #1
0
 public ActionResult Edit([Bind(Include = "Id,ParentId,Name,Description,ImageId")] BSIActivityManagement.DAL.AMOrganization Org)
 {
     if (!ModelState.IsValid)
     {
         return(View(Org));
     }
     if (DMLObj.OrganizationEditById(Org))
     {
         return(RedirectToAction("Index", "SysAdmin", new { Org = Org.Id }));
     }
     return(View(Org));
 }
コード例 #2
0
        public ActionResult Delete([Bind(Include = "Id,ParentId,Name,Description,ImageId")] BSIActivityManagement.DAL.AMOrganization Org)
        {
            int CurrentId = 0;

            Int32.TryParse(Org.Id.ToString(), out CurrentId);
            if (CurrentId == 0)
            {
                return(View("Error"));
            }
            if (!DMLObj.OrgHasChild(CurrentId) && !DMLObj.OrgHasDocument(CurrentId) && DMLObj.DeleteOrgById(CurrentId))
            {
                return(RedirectToAction("Index", "SysAdmin"));
            }
            return(View("Error"));
        }