Пример #1
0
 private void EditContentStatus_Shown(object sender, EventArgs e)
 {
     if (this._editableId != -1)
     {
         this._entity = ApplicationMap.ContentStatus[this._editableId];
         this.nameTB.Text = _entity.Name;
     }
 }
Пример #2
0
        private void saveBtn_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(nameTB.Text.Trim()))
            {
                this.Close();
                return;
            }

            if (this._editableId != -1)
            {
                this._entity.Name = nameTB.Text.Trim();
                ApplicationMap.ContentStatus[this._editableId] = this._entity;
            }
            else
            {
                this._entity = new ContentStatus(this.nameTB.Text.Trim());
                ApplicationMap.ContentStatus[this._editableId] = this._entity;
            }

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }