コード例 #1
0
        //


        // 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);
            }
        }