I got into an issue with Patient Field setup with Date data type. In FormPatFieldDateEdit.cs, the butOK_Click() implementation doesn't allow user to enter any value if the field is empty. Checking the code below, the _fieldCur.FieldValue and _fieldOld.FieldValue are both empty if there's no value for the current field. If you want to keep that code, I think you need to update the _fieldCur.FieldValue when the textFieldDate.Text changed but currently there's no such event handler. Could you double check and give advice? Note that if the patient field data type is TEXT, there's no issue.
Code: Select all
private void butOK_Click(object sender, System.EventArgs e) {
if(textFieldDate.errorProvider1.GetError(textFieldDate)!="") {
MsgBox.Show(this,"Invalid date");
return;
}
if(_fieldCur.FieldValue==""){//if blank, then delete
if(IsNew) {
DialogResult=DialogResult.Cancel;
return;
}
PatFields.Delete(_fieldCur);
if(_fieldOld.FieldValue!="") {//We don't need to make a log for field values that were blank because the user simply clicked cancel.
PatFields.MakeDeleteLogEntry(_fieldOld);
}
DialogResult=DialogResult.OK;
return;
}
_fieldCur.FieldValue=textFieldDate.Text;
if(IsNew){
PatFields.Insert(_fieldCur);
}
else{
PatFields.Update(_fieldCur);
PatFields.MakeEditLogEntry(_fieldOld,_fieldCur);
}
DialogResult=DialogResult.OK;
}
Minh