private short f_LoadWCFileAreas(int lngFGroup) { My.MyApplication.Application.DoEvents(); modBSMiniRPT.MouseHour(); try { wcServerAPI.TFileArea wFileArea = new wcServerAPI.TFileArea(); int AREA = 0; cmbFArea.Items.Clear(); cmbFArea.Items.Add(new clsList("(None)", -1)); AREA = wcServerAPI.GetFirstFileArea(lngFGroup, 0); while (AREA > -1) { if (wcServerAPI.GetFileArea(AREA, ref wFileArea)) { if (wFileArea.name.Trim() == "") { } else { cmbFArea.Items.Add(new clsList(wFileArea.name.Trim(), wFileArea.Number)); } AREA = wcServerAPI.GetNextFileArea(lngFGroup, 0, AREA); } else { AREA = -1; } } cmbFArea.SelectedIndex = 0; } catch (Exception ex) { MessageBox.Show("Unexpected Error occurred" + Environment.NewLine + "Error: " + ex.ToString() + Environment.NewLine + "Message: " + ex.Message, "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } modBSMiniRPT.MouseNormal(); My.MyApplication.Application.DoEvents(); return 0; }
public short PrepFiles(int lngArea, string strFileName) { try { wcServerAPI.TFileRecord wFile = new wcServerAPI.TFileRecord(); wcServerAPI.TFileArea wFileA = new wcServerAPI.TFileArea(); int fID = 0; if (wcServerAPI.GetFileRecByAreaName(lngArea, strFileName, ref wFile, ref fID)) { if (wcServerAPI.GetFileArea(lngArea, ref wFileA)) { if (wcServerAPI.WcExistFile("wc:\\file\\area(" + wFileA.Number.ToString().Trim() + ")\\" + wFile.Name.Trim())) { lblFStatus.Text = "**File Exists On Disk**"; } txtFileArea.Text = "(" + wFile.Area.ToString().Trim() + "). " + wFileA.name.Trim(); txtFileName.Text = wFile.Name.Trim(); txtFileSize.Text = wFile.Size.ToString("###,###,###,###,###,###,###"); txtFileUploader.Text = wFile.Uploader.Name.Trim(); txtFilePassword.Text = wFile.Password.Trim(); txtFileDate.Text = modBSMiniRPT.DateToDateString(wFile.FileTime, true).Trim(); txtFileLastAccess.Text = modBSMiniRPT.DateToDateString(wFile.LastAccessed, true).Trim(); txtFileDownloads.Text = wFile.Downloads.ToString().Trim(); txtFileDescription.Text = wFile.Description.Trim(); } else { MessageBox.Show("Error pulling the area description", "WINS Error...", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } } else { MessageBox.Show("Error pulling the selected file", "WINS Error...", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } } catch (Exception ex) { MessageBox.Show("Unexpected Error occurred" + Environment.NewLine + "Error: " + ex.ToString() + Environment.NewLine + "Message: " + ex.Message, "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return 0; }