示例#1
0
        private void PrintJobStatWithLeads(bool isPreview, int sortCode)
        {
            //*******************************************Added*****5/7
            if (IsDepartmentSelected() == false)
            {
                MessageBox.Show("Please select at least one Department", "Search Again", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (IsProjectSelected() == false)
            {
                MessageBox.Show("Please select at least one Lead", "Search Again", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            //*************************************************************



            if (IsDepartmentAllChecked() == true)
            {
                MessageBox.Show("Unable to print project leads in multiple departments", "Multiple Departments", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            CPDrawingLog dl   = new CPDrawingLog();
            string       xml1 = "";
            string       xml2 = "";

            CreateDepartmentXMLList(ref xml1);
            CreateLeadXMLList(ref xml2);

            dl.PrintJobStatList(xml1, xml2, true, isPreview, sortCode);
        }
示例#2
0
        private void PrintJobStatWithProjects(bool isPreview, int sortCode)
        {   //**********************************I am adding here*******************
            if (IsDepartmentSelected() == false)
            {
                MessageBox.Show("Please select at least one Department", "Search Again", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (IsProjectSelected() == false)
            {
                MessageBox.Show("Please select at least one Project", "Search Again", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            //************************************************************


            if (IsDepartmentAllChecked() == true && IsProjectLeadAllChecked() == true)
            {
                MessageBox.Show("Please limit your search, selecting all departments and projects will return too large a result set", "Search Limit", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            CPDrawingLog dl   = new CPDrawingLog();
            string       xml1 = "";
            string       xml2 = "";

            if (IsDepartmentAllChecked() == true)
            {
                CreateProjectXMLList(ref xml1);
                // CreateDepartmentXMLList(ref xml1); // *********************** Added to check
                dl.PrintJobStatList(xml1, false, isPreview, sortCode);
            }
            else if (IsProjectLeadAllChecked() == true)
            {
                CreateDepartmentXMLList(ref xml1);
                //  CreateProjectXMLList(ref xml1); // *********************** Added to check

                dl.PrintJobStatList(xml1, true, isPreview, sortCode);
            }
            else
            {
                CreateDepartmentXMLList(ref xml1);
                CreateProjectXMLList(ref xml2);
                dl.PrintJobStatList(xml1, xml2, isPreview, sortCode);
            }
        }