/// <summary> /// </summary> /// <param name="Id"></param> /// <param name="flag">0:新增 1: 修改</param> /// <returns></returns> public ActionResult EditNotesSort(int Id = 0, int flag = 0) { var noteSort = new Sys_NotesSort(); if (Id != 0) { noteSort = _notesManager.GetNotesSort(Id); } if (flag == 1) //编辑 选中的接点 { if (noteSort != null) { if (noteSort.ParentID == 0) { ViewBag.ParentName = CurrentTenant.TenantName; } else { Sys_NotesSort temp = _notesManager.GetNotesSort(noteSort.ParentID); if (temp == null) { ViewBag.ParentName = CurrentTenant.TenantName; } else { ViewBag.ParentName = temp.SortName; } } } return(View(noteSort)); } var tempAdd = new Sys_NotesSort(); tempAdd.ParentID = Id; Sys_NotesSort tempParent = _notesManager.GetNotesSort(noteSort.Id); if (tempParent == null) { ViewBag.ParentName = NoteLanguage.AllCategories; } else { ViewBag.ParentName = tempParent.SortName; } return(View(tempAdd)); }