Exemple #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnProgramSave_Click(object sender, EventArgs e)
 {
     if (txtProgram.Text != "")
     {
         Programs prog = new Programs();
         if (_programId != 0)
         {
             prog.LoadByPrimaryKey(_programId);
         }
         else
         {
             prog.AddNew();
         }
         prog.Name        = txtProgram.Text;
         prog.Description = txtProgramDescription.Text;
         prog.ParentID    = cboProgram.Visible ? Convert.ToInt32(cboProgram.SelectedValue) : 0;
         prog.Save();
         PopulatePrograms();
         ResetProgram();
     }
     else
     {
         txtProgram.BackColor = Color.FromArgb(251, 214, 214);
     }
 }