1

我正在尝试将使用搜索功能找到的卡片从同一个列表中的一个列表移动到另一个列表。

我尝试使用 new 设置新列表factory.list并使用 Query 搜索列表,FirstorDefault LINQ但不断收到错误消息。

以下是我尝试移动卡片的一些代码。

string query = jnum;
var search = factory.Search(query, 1, SearchModelType.Cards, new IQueryable[] { board });
await search.Refresh();
var CardList = search.Cards.ToList();

foreach (var card in CardList)
{
    string tName = card.Name.Substring(0, 6);

    if (tName == jnum.Trim())
    {
        cardid = card.Id;
    }
}

var FoundCard = factory.Card(cardid);
string FoundListid = FoundCard.List.Id;
var fromlist = factory.List(FoundListid);

if (Item != null)
{
    if (mail.Body.ToUpper().Contains("Approved for Print".ToUpper()))
    {
        //var ToList = factory.List("5db19603e4428377d77963b4");
        var ToList = board.Lists.FirstOrDefault(l => l.Name == "Signed Off");
        FoundCard.List = ToList;
        // from on proof                    
        //MessageBox.Show("Approved for Print");
    }
    else if (mail.Body.ToUpper().Contains("Awaiting Review".ToUpper()))
    {
        //var ToList = factory.List("5db19603e4428377d77963b3");
        var ToList = board.Lists.FirstOrDefault(l => l.Name == "On Proof");

        FoundCard.List = ToList;
        // from in progress or to start
        // MessageBox.Show("Awaiting Review");
     }
    else if (mail.Body.ToUpper().Contains("Amends".ToUpper()))
    {
        var ToList = factory.List("5dc9442eb245e60a39b3d4a7");
        FoundCard.List = ToList;
        // from on proof
        //MessageBox.Show("Amends");
    }
    else
    {
        // non job mail
    }

}

我不断收到一个不是有效值错误。感谢帮助

4

0 回答 0