Exemplo n.º 1
0
        private void InputForm_InputDataReady(object sender, InputDataReadyEventArgs e)
        {
            string searchTerm = e.SearchString;
            List <ATEscalationsModel> escalations = GlobalConfig.Connection.SearchEscalations(searchTerm.ToUpper());

            switch (escalations.Count)
            {
            case 0:
                MessageBox.Show("No matching records found.");
                this.Close();
                break;

            case 1:
                ATEscalationsDisplayModel displayModel = new ATEscalationsDisplayModel(escalations[0]);
                dataLoading = true;
                loadBoxes(displayModel);
                break;

            default:
                frmMultiSelect displayForm = new frmMultiSelect();
                List <ATEscalationsDisplayModel> displayModels = convertToDisplayList(escalations);
                displayForm.Escalations = displayModels;
                displayForm.Show();
                break;
            }
        }
Exemplo n.º 2
0
        private void delSearchContact()
        {
            GV.MODE           = Mode.DeleteCustomer;
            btnDelete.Visible = true;
            List <FieldSearchModel> DelsearchTerms = new List <FieldSearchModel>();

            foreach (Control control in this.Controls)
            {
                if (control is TextBox & control.Text != "")
                {
                    FieldSearchModel model = new FieldSearchModel();
                    model.FieldName  = control.Tag.ToString();
                    model.FieldValue = control.Text;
                    DelsearchTerms.Add(model);
                    model = null;
                }
            }
            List <CustomerModel> customers = SearchOps.FieldSearchCI <CustomerModel>(DelsearchTerms, "tblCustContact",
                                                                                     true);
            frmMultiSelect delResultsForm = new frmMultiSelect();

            delResultsForm.CustomerData = customers;
            delResultsForm.CallingForm  = this;
            btnDelete.Visible           = true;
            delResultsForm.Show();
        }
Exemplo n.º 3
0
        private void FrmInput_InputDataReady(object sender, InputDataReadyEventArgs e)
        {
            string searchTerm             = e.SearchString;
            List <LabRequestModel> models = GlobalConfig.Connection.SearchLabRequests(searchTerm.ToUpper());

            this.Show();
            switch (models.Count)
            {
            case 0:
                MessageBox.Show("No matching records found.");
                break;

            case 1:
                LabRequestModel model = models[0];;
                loadBoxes(model);
                cboMSO.Focus();
                displayAttachments();
                break;

            default:
                frmMultiSelect displayForm = new frmMultiSelect();

                displayForm.LabRequests = models;
                displayForm.Show();
                break;
            }
        }
Exemplo n.º 4
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            MSO_Model MSO    = (MSO_Model)cboMSOSelector.SelectedItem;
            int       MSO_ID = MSO.ID;
            List <AssignmentTableModel> assignmentTableModels = GlobalConfig.Connection.GetItemByColumn <AssignmentTableModel>("tblAssignments", "MSO_ID", "", MSO_ID);
            frmMultiSelect resultForm = new frmMultiSelect();

            resultForm.AssignmentData = assignmentTableModels;
            this.Close();
            resultForm.Show();
        }
Exemplo n.º 5
0
        private void btnSearchDateRange_Click(object sender, EventArgs e)
        {
            DateTime startDate = dtpStartDateRange.Value;
            DateTime endDate   = dtpEndDateRange.Value;
            //Get all assignments in date range
            List <AssignmentTableModel> Assignments = GlobalConfig.Connection.DateRangeSearch_SortBy(startDate, endDate);
            frmMultiSelect DisplayForm = new frmMultiSelect();

            DisplayForm.AssignmentData = Assignments;
            DisplayForm.Show();
            DisplayForm.BringToFront();
            this.Close();
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            switch (GV.MODE)
            {
            case Mode.New:
                break;

            case Mode.Edit:
                break;

            case Mode.Undo:
                break;

            case Mode.CustomerSearch:
                break;

            case Mode.CustomerSearchMDI:
                break;

            case Mode.AddCustomer:
                break;

            case Mode.EditCustomer:
                break;

            case Mode.DeleteCustomer:
                break;

            case Mode.AddCustomerLocation:
                GlobalConfig.Connection.CustomerLocations_Get
                    ("", "Insert", 0, txtSiteName.Text, cboMSO.Text, txtAddress.Text, cboCity.Text, cboState.Text, cboCountry.Text, txtPostalCode.Text, cboRegion.Text, 0);
                GV.MODE         = Mode.EditCustomerLocation;
                btnSave.Visible = true;
                break;

            case Mode.EditCustomerLocation:
                btnSave.Visible = true;
                LocationModel location = new LocationModel();
                int           lid      = 0;
                int.TryParse(txtLocID.Text, out lid);
                location.ID         = lid;
                location.SiteName   = txtSiteName.Text;
                location.Address    = txtAddress.Text;
                location.City       = cboCity.Text;
                location.State      = cboState.Text;
                location.Country    = cboCountry.Text;
                location.PostalCode = txtPostalCode.Text;
                location.Region     = cboRegion.Text;
                GlobalConfig.Connection.CustomerLocations_Get
                    ("", "Update", lid, txtSiteName.Text, _location.MSO, txtAddress.Text, cboCity.Text, cboState.Text, cboCountry.Text, txtPostalCode.Text, cboRegion.Text, _location.ContactID);
                break;

            case Mode.DeleteCustomerLocation:
                GV.MODE = Mode.DeleteCustomerLocation;
//added search for deleting LD
                List <SearchTermModel> searchTermsDel = collectSearchTerms();
                string clauseDel = WhereClauseGenerator.MakeWhereClause(searchTermsDel);
                Locations = GlobalConfig.Connection.CustomerLocations_Get(clauseDel, "Select", 0, "", "", "", "", "", "", "", "", 0);
                frmMultiSelect locationFormDel = new frmMultiSelect();
                locationFormDel.LocationData = Locations;
                locationFormDel.Show();
                locationFormDel.BringToFront();

                break;

            case Mode.LocationSearch:
                break;

            case Mode.LocationSearchMDI:
                List <SearchTermModel> searchTerms = collectSearchTerms();
                string clause = WhereClauseGenerator.MakeWhereClause(searchTerms);
                Locations = GlobalConfig.Connection.CustomerLocations_Get(clause, "Select", 0, "", "", "", "", "", "", "", "", 0);
                frmMultiSelect locationForm = new frmMultiSelect();
                locationForm.LocationData = Locations;
                locationForm.Show();
                locationForm.BringToFront();
                break;

            case Mode.None:
                break;

            default:
                break;
            }
        }