public static List <AssignmentDisplayModel> ConvertRetrieveToDisplay(List <AssignmentTableModel> R)
        {
            //make AssignmentDisplayModel
            List <AssignmentDisplayModel> displayAssignments = new List <AssignmentDisplayModel>();

            FE_List = GlobalConfig.Connection.GenericGetAll <FE_Model>("tblFE");
            Hashtable feTable = DB_TableToHashTable.dbTableToHashTable(FE_List);

            FE_List      = null;
            Product_List = GlobalConfig.Connection.GenericGetAll <ProductModel>("tblProducts");
            Hashtable productTable = DB_TableToHashTable.dbTableToHashTable(Product_List);

            Product_List = null;

            foreach (var assignment in R)
            {
                AssignmentDisplayModel D = new AssignmentDisplayModel();
                D.Activity      = assignment.Activity;
                D.Comments      = assignment.Comments;
                D.CustEMail     = assignment.CustEMail;
                D.CustPhone     = assignment.CustPhone;;
                D.CRMNumber     = assignment.CRMNumber;
                D.CustReqDate   = assignment.CustReqDate;
                D.DateCompleted = assignment.DateCompleted;
                D.DocCovid      = assignment.DocCovid;
                D.DocCrm        = assignment.DocCrm;
                D.DocRoster     = assignment.DocRoster;
                D.DocTripRpt    = assignment.DocTripRpt;
                D.DocWRE        = assignment.DocWRE;
                D.EndDate       = assignment.EndDate;
                D.HrsOnSite     = assignment.HrsOnSite;
                D.LocAddress    = assignment.LocAddress;
                D.LocCity       = assignment.LocCity;
                D.LocCountry    = assignment.LocCountry;
                D.LocPostalCode = assignment.LocPostalCode;
                D.LocRegion     = assignment.LocRegion;
                D.LocState      = assignment.LocState;
                D.SiteName      = assignment.SiteName;
                D.MSO           = assignment.MSO;
                D.NumTechs      = assignment.NumTechs;
                D.ProductList   = makeProductList(productTable, assignment.ProductListXML);
                //D.Requestor = assignment.SalesPerson;
                D.StartDate = assignment.StartDate;
                D.FE_List   = makeFEList(feTable, assignment.FE_ListXML);
                D.RequestID = assignment.RequestID;

                displayAssignments.Add(D);
            }



            return(displayAssignments);
        }
Esempio n. 2
0
        public static List <AssignmentDisplayModel> ConvertTableToDisplayModel(List <AssignmentTableModel> tableList)
        {
            List <AssignmentDisplayModel> displayList = new List <AssignmentDisplayModel>();

            foreach (var T in tableList)
            {
                AssignmentDisplayModel D = new AssignmentDisplayModel();
                D.Activity          = T.Activity;
                D.Comments          = T.Comments;
                D.CRMNumber         = T.CRMNumber;
                D.CustEMail         = T.CustEMail;
                D.CustomerFirstName = T.CustFirstName;
                D.CustomerLastName  = T.CustLastName;
                D.CustPhone         = T.CustPhone;
                D.CustReqDate       = T.CustReqDate;
                D.DateCompleted     = T.DateCompleted;
                D.DocCovid          = T.DocCovid;
                D.DocCrm            = T.DocCrm;
                D.DocRoster         = T.DocRoster;
                D.DocTripRpt        = T.DocTripRpt;
                D.DocWRE            = T.DocWRE;
                D.EndDate           = T.EndDate;
                D.FE_List           = makeListFromXML(T.FE_ListXML, ListType.FE);
                D.HrsOnSite         = T.HrsOnSite;
                D.LocAddress        = T.LocAddress;
                D.LocCity           = T.LocCity;
                D.LocCountry        = T.LocCountry;
                D.LocPostalCode     = T.LocPostalCode;
                D.LocRegion         = T.LocRegion;
                D.LocState          = T.LocState;
                D.MSO         = T.MSO;
                D.NumTechs    = T.NumTechs;
                D.ProductList = makeListFromXML(T.ProductListXML, ListType.Product);
                D.RequestID   = T.RequestID;
                D.SalesPerson = T.SalesPerson;
                D.SiteName    = T.SiteName;
                D.StartDate   = T.StartDate;
                D.CustomerID  = T.ContactID;
                D.LocationID  = T.LocationID;

                displayList.Add(D);
            }

            return(displayList);
        }
        private void dgvResults_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            int           selectedRow = dgvResults.CurrentRow.Index;
            CustomerModel customer;

            switch (GV.MODE)
            {
            case Mode.New:
                break;

            case Mode.Edit:
            case Mode.DateRangeReport:
                AssignmentDisplayModel assignment = displayList[selectedRow];
                GV.ASSIGNMENTFORM.Assignment = retrieveList[selectedRow];
                GV.ASSIGNMENTFORM.BringToFront();
                break;

            case Mode.Undo:
                break;

            case Mode.CustomerSearch:
                customer = customerData[selectedRow];
                GV.ASSIGNMENTFORM.FillCustomerData(customer);
                GV.MODE = GV.PreviousMode;
                this.Close();
                break;

            case Mode.CustomerSearchMDI:
                customer = customerData[selectedRow];
                CallingForm.FillBoxes(customer);
                this.Close();
                break;

            // added this LD not sure....
            case Mode.DeleteCustomer:
                customer = customerData[selectedRow];
                CallingForm.FillBoxes(customer);
                this.Close();
                break;

            case Mode.LocationSearch:
                LocationModel location = locationData[selectedRow];
                GV.ASSIGNMENTFORM.FillLocationData(location);
                GV.MODE = GV.PreviousMode;
                this.Close();
                break;

            case Mode.SearchEscalation:
                ATEscalationsDisplayModel escalation = escalations[selectedRow];
                GV.ESCALATIONFORM.loadBoxes(escalation);
                GV.MODE = Mode.EditEscalation;
                break;

            case Mode.LabRequestEdit:
                LabRequestModel labRequest = labRequests[selectedRow];
                GV.LABREQUESTFORM.LabRequest = labRequest;
                break;

            case Mode.None:
                break;

            default:
                break;
            }
            //GV.MAINMENU.BringToFront();
            this.Close();
        }