示例#1
0
		private void gridFields_CellDoubleClick(object sender,ODGridClickEventArgs e) {
			if(ApptFieldDefs.HasDuplicateFieldNames()) {//Check for duplicate field names.
				MsgBox.Show(this,"There are duplicate appointment field defs, go rename or delete the duplicates.");
				return;
			}
			ApptField field=ApptFields.GetOne(PIn.Long(DS.Tables["ApptFields"].Rows[e.Row]["ApptFieldNum"].ToString()));
			if(field==null) {
				field=new ApptField();
				field.AptNum=AptCur.AptNum;
				field.FieldName=DS.Tables["ApptFields"].Rows[e.Row]["FieldName"].ToString();
				if(ApptFieldDefs.Listt[e.Row].FieldType==ApptFieldType.Text) {
					FormApptFieldEdit formAF=new FormApptFieldEdit(field);
					formAF.IsNew=true;
					formAF.ShowDialog();
				}
				else if(ApptFieldDefs.Listt[e.Row].FieldType==ApptFieldType.PickList) {
					FormApptFieldPickEdit formAF=new FormApptFieldPickEdit(field);
					formAF.IsNew=true;
					formAF.ShowDialog();
				}
			}
			else {
				if(ApptFieldDefs.Listt[e.Row].FieldType==ApptFieldType.Text) {
					FormApptFieldEdit formAF=new FormApptFieldEdit(field);
					formAF.ShowDialog();
				}
				else if(ApptFieldDefs.Listt[e.Row].FieldType==ApptFieldType.PickList) {
					FormApptFieldPickEdit formAF=new FormApptFieldPickEdit(field);
					formAF.ShowDialog();
				}
			}
			DS.Tables.Remove("ApptFields");
			DS.Tables.Add(Appointments.GetApptEdit(AptCur.AptNum).Tables["ApptFields"].Copy());
			FillFields();
		}
示例#2
0
 private void gridFields_CellDoubleClick(object sender,ODGridClickEventArgs e)
 {
     ApptField field=ApptFields.GetOne(PIn.Long(DS.Tables["ApptFields"].Rows[e.Row]["ApptFieldNum"].ToString()));
     if(field==null) {
         field=new ApptField();
         field.AptNum=AptCur.AptNum;
         field.FieldName=DS.Tables["ApptFields"].Rows[e.Row]["FieldName"].ToString();
         FormApptFieldEdit formAF=new FormApptFieldEdit(field);
         formAF.IsNew=true;
         formAF.ShowDialog();
     }
     else {
         FormApptFieldEdit formAF=new FormApptFieldEdit(field);
         formAF.ShowDialog();
     }
     DS.Tables.Remove("ApptFields");
     DS.Tables.Add(Appointments.GetApptEdit(AptCur.AptNum).Tables["ApptFields"].Copy());
     FillFields();
 }