Exemple #1
0
        /// <summary>
        /// Сохранение документа в БД
        /// </summary>
        /// <param name="taxJournal">Журнал</param>
        private void SaveDocument(TaxJournal121Error taxJournal)
        {
            var dbAutomation = new AddObjectDb();

            dbAutomation.TaxJournal121Error(taxJournal);
            dbAutomation.Dispose();
        }
        /// <summary>
        /// Сохранение документа в БД
        /// </summary>
        /// <param name="fl">Физическое лицо</param>
        private void SaveDocument(FlFaceMainRegistration fl)
        {
            var dbAutomation = new AddObjectDb();

            dbAutomation.SaveFlFace(fl);
            dbAutomation.Dispose();
        }
Exemple #3
0
        /// <summary>
        /// Поик и отпускания в БД наименования рабочих станций
        /// </summary>
        /// <param name="pathdomain">путь к домену конечной точки</param>
        /// <param name="workstation">Рабочии станции</param>
        public void FindIpHost(string pathdomain, string workstation)
        {
            var directoryEntry = new DirectoryEntry("LDAP://regions.tax.nalog.ru")
            {
                Path = pathdomain
            };
            DirectorySearcher searcher = new DirectorySearcher(directoryEntry)
            {
                Filter = workstation
            };
            var         allhost = searcher.FindAll();
            AddObjectDb add     = new AddObjectDb();
            ComputerIpAdressSynhronization synhronization = new ComputerIpAdressSynhronization();

            add.ClearsHostSynhronization();
            add.IsProcessComplete(1, false);
            Regex ip = new Regex(@"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b");

            foreach (SearchResult find in allhost)
            {
                var namecomputers = find.GetDirectoryEntry().Name.Replace("CN=", "");
                try
                {
                    IPAddress[] adress = Dns.GetHostAddresses(namecomputers);
                    byte[]      ab     = new byte[6];
                    int         len    = ab.Length;
                    int         r      = SendARP(BitConverter.ToInt32(adress[0].GetAddressBytes(), 0), 0, ab, ref len);
                    string      mac    = BitConverter.ToString(ab, 0, 6);
                    synhronization.IpAdress  = adress[0].ToString();
                    synhronization.NameHost  = namecomputers;
                    synhronization.MacAdress = mac;
                    synhronization.StatusIp  = null;
                    synhronization.UserName  = null;
                    add.AddHostSynhronization(synhronization);
                }
                catch (Exception exception)
                {
                    synhronization.IpAdress  = null;
                    synhronization.NameHost  = namecomputers;
                    synhronization.MacAdress = null;
                    synhronization.StatusIp  = exception.Message;
                    synhronization.UserName  = null;
                    add.AddHostSynhronization(synhronization);
                }
            }
            add.IsProcessComplete(1, true);
        }
Exemple #4
0
 /// <summary>
 /// Печать файлов
 /// </summary>
 /// <param name="downloadPrintDb">Модель документов</param>
 public async void PrintFiles(DownloadPrintDb downloadPrintDb)
 {
     DispatcherHelper.Initialize();
     if (downloadPrintDb.IsValidationWork())
     {
         await Task.Run(delegate
         {
             var db = new AddObjectDb();
             DispatcherHelper.CheckBeginInvokeOnUI(delegate { downloadPrintDb.ProgressMaxPrint(downloadPrintDb.FileCollection.Count); });
             foreach (var file in downloadPrintDb.FileCollection)
             {
                 downloadPrintDb.Print(file.Path, file.Name);
                 db.UpdatePrintDoc(file.IdDoc);
                 DispatcherHelper.CheckBeginInvokeOnUI(delegate { downloadPrintDb.ProgressPrintFile(file.Name); });
                 File.Delete(file.Path);
             }
             DispatcherHelper.CheckBeginInvokeOnUI(downloadPrintDb.ProgressPrintFileDefault);
             downloadPrintDb.FileCollection.Clear();
             DispatcherHelper.CheckBeginInvokeOnUI(delegate { downloadPrintDb.CountFile(downloadPrintDb.FileCollection.Count); });
         });
     }
 }
Exemple #5
0
        public void Inven()
        {
            AddObjectDb add = new AddObjectDb();

            add.IsProcessComplete(1, false);
        }