//更新
        public IActionResult Update(Userdetail detail)
        {
            if (userService.ShowDetail(detail.Uid).Uname != detail.Uname)
            {
                var relatonService = new UserrelationService();
                var relation       = relatonService.ShowDetail(detail.Uid);
                relation.Name = detail.Uname;
                relatonService.Update(relation);
            }
            var id = userService.Update(detail);

            return(Redirect(Url.Action("Detail", "_User") + $"?uid={id}"));
        }
Exemple #2
0
        //更新
        public IActionResult Update(Userrelation relation)
        {
            relation.Ename   = employService.ShowDetail(relation.Eid).Ename;
            relation.Proname = projectService.ShowDetail((int)relation.Proid).Proname;
            if (relatonService.ShowDetail(relation.Uid).Name != relation.Name)
            {
                var userService = new UserService();
                var user        = userService.ShowDetail(relation.Uid);
                user.Uname = relation.Name;
                userService.Update(user);
            }
            var id = relatonService.Update(relation);

            return(Redirect(Url.Action("Detail", "_Userrelation") + $"?uid={id}"));
        }