Example #1
0
        public string Member_GetNote()
        {
            string id = Request.Querys("id");

            if (id.IsNullOrWhiteSpace())
            {
                return("");
            }
            Business.Organize     organize     = new Business.Organize();
            Business.User         user         = new Business.User();
            Business.OrganizeUser organizeUser = new Business.OrganizeUser();
            if (id.StartsWith(Business.Organize.PREFIX_USER))//人员
            {
                var organizeUserModel = organizeUser.GetMainByUserId(id.RemoveUserPrefix().ToGuid());
                return(organize.GetParentsName(organizeUserModel.OrganizeId) + " \\ " + organize.GetName(organizeUserModel.OrganizeId));
            }
            else if (id.StartsWith(Business.Organize.PREFIX_RELATION))//兼职人员
            {
                var organizeUserModel = organizeUser.Get(id.RemoveUserRelationPrefix().ToGuid());
                return(organize.GetParentsName(organizeUserModel.OrganizeId) + " \\ " + organize.GetName(organizeUserModel.OrganizeId) + "[兼任]");
            }
            else if (id.StartsWith(Business.Organize.PREFIX_WORKGROUP))//工作组
            {
                return("");
            }
            else if (id.IsGuid(out Guid gid))
            {
                return(organize.GetParentsName(gid) + " \\ " + organize.GetName(gid));
            }
            return("");
        }
        public IActionResult Body()
        {
            string orgId     = Request.Querys("orgid");
            string parentId  = Request.Querys("orgparentid");
            string isAddDept = Request.Querys("isadddept");
            string type      = Request.Querys("type");
            string showType  = Request.Querys("showtype");
            string appId     = Request.Querys("appid");
            string tabId     = Request.Querys("tabid");

            Model.Organize    organizeModel = null;
            Business.Organize organize      = new Business.Organize();
            if (orgId.IsGuid(out Guid guid) && !"1".Equals(isAddDept))
            {
                organizeModel = organize.Get(guid);
            }
            if (null == organizeModel)
            {
                organizeModel = new Model.Organize
                {
                    Id       = Guid.NewGuid(),
                    ParentId = orgId.ToGuid(),
                    Sort     = organize.GetMaxSort(orgId.ToGuid())
                };
                organizeModel.IntId     = organizeModel.Id.ToInt();
                ViewData["parentsName"] = "";
            }
            else
            {
                organizeModel.IntId     = organizeModel.Id.ToInt();
                ViewData["parentsName"] = organize.GetParentsName(organizeModel.Id);
            }
            ViewData["orgId"]       = orgId;
            ViewData["isAddDept"]   = isAddDept;
            ViewData["queryString"] = Request.UrlQuery();
            ViewData["refreshId"]   = organizeModel.ParentId;
            ViewData["rootId"]      = organize.GetRootId();
            ViewData["returnUrl"]   = "Body?orgid=" + orgId + "&orgparentid=" + parentId + "&type=" + type + "&showtype=" + showType + "&appid" + appId + "&tabid=" + tabId;
            return(View(organizeModel));
        }