Beispiel #1
0
        public void TestDates()
        {
            LibraryAutomations libraryAutomation = new LibraryAutomations(WindowsAis3.AisNalog3);

            PublicGlobalFunction.WindowElementClick(libraryAutomation, Journal129AndJournal121.ButtonSend);
            while (true)
            {
                if (libraryAutomation.IsEnableElements(Journal129AndJournal121.EstablishedNotePred, null, true) != null)
                {
                    libraryAutomation.FindFirstElement(Journal129AndJournal121.EstablishedNotePred);
                    break;
                }
            }
            var t = libraryAutomation.FindElement.GetSupportedPatterns();

            libraryAutomation.SetLegacyIAccessibleValuePattern(string.Format("Мой текст"));
            PublicGlobalFunction.WindowElementClick(libraryAutomation, Journal129AndJournal121.AddNote);
            //   AutoItX.Send("{CTRLUP}");
            //var createDocument = new DateTime(2021, 10, 21);


            ////Если почта то Если почта - 5  рабочих дней на вручение ( со след. дня после даты акта) +6 рабочих дней на отправку + 1 месяц на возражения
            //createDocument = createDocument.AddWorkdays(5);
            //createDocument = createDocument.AddMonths(1);
            //createDocument = createDocument.AddWorkdays(5);
            ////Уходим от выходных
            //createDocument = IsWeekends(createDocument);
        }
Beispiel #2
0
        /// <summary>
        /// Поиск плательщика для отправки уведомления
        /// </summary>
        /// <param name="libraryAutomation">Библиотека автоматизации</param>
        /// <param name="inn">ИНН</param>
        /// <returns></returns>
        public string FindNpIsNull(LibraryAutomations libraryAutomation, string inn)
        {
            PublicGlobalFunction.WindowElementClick(libraryAutomation, RashetBudElementName.ButtonUvedNp);
            while (true)
            {
                if (libraryAutomation.IsEnableElements(RashetBudElementName.WinSelect, null, true) != null)
                {
                    break;
                }
            }
            PublicGlobalFunction.WindowElementClick(libraryAutomation, RashetBudElementName.WinFind);
            if (libraryAutomation.IsEnableElements(RashetBudElementName.ErrorWin, null, true, 5) != null)
            {
                PublicGlobalFunction.WindowElementClick(libraryAutomation, RashetBudElementName.ErrorWin);
                PublicGlobalFunction.WindowElementClick(libraryAutomation, RashetBudElementName.CloseButton);
                return("Отсутствует ИНН отправка и уточнение не возможно");
            }
            libraryAutomation.IsEnableElement(RashetBudElementName.SelectGrid);
            var listElement = libraryAutomation.SelectAutomationColrction(libraryAutomation.FindElement).Cast <AutomationElement>().Where(elem => elem.Current.Name.Contains("List`")).ToList();

            if (!listElement.Any())
            {
                libraryAutomation.IsEnableElement(RashetBudElementName.KppMemo);
                libraryAutomation.SetValuePattern("");
                PublicGlobalFunction.WindowElementClick(libraryAutomation, RashetBudElementName.WinFind);
                libraryAutomation.IsEnableElement(RashetBudElementName.SelectGrid);
                listElement = libraryAutomation.SelectAutomationColrction(libraryAutomation.FindElement).Cast <AutomationElement>().Where(elem => elem.Current.Name.Contains("List`")).ToList();
                if (inn.Length == 12)
                {
                    FindIp(libraryAutomation, listElement);
                }
                else
                {
                    FindUl(libraryAutomation, listElement);
                }
                PublicGlobalFunction.WindowElementClick(libraryAutomation, RashetBudElementName.SelectButton);
                PublicGlobalFunction.WindowElementClick(libraryAutomation, RashetBudElementName.FormWin);
                PublicGlobalFunction.WindowElementClick(libraryAutomation, RashetBudElementName.SaveWin);
                PublicGlobalFunction.WindowElementClick(libraryAutomation, RashetBudElementName.Ok);
                PublicGlobalFunction.WindowElementClick(libraryAutomation, RashetBudElementName.Back);
                return("Некорректное КПП плательщика уточнение не возможно");
            }
            if (inn.Length == 12)
            {
                FindIp(libraryAutomation, listElement);
            }
            else
            {
                FindUl(libraryAutomation, listElement);
            }
            PublicGlobalFunction.WindowElementClick(libraryAutomation, RashetBudElementName.SelectButton);
            PublicGlobalFunction.WindowElementClick(libraryAutomation, RashetBudElementName.FormWin);
            PublicGlobalFunction.WindowElementClick(libraryAutomation, RashetBudElementName.SaveWin);
            PublicGlobalFunction.WindowElementClick(libraryAutomation, RashetBudElementName.Ok);
            PublicGlobalFunction.WindowElementClick(libraryAutomation, RashetBudElementName.Back);
            return(null);
        }
Beispiel #3
0
        public void Okp2Reshenia()
        {
            LibraryAutomations libraryAutomation = new LibraryAutomations(WindowsAis3.AisNalog3);

            while (true)
            {
                PublicGlobalFunction.WindowElementClick(libraryAutomation, Journal129AndJournal121.CloseKnp);
                AutoItX.Sleep(1000);
                while (true)
                {
                    LibraryAutomations libraryAutomationSign = new LibraryAutomations(TreeWalker.RawViewWalker.GetPreviousSibling(libraryAutomation.RootAutomationElements));
                    while (true)
                    {
                        if (libraryAutomationSign.IsEnableElements(Journal129AndJournal121.NewWindowEnable, null, true, 40, 0, false, ';') != null)
                        {
                            libraryAutomationSign.IsEnableElements(Journal129AndJournal121.NewComboBoxError, null, false, 40, 0, false, ';');
                            libraryAutomationSign.ClickElement(libraryAutomationSign.FindElement, 0, 10);
                            var memo = libraryAutomationSign.SelectAutomationColrction(libraryAutomationSign.FindElement);
                            //   var elemClick = memo.Cast<AutomationElement>().FirstOrDefault(x => x.Current.Name == textErrorAndNotError);
                            //libraryAutomationSign.ClickElement(elemClick);
                            libraryAutomationSign.IsEnableElements(Journal129AndJournal121.NewComboBoxError, null, false, 40, 0, false, ';');
                            if (libraryAutomationSign.SelectionComboBoxPatternIsSelect(libraryAutomationSign.FindElement) != "")
                            {
                                break;
                            }
                        }
                    }
                    libraryAutomationSign.InvokePattern(libraryAutomationSign.IsEnableElements(Journal129AndJournal121.NewOkEdit));
                    AutoItX.Sleep(1000);
                    AutoItX.WinWait(Journal129AndJournal121.NewWarningOk);
                    AutoItX.WinActivate(Journal129AndJournal121.NewWarningOk);
                    libraryAutomationSign = new LibraryAutomations(Journal129AndJournal121.NewWarningOk);
                    libraryAutomationSign.InvokePattern(libraryAutomationSign.IsEnableElements(Journal129AndJournal121.NewWarningButtonOk));
                    AutoItX.Sleep(1000);
                    break;
                }
                break;
            }
        }
Beispiel #4
0
        public void TestNewSendForm()
        {
            var summ = 1000;
            LibraryAutomations libraryAutomation = new LibraryAutomations(WindowsAis3.AisNalog3);

            PublicGlobalFunction.WindowElementClick(libraryAutomation, Journal129AndJournal121.ErrorFaceGr11);
            if (libraryAutomation.IsEnableElements(Journal129AndJournal121.ListCashFace, null, true) != null)
            {
                var listCash = libraryAutomation
                               .SelectAutomationColrction(
                    libraryAutomation.FindFirstElement(Journal129AndJournal121.ListCashFace))
                               .Cast <AutomationElement>().Distinct().Where(elem => elem.Current.Name.Contains("Sanctions row")
                                                                            ).ToList();
                if (listCash.Count >= 0)
                {
                    AutomationElement cashDelete;
                    while ((cashDelete = libraryAutomation.IsEnableElements(Journal129AndJournal121.ListCashFaceRowNumber1, null, false, 10)) != null)
                    {
                        while (true)
                        {
                            libraryAutomation.ParseElementLegacyIAccessiblePatternIdentifiers(libraryAutomation
                                                                                              .SelectAutomationColrction(cashDelete)
                                                                                              .Cast <AutomationElement>().First(elemr => elemr.Current.Name.Contains("Ун документа НБО")));
                            var elem = libraryAutomation.FindFirstElement("Name:Удалить", cashDelete);
                            libraryAutomation.ClickElement(elem);

                            if (libraryAutomation.IsEnableElements(Journal129AndJournal121.DeleteWin, null, true) != null)
                            {
                                libraryAutomation.ClickElement(libraryAutomation.IsEnableElements(Journal129AndJournal121.DeleteWin));
                                break;
                            }
                        }
                    }
                    PublicGlobalFunction.WindowElementClick(libraryAutomation, Journal129AndJournal121.ErrorFaceGr15);
                    PublicGlobalFunction.WindowElementClick(libraryAutomation, Journal129AndJournal121.AddNewErrror);
                    libraryAutomation.IsEnableElements(Journal129AndJournal121.WinSelect1);
                    libraryAutomation.SetValuePattern("11901013");
                    libraryAutomation.IsEnableElements(Journal129AndJournal121.WinSelect2);
                    libraryAutomation.SetValuePattern("11901013");
                    PublicGlobalFunction.WindowElementClick(libraryAutomation, Journal129AndJournal121.WinSelectOk);
                    if (summ > 1000)
                    {
                        while ((cashDelete = libraryAutomation.IsEnableElements(Journal129AndJournal121.ListCashFaceRowNumber1, null, false, 10)) != null)
                        {
                            var summSt = libraryAutomation
                                         .SelectAutomationColrction(cashDelete)
                                         .Cast <AutomationElement>().First(elemr => elemr.Current.Name == "Штраф, рублей");
                            libraryAutomation.FindElement = summSt;
                            libraryAutomation.SetValuePattern(Convert.ToString(summ));
                            break;
                        }
                    }
                }
            }
            PublicGlobalFunction.WindowElementClick(libraryAutomation, Journal129AndJournal121.ErrorFaceGr15);
            PublicGlobalFunction.WindowElementClick(libraryAutomation, Journal129AndJournal121.ErrorFaceGr11);



            //var sender = "Ворононова И. В";
            //while (true)
            //{
            //
            //    AutoItX.Sleep(2000);
            //    LibraryAutomations libraryAutomationSign = new LibraryAutomations(TreeWalker.RawViewWalker.GetPreviousSibling(libraryAutomationDiaolog.RootAutomationElements));
            //    if (libraryAutomationSign.IsEnableElements(Journal129AndJournal121.ViewPrint, null, true) != null)
            //    {
            //        libraryAutomationSign.ClickElement(libraryAutomationSign.FindElement);
            //        AutoItX.Sleep(10000);
            //        PublicGlobalFunction.CloseProcessProgram("AcroRd32", true);
            //        PublicGlobalFunction.CloseProcessProgram("FoxitPhantom");
            //        while (true)
            //        {
            //            var toggle = libraryAutomationSign.TogglePattern(libraryAutomationSign.IsEnableElements(Journal129AndJournal121.ViewCheks));
            //            if (toggle == "Off" || toggle == null)
            //            {
            //                while (true)
            //                {
            //                    if (libraryAutomationSign.IsEnableElements(Journal129AndJournal121.ViewCheksText, null, true) != null)
            //                    {
            //                        libraryAutomationSign.ClickElement(libraryAutomationSign.FindElement);
            //                        break;
            //                    }
            //                }
            //            }
            //            if (toggle == "On")
            //            {
            //                while (true)
            //                {
            //                    if (!string.IsNullOrEmpty(sender))
            //                    {
            //                        if (libraryAutomationSign.IsEnableElements(Journal129AndJournal121.SenderSign, null, true) != null)
            //                        {
            //                            libraryAutomationSign.SetValuePattern(sender);
            //                        }
            //                    }
            //                    if (libraryAutomationSign.IsEnableElements(Journal129AndJournal121.Sign, null, true) != null)
            //                    {
            //                     //   libraryAutomationSign.ClickElement(libraryAutomationSign.FindElement);
            //                        break;
            //                    }
            //                }
            //                break;
            //            }
            //        }
            //        break;
            //    }
            //}


            //bool isClose = false;
            ////LibraryAutomations libraryAutomation = new LibraryAutomations(TreeWalker.RawViewWalker.GetPreviousSibling(libraryAutomationDiaolog.RootAutomationElements));
            ////    if (libraryAutomation.IsEnableElements(Journal129AndJournal121.Tks, null, true) != null)
            ////    {
            //var auto = libraryAutomation.RootAutomationElements;
            //    libraryAutomation.IsEnableElements(Journal129AndJournal121.Tks, auto);
            //    var statusTks = libraryAutomation.ParseElementLegacyIAccessiblePatternIdentifiersState(libraryAutomation.FindElement);
            //     libraryAutomation.IsEnableElements(Journal129AndJournal121.Mail, auto);
            //    var statusMail = libraryAutomation.ParseElementLegacyIAccessiblePatternIdentifiersState(libraryAutomation.FindElement);
            //    libraryAutomation.IsEnableElements(Journal129AndJournal121.Lk3, auto);
            //    var statusLk3 = libraryAutomation.ParseElementLegacyIAccessiblePatternIdentifiersState(libraryAutomation.FindElement);
            //var IsTks = false;
            //var IsMail = false;
            //var IsLk3 = false;
            //if (statusTks == 0)
            //{
            //    IsTks = true;
            //}
            //if (statusMail == 0)
            //{
            //    IsMail = true;
            //}
            //if (statusLk3 == 0)
            //{
            //    IsLk3 = true;
            //}
            //while (true)
            //{
            //    if (isClose)
            //    {
            //        if (libraryAutomation.IsEnableElements(Journal129AndJournal121.Close, null, true) != null)
            //        {
            //            libraryAutomation.ClickElements(Journal129AndJournal121.Close, null, false, 25);
            //            break;
            //        }
            //    }
            //    else
            //    {
            //        if (libraryAutomation.IsEnableElements(Journal129AndJournal121.SendMail, null, true) != null)
            //        {
            //            libraryAutomation.ClickElements(Journal129AndJournal121.SendMail, null, false, 25);
            //            break;
            //        }
            //    }

            //}
            ////break;
            //// }
        }