예제 #1
0
        private void AssignUsers(string userids, bool isClient)
        {
            string[] users = userids.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            int      id    = QS("id", 0);

            if (projApp.RemoveAllUsers(id, isClient))
            {
                List <BrokenRuleMessage> listmsgs = new List <BrokenRuleMessage>();
                foreach (string user in users)
                {
                    ProjectUsersEntity model = ProjectsFactory.CreateProjectUser(UserInfo.ID, ObjectFactory.GetInstance <ISystemDateTime>());
                    model.ProjectID = id;
                    model.UserID    = int.Parse(user);
                    model.ISClient  = QueryISClient(user);
                    model.ISClient  = isClient;
                    if (projApp.AssignUserToProject(model) < 0)
                    {
                        RecordMsg(listmsgs, projApp.BrokenRuleMessages);
                    }
                }
                if (listmsgs.Count > 0)
                {
                    this.ShowFailMessageToClient();
                }
                else
                {
                    if (!isClient)
                    {
                        InitSunnetUsers();
                    }
                    this.ShowSuccessMessageToClient(false, false);
                }
            }
        }