Exemplo n.º 1
0
 public ListsStruct(TrelloCheckerSettings settings, Board board)
 {
     TrelloInWorkList = null;
     TrelloFirstList  = null;
     TrelloDoneList   = null;
     BoardHaveAllList = false;
     foreach (var list in board.Lists)
     {
         if (list.Name == settings.TrelloInWorkListName)
         {
             TrelloInWorkList = (List)list;
         }
         else if (list.Name == settings.TrelloFirstListName)
         {
             TrelloFirstList = (List)list;
         }
         else if (list.Name == settings.TrelloDoneListName)
         {
             TrelloDoneList = (List)list;
         }
     }
     if (TrelloInWorkList == null || TrelloFirstList == null || TrelloDoneList == null)
     {
         return;
     }
     BoardHaveAllList = true;
 }
Exemplo n.º 2
0
        public EnterpriseWsWrapper(TrelloCheckerSettings settings)
        {
            var myCredentials = new CredentialCache
            {
                {
                    new Uri(settings.EnterpriseWsPath), "Basic",
                    new NetworkCredential(settings.EnterpriseUserName, settings.EnterprisePassword)
                }
            };

            _service = new itwts_TrelloSync
            {
                SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap12,
                Credentials = myCredentials,
                Url         = settings.EnterpriseWsPath
            };
        }
Exemplo n.º 3
0
        private void SyncContractors(Contractor[] contractorsArray, Organization currentOrganiztion, TrelloCheckerSettings settings)
        {
            var emptyBoardContractors = new List <Contractor>();
            var sourceBoard           = new Board(settings.SourceTrelloBoardShortlink);

            foreach (var contractor in contractorsArray)
            {
                if (!contractor.BoardId.BoardExists())
                {
                    emptyBoardContractors.Add(contractor);
                    continue;
                }
                TrelloRequestCounter.TrelloPostCount += 3;
                var boardShortId = new Board(contractor.BoardId).GetBoardId();
                if (boardShortId == contractor.BoardId)
                {
                    continue;
                }
                contractor.BoardId = boardShortId;
                EnterpriseWsWrapper.SetContractor(contractor);
            }
            foreach (var contractor in emptyBoardContractors)
            {
                TrelloRequestCounter.TrelloPostCount += 3;
                var newContractorsBoard =
                    currentOrganiztion.Boards.Add($"{settings.BoardNamePrefix} {contractor.Represent}");
                //newContractorsBoard.Preferences.PermissionLevel = BoardPermissionLevel.Org;
                //sourceBoard.CloneBoard(newContractorsBoard, true);
                //contractor.BoardId = newContractorsBoard.GetBoardId();
                //if (!EnterpriseWsWrapper.SetContractor(contractor))
                //    newContractorsBoard.IsClosed = true;
            }
        }