private void PopulateFields(Emergency_Call xCall) { txtCallDateTime.Text = xCall.GetDateTime().ToString("h:mm:ss MM/dd/yyyy"); if (xCall.GetPriority() != 0) { cboCallPriority.SelectedIndex = xCall.GetPriority() - 1; } numTeams.Value = xCall.GetTeams_Required(); txtAddress.Text = xCall.GetAddress(); txtLandmark.Text = xCall.GetLandmark(); txtDescription.Text = xCall.GetDescription(); txtOperator.Text = xCall.GetLinked_Operator_ID().ToString(); txtPhoneNumber.Text = xCall.GetEmergency_Caller().GetPhone_Number(); txtCallerName.Text = xCall.GetEmergency_Caller().GetName(); }
// // FUNCTIONAL METHODS private bool CheckFields() { // Existence checks if (Current_Call.GetPriority() == 0) { cboCallPriority.Focus(); return(false); } else if (Current_Call.GetEmergency_Caller().GetPhone_Number() == null) { txtPhoneNumber.Focus(); return(false); } else if (Current_Call.GetEmergency_Caller().GetName() == null) { txtCallerName.Focus(); return(false); } else if (Current_Call.GetAddress() == null) { txtAddress.Focus(); return(false); } else if (Current_Call.GetDescription() == null) { txtDescription.Focus(); return(false); } else { // All checks are satisfied Current_Call.SetTeams_Required((int)numTeams.Value); Current_Call.SetLandmark(txtLandmark.Text); Current_Call.SetLink_Operator_ID(Current_Operator_ID); //Update the Shared Data values regarding the Calls. EmergencyCalls.AddItem(Current_Call); return(true); } }