示例#1
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (OldFieldName != textName.Text)
     {
         for (int i = 0; i < PatFieldDefs.List.Length; i++)
         {
             if (PatFieldDefs.List[i].FieldName == textName.Text)
             {
                 MsgBox.Show(this, "Field name currently being used.");
                 return;
             }
         }
     }
     FieldDef.FieldName = textName.Text;
     FieldDef.FieldType = (PatFieldType)comboFieldType.SelectedIndex;
     if (FieldDef.FieldType == PatFieldType.PickList)
     {
         if (textPickList.Text == "")
         {
             MsgBox.Show(this, "List cannot be blank.");
             return;
         }
         FieldDef.PickList = textPickList.Text;
     }
     if (IsNew)
     {
         PatFieldDefs.Insert(FieldDef);
     }
     else
     {
         PatFieldDefs.Update(FieldDef, OldFieldName);
     }
     DialogResult = DialogResult.OK;
 }
 private void butOK_Click(object sender, System.EventArgs e)
 {
     FieldDef.FieldName = textName.Text;
     if (IsNew)
     {
         PatFieldDefs.Insert(FieldDef);
     }
     else
     {
         PatFieldDefs.Update(FieldDef, OldFieldName);
     }
     DialogResult = DialogResult.OK;
 }