// // 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); } }
// // SETs & GETs // To set up any of the Views public void Setup_Control(ref Special_List <Emergency_Call> xECs, ref Special_List <Caller> xCallers, int initialSegment) { // Setting up global data EmergencyCalls = xECs; Callers = xCallers; // Setting up local data Current_Call = new Emergency_Call(); Current_Call.SetDateTime(DateTime.Now); Current_Call.SetState("Not Logged"); Current_Call.SetTeams_Required(1); Current_Call.SetLink_Operator_ID(Current_Operator_ID); // // Setting the default segment Button btnTemp = new Button(); btnTemp.Name = "btnSegment" + initialSegment; //To-Do: change this btnTemp.Text = "Add"; Change_Segment(btnTemp, null); }