private void FillForm() { FillTable(); try { _statusFile = DataMethod.CheckStatusFile(_fileStruct.fileId); _statusFavorite = DataMethod.CheckFavorite(_userActive.userId, _fileStruct.fileId); Text = "Свойства файла: " + _fileStruct.name + _fileStruct.extension; textBoxName.Text = _fileStruct.name; richTextBoxComment.Text = _fileStruct.comment; textBoxExpansion.Text = _fileStruct.extension.ToUpper(); textBoxAT.Text = _fileStruct.dateTimeAT.ToString(); textBoxUP.Text = _fileStruct.dateTimeUP.ToString(); linkLabelLogin.Text = _userStruct.login; textBoxSize.Text = FileMethod.FileSize(Convert.ToDouble(_fileStruct.size)); labelStatusFile.Text = _statusFile; labelStatusFile.ForeColor = (_statusFile == "Проект") ? Color.DarkGreen : (_statusFile == "На проверке") ? Color.DarkOrange : Color.DarkRed; buttonUpdate.Enabled = (_userStruct.userId == _userActive.userId || _userActive.levelName != "Пользователь"); buttonFavorite.Text = (_statusFavorite == true) ? "Убрать из избранного" : "Добавить в избранное"; buttonStatus.Text = (_statusFile == "На проверке") ? "Отменить проверку" : "Отправить на проверку"; buttonStatus.Visible = (_userStruct.userId == _userActive.userId && _userActive.levelName == "Пользователь" && _statusFile != "Проект"); buttonYes.Visible = (_userActive.levelName != "Пользователь"); buttonYes.Enabled = (_statusFile != "Проект"); buttonNo.Visible = (_userActive.levelName != "Пользователь"); buttonNo.Enabled = (_statusFile != "Черновик"); } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void FillForm() { this.Text += _userStruct.login; this.textBoxLogin.Text = _userStruct.login; this.textBoxLevel.Text = _userStruct.levelName; this.textBoxName.Text = _userStruct.name; this.textBoxSurname.Text = _userStruct.surname; this.textBoxProject.Text = DataMethod.CountFiles(_userStruct.userId, StatusFile.Project).ToString(); this.textBoxReview.Text = DataMethod.CountFiles(_userStruct.userId, StatusFile.Review).ToString(); this.textBoxDraft.Text = DataMethod.CountFiles(_userStruct.userId, StatusFile.Draft).ToString(); this.textBoxAllFiles.Text = DataMethod.CountFiles(_userStruct.userId, StatusFile.My).ToString(); this.textBoxSizeFiles.Text = FileMethod.FileSize(DataMethod.SizeAllFiles(_userStruct.userId)); this.textBoxDatetimeAT.Text = _userStruct.dateTimeAT.ToString(); this.pictureBoxUser.SizeMode = PictureBoxSizeMode.StretchImage; this.pictureBoxUser.Image = (_userStruct.binary != null) ? ImageMethod.BinaryToImage(_userStruct.binary) : null; }
private void FillForm() { StatusFile statusFile = DataMethod.CheckStatusFile(_fileStruct.fileId); _statusReview = (statusFile == StatusFile.Review) ? true : false; this.RefreshTable(); this.comboBoxStatusFile.Text = (statusFile == StatusFile.Project) ? "Проект" : "Черновик"; this.Text = "Свойства файла: " + _fileStruct.name + _fileStruct.expansion.ToLower(); this.textBoxName.Text = _fileStruct.name; this.richTextBoxComment.Text = _fileStruct.comment; this.textBoxExpansion.Text = _fileStruct.expansion.ToUpper(); this.textBoxAT.Text = _changeStruct.dateTimeAT.ToString(); this.textBoxUP.Text = _changeStruct.dateTimeUP.ToString(); this.linkLabelLogin.Text = _userStruct.login; this.textBoxSize.Text = FileMethod.FileSize(Convert.ToDouble(_fileStruct.size)); }
private void FillForm() { try { Text = "Свойства пользователя: " + _userStruct.login; textBoxLogin.Text = _userStruct.login; textBoxLevel.Text = _userStruct.levelName; textBoxName.Text = _userStruct.name; textBoxSurname.Text = _userStruct.surname; textBoxProject.Text = DataMethod.CountFiles(_userStruct.userId, StatusFileEnum.Project).ToString(); textBoxDraft.Text = DataMethod.CountFiles(_userStruct.userId, StatusFileEnum.Draft).ToString(); textBoxAllFiles.Text = DataMethod.CountFiles(_userStruct.userId, StatusFileEnum.My).ToString(); textBoxSizeFiles.Text = FileMethod.FileSize(DataMethod.SizeAllFiles(_userStruct.userId)); textBoxDatetimeAT.Text = _userStruct.dateTimeAT.ToString(); pictureBoxUser.SizeMode = PictureBoxSizeMode.StretchImage; pictureBoxUser.Image = (_userStruct.binary != null) ? ImageMethod.BinaryToImage(_userStruct.binary) : null; } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }