public JsonResult Editorganization(FormCollection form) { Common.Json json = new Common.Json(); B_Organization b_org = new B_Organization(); B_Organization_type b_orgtype = new B_Organization_type(); B_Manager b_manager = new B_Manager(); Domain.Organization model = b_org.Get(Convert.ToInt32(form["id"])); model.name = form["txt_name"]; model.parent_id = Convert.ToInt32(form["txt_parent_id"]); if (model.parent_id != 0) { var m = b_org.Get(model.parent_id); if (string.IsNullOrEmpty(model.parent_ids)) { model.parent_ids = model.parent_id + ","; } else { model.parent_ids = m.parent_ids + m.parent_id + ","; } model.levels = m.levels + 1; } else { model.levels = 0; } model.orgtype = b_orgtype.Get(Convert.ToInt32(form["txt_orgtype_id"])); model.sort_id = Convert.ToInt32(form["txt_sort_id"]); model.status = Convert.ToInt32(form["txt_status"]); b_org.Update(model); json.msg = "修改成功!"; return(Json(json)); }