Пример #1
0
 /// <summary>OKボタン クリックイベント</summary>
 /// <param name="sender">発生元オブジェクト</param>
 /// <param name="e">イベント情報</param>
 private void OK_Button_Click(object sender, EventArgs e)
 {
     this.FileName           = (FileNameModel)this.SplitterComboBox.SelectedItem;
     this.FileName.Value     = this.txtValueDetail.Text;
     this.FileName.FieldType = (FieldType?)this.FieldTypeComboBox.SelectedItem;
     this.Close();
 }
Пример #2
0
 /// <summary>ボタンクリックイベント</summary>
 /// <param name="sender">発生元オブジェクト</param>
 /// <param name="e">イベント情報</param>
 private void FileNameDownButton_Click(object sender, EventArgs e)
 {
     if (this.FileNameListBox.SelectedIndex < this.FileNameListBox.Items.Count - 1)
     {
         FileNameModel item  = this.Shelf.FileNames[this.FileNameListBox.SelectedIndex];
         var           index = this.FileNameListBox.SelectedIndex;
         this.Shelf.FileNames.Remove(this.Shelf.FileNames[this.FileNameListBox.SelectedIndex]);
         this.Shelf.FileNames.Insert(this.FileNameListBox.SelectedIndex + 1, item);
         this.SetFileNameItems();
         this.FileNameListBox.SelectedIndex = index + 1;
     }
 }
Пример #3
0
        public IHttpActionResult UpdateFileName(FileType fileType, int recordId, int fileId, FileNameModel model)
        {
            if (string.IsNullOrWhiteSpace(model.FileName))
            {
                return(BadRequest("File Name is required."));
            }
            var dbFile = _repoFactory.Files.GetFiles(fileId, (int)fileType, recordId)?.FirstOrDefault();

            if (dbFile != null)
            {
                dbFile.FileName = model.FileName;
                _repoFactory.Files.UpdateFile(dbFile);
                return(Ok());
            }
            return(NotFound());
        }