public void DoUpdate()
        {
            ClearDataGrid(Viewer.DataGridView_Update);
            if (!TryGetOutlookWrapper(out var ol))
            {
                throw new NullReferenceException("Cant get outlook.");
            }
            var extractor = new ResignInfoExtractor();
            var emailList = ol.GetItemInCurrentSelectedFolder("Vo Ya Phuong Khanh", "Luu Nhat Hong"); //test

            //var resignList = new List<Resignation>();
            //int notResignCount = 0;
            //int resignCount = 0;
            foreach (var mail in emailList)
            {
                //null = cant parse info
                //false = no info table found -> not resign letter
                var result = extractor.ExtractResignForm(mail.HTMLBody, out var resign, out var errorMess);
                if (result == ParseResult.Parsed_Info_Error)
                {
                    //error
                    //notResignCount++;
                    Viewer.AddRecordToUpdateGrid(mail.Subject, mail.ReceivedTime, errorMess, Code.E, GetAttentionColor);
                    continue;
                }
                if (result == ParseResult.OK)
                {
                    //ok
                    //resignList.Add(resign);
                    resign.ReceiveDate = mail.ReceivedTime;
                    var dbResult = Adapter.UpsertRecordIfNewer(resign, out var dbError);

                    switch (dbResult)
                    {
                    case DbResult.Insert:
                        Viewer.AddRecordToUpdateGrid(mail.Subject, mail.ReceivedTime, AddToDbSuccessful, Code.I, InfoColor);
                        break;

                    case DbResult.Update:
                        Viewer.AddRecordToUpdateGrid(mail.Subject, mail.ReceivedTime, UpdateToDbSuccessful, Code.I, InfoColor);
                        break;

                    case DbResult.Older:
                        Viewer.AddRecordToUpdateGrid(mail.Subject, mail.ReceivedTime, AddToDbOlderResignInfo, Code.I, InfoColor);
                        break;

                    case DbResult.Erorr:
                        Viewer.AddRecordToUpdateGrid(mail.Subject, mail.ReceivedTime, AddToDbFail + dbError, Code.E, GetAttentionColor);
                        break;

                    default:
                        throw new InvalidProgramException();
                    }
                    //resignCount++;
                }
                if (result == ParseResult.Not_Resign_Email)
                {
                    //notResignCount++;
                    Viewer.AddRecordToUpdateGrid(mail.Subject, mail.ReceivedTime, errorMess, Code.I, InfoColor);
                    //not resign email
                }
            }
        }