Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(instance.ActiveTab.IsBusy)
- {
- instance.ActiveTab.WaitDownloading();
- }
- HtmlElementCollection requests = instance.ActiveTab.FindElementByAttribute("table", "class", "dt", "text", 4).FindChildrenByAttribute("tr", "fulltag", "tr", "text");
- project.SendInfoToLog("Число заявок " + requests.Count.ToString(), true);
- if(requests.Count == 2)
- {
- HtmlElement date = instance.ActiveTab.FindElementByAttribute("table", "class", "dt", "text", 0).FindChildByTag("td", 3);
- MyVariables.dateOfSigningTheProtocol.Add(date.GetAttribute("innertext").ToString());
- project.SendInfoToLog("Дата подписания протокола " + date.GetAttribute("innertext").ToString(), true);
- if(project.Variables["nameOfProtocol"].Value.Contains("Протокол подведения итогов"))
- {
- HtmlElement notifNumb = requests.Elements[1].FindChildByTag("td", 2);
- project.SendInfoToLog("Номер извещения " + notifNumb.GetAttribute("innertext").ToString(), true);
- MyVariables.notificationNumber.Add(notifNumb.GetAttribute("innertext").ToString().Replace(".", ","));
- }
- else
- {
- MyVariables.notificationNumber.Add(string.Empty);
- project.SendInfoToLog("Номер извещения ", true);
- }
- MyVariables.linkToTheProtocol.Add(instance.ActiveTab.URL.ToString());
- project.SendInfoToLog("Ссылка на протокол " + instance.ActiveTab.URL.ToString(), true);
- HtmlElement name = requests.Elements[1].FindChildByTag("td", 1);
- MyVariables.nameOfParticipant.Add(name.GetAttribute("innertext").ToString());
- project.SendInfoToLog("Имя участника " + name.GetAttribute("innertext").ToString(), true);
- string decision = requests.Elements[1].FindChildByTag("td", 5).GetAttribute("innertext").ToString().Replace("\t", string.Empty).Replace("\n", string.Empty).Replace("\r", string.Empty).Trim(' ');
- MyVariables.decisionOfTheComission.Add(decision);
- project.SendInfoToLog("Решение " + decision, true);
- if(decision != "соответствует")
- {
- MyVariables.reasonForRejection.Add(requests.Elements[1].FindChildByTag("td", 6).GetAttribute("innertext").ToString().Replace("\t", string.Empty).Replace("\n", string.Empty).Replace("\r", string.Empty).Trim(' '));
- project.SendInfoToLog("Причина отклонения " + MyVariables.reasonForRejection[MyVariables.reasonForRejection.Count - 1], true);
- }
- else
- {
- MyVariables.reasonForRejection.Add(string.Empty);
- project.SendInfoToLog("Причина отклонения ", true);
- }
- }
- else
- {
- for(int i = 1; i < requests.Count; i++)
- {
- if(i == 1)
- {
- HtmlElement date = instance.ActiveTab.FindElementByAttribute("table", "class", "dt", "text", 0).FindChildByTag("td", 3);
- MyVariables.dateOfSigningTheProtocol.Add(date.GetAttribute("innerhtml").ToString());
- project.SendInfoToLog("Дата подписания протокола " + date.GetAttribute("innertext").ToString(), true);
- if(project.Variables["nameOfProtocol"].Value.Contains("Протокол подведения итогов"))
- {
- HtmlElement notifNumb = requests.Elements[i].FindChildByTag("td", 2);
- project.SendInfoToLog("Номер извещения " + notifNumb.GetAttribute("innertext").ToString(), true);
- MyVariables.notificationNumber.Add(notifNumb.GetAttribute("innertext").ToString().Replace(".", ","));
- }
- else
- {
- MyVariables.notificationNumber.Add(string.Empty);
- project.SendInfoToLog("Номер извещения ", true);
- }
- MyVariables.linkToTheProtocol.Add(instance.ActiveTab.URL.ToString());
- project.SendInfoToLog("Ссылка на протокол " + instance.ActiveTab.URL.ToString(), true);
- HtmlElement name = requests.Elements[i].FindChildByTag("td", 1);
- MyVariables.nameOfParticipant.Add(name.GetAttribute("innertext").ToString());
- project.SendInfoToLog("Имя участника " + name.GetAttribute("innertext").ToString(), true);
- string decision = requests.Elements[i].FindChildByTag("td", 5).GetAttribute("innertext").ToString().Replace("\t", string.Empty).Replace("\n", string.Empty).Replace("\r", string.Empty).Trim(' ');
- MyVariables.decisionOfTheComission.Add(decision);
- project.SendInfoToLog("Решение " + decision, true);
- if(decision != "соответствует")
- {
- MyVariables.reasonForRejection.Add(requests.Elements[i].FindChildByTag("td", 6).GetAttribute("innertext").ToString().Replace("\t", string.Empty).Replace("\n", string.Empty).Replace("\r", string.Empty).Trim(' '));
- project.SendInfoToLog("Причина отклонения " + MyVariables.reasonForRejection[MyVariables.reasonForRejection.Count - 1], true);
- }
- else
- {
- MyVariables.reasonForRejection.Add(string.Empty);
- project.SendInfoToLog("Причина отклонения ", true);
- }
- }
- else
- {
- MyVariables.sizeOfTheRequest.Add(MyVariables.sizeOfTheRequest[(MyVariables.sizeOfTheRequest.Count - 1)]);
- project.SendInfoToLog("Размер заявки " + MyVariables.sizeOfTheRequest[MyVariables.sizeOfTheRequest.Count - 1], true);
- HtmlElement date = instance.ActiveTab.FindElementByAttribute("table", "class", "dt", "text", 0).FindChildByTag("td", 3);
- MyVariables.dateOfSigningTheProtocol.Add(date.GetAttribute("innertext").ToString());
- project.SendInfoToLog("Дата подписания протокола " + date.GetAttribute("innertext").ToString(), true);
- if(project.Variables["nameOfProtocol"].Value.Contains("Протокол подведения итогов"))
- {
- HtmlElement notifNumb = requests.Elements[i].FindChildByTag("td", 2);
- project.SendInfoToLog("Номер извещения " + notifNumb.GetAttribute("innertext").ToString(), true);
- MyVariables.notificationNumber.Add(notifNumb.GetAttribute("innertext").ToString().Replace(".", ","));
- }
- else
- {
- MyVariables.notificationNumber.Add(string.Empty);
- project.SendInfoToLog("Номер извещения ", true);
- }
- MyVariables.linkToTheProtocol.Add(instance.ActiveTab.URL.ToString());
- project.SendInfoToLog("Ссылка на протокол " + instance.ActiveTab.URL.ToString(), true);
- HtmlElement name = requests.Elements[i].FindChildByTag("td", 1);
- MyVariables.nameOfParticipant.Add(name.GetAttribute("innertext").ToString());
- project.SendInfoToLog("Имя участника " + name.GetAttribute("innertext").ToString(), true);
- string decision = requests.Elements[i].FindChildByTag("td", 5).GetAttribute("innertext").ToString().Replace("\t", string.Empty).Replace("\n", string.Empty).Replace("\r", string.Empty).Trim(' ');
- MyVariables.decisionOfTheComission.Add(decision);
- project.SendInfoToLog("Решение " + decision, true);
- if(decision != "соответствует")
- {
- MyVariables.reasonForRejection.Add(requests.Elements[i].FindChildByTag("td", 6).GetAttribute("innertext").ToString().Replace("\t", string.Empty).Replace("\n", string.Empty).Replace("\r", string.Empty).Trim(' '));
- project.SendInfoToLog("Причина отклонения " + MyVariables.reasonForRejection[MyVariables.reasonForRejection.Count - 1], true);
- }
- else
- {
- MyVariables.reasonForRejection.Add(string.Empty);
- project.SendInfoToLog("Причина отклонения ", true);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment