//КОНСТРУКТОР КЛАССА public ClientChatModel() { try { Messangers = new DataTable(); LoadFilesCollection = new ObservableCollection <FilesNameControll>(); FileOkVisible = false; Order = Storage.datasetKlient.Tables["ClientInfo"].Rows[0][6].ToString(); ChatTimer = new System.Windows.Forms.Timer(); ChatTimer.Tick += new EventHandler(ResetAsync); ChatTimer.Interval = 2000; ChatTimer.Start(); DataTable adviserInfo = userDAL.AdviserInfo(ClientPerSonalAdviser); LastFirstAdviserName = adviserInfo.Rows[0][1].ToString() + " " + adviserInfo.Rows[0][2].ToString(); DownloadFromFTP fotoload = new DownloadFromFTP(); AdviserPhoto = fotoload.DownloadFile(adviserInfo.Rows[0][0].ToString()); AdviserInfoCollection = new ObservableCollection <AdviserInfoTable>(); MessangersCollection = new ObservableCollection <MessageCloud>(); AdviserInfoCollection.Add(new AdviserInfoTable() { StaticsNames = "ID", FromDBNames = adviserInfo.Rows[0][0].ToString() }); AdviserInfoCollection.Add(new AdviserInfoTable() { StaticsNames = "E-Mail", FromDBNames = adviserInfo.Rows[0][3].ToString() }); } catch (Exception ex) { Logger.WriteLog(ex.Message + " ChatModel Error", ex.Source); } }
private void Download(Documents doc) { try { string name = doc.Name; string ftp = string.Empty; DownloadFromFTP down = new DownloadFromFTP(); if (doc.Profil == "Forms") { ftp = "ftp://[email protected]/Documents/FormClient/"; } else if (doc.Profil == "Client") { ftp = "ftp://[email protected]/Clients/" + Storage.datasetKlient.Tables["ClientInfo"].Rows[0][6].ToString() + "/"; } else { ftp = "ftp://[email protected]/Documents/BrochuresClient/"; } down.DownloadFile(ftp + name, name); userDAL.GetInvestmentDetails.WriteDocumentName(name.Replace("|", ""), Storage.datasetKlient.Tables["ClientInfo"].Rows[0][6].ToString()); } catch (NullReferenceException) { } // ЕСЛИ НАЖАЛ НА ПУСТОЕ ПРОСТРАНСТВО НА ТАБЛИЦЕ }
private void GetMoreInfo_Click(object sender, RoutedEventArgs e) { DownloadFromFTP PRIdownload = new DownloadFromFTP(); PRIdownload.DownloadFile("ftp://[email protected]/Documents/BrochuresClient/%7CInvestment%20Risk%20Notice.pdf", "List of Possible Risks.pdf"); }