コード例 #1
0
        private void setupGridControl(int ID)
        {
            string[] title  = { "Inspection Plan Name", "Inspection Coverage Name", "Equipment Number", "Component Number", "Damage Mechanisms", "Inspection Type", "Inspection Date", "Inspection Effectiveness" };
            string[] Header = { "InspectionPlanName", "InspectionCoverageName", "EquipmentNumber", "ComponentNumber", "DamageMechanisms", "InspectionType", "InspectionDate", "InspectionEffectiveness" };
            int[]    ComID  = assessmentBus.getEquipmentID_ComponentID(ID);
            String   comNum = comMasterBus.getComponentNumber(ComID[1]);
            List <RW_INSPECTION_HISTORY> list = inspectionHistoryBus.getDataComp(comNum);

            if (list.Count > 0)
            {
                gridControl1.DataSource = list;
                gridView1.Columns.Remove(gridView1.Columns["ID"]);
                gridView1.Columns.Remove(gridView1.Columns["SiteName"]);
                gridView1.Columns.Remove(gridView1.Columns["FacilityName"]);
                for (int i = 0; i < title.Length; i++)
                {
                    gridView1.Columns[i].Caption = title[i];
                }
                gridView1.OptionsView.AllowHtmlDrawHeaders = true;
                gridView1.Appearance.HeaderPanel.Options.UseTextOptions = true;
                gridView1.Appearance.HeaderPanel.TextOptions.WordWrap   = DevExpress.Utils.WordWrap.Wrap;
                gridView1.BestFitColumns();
            }
            else
            {
            }
        }
コード例 #2
0
        private void btnAddInspectionPlan_Click(object sender, EventArgs e)
        {
            RW_INSPECTION_HISTORY_BUS rwInsHisBus = new RW_INSPECTION_HISTORY_BUS();
            RW_ASSESSMENT_BUS         rwAssBus    = new RW_ASSESSMENT_BUS();
            int n = rwInsHisBus.getDataComp(rwAssBus.getComponentID(IDAss)).Count;

            if (n > 0)
            {
                dtgvInsHis.Rows.Add("-", DateTime.Now.ToShortDateString(), "Corrosion Under Insulation", "", "", "E", 0, DateTime.Now.ToShortDateString());
            }
            else
            {
                if (dtgvInsHis.RowCount > 0)
                {
                    dtgvInsHis.Rows.Add("-", DateTime.Now.ToShortDateString(), "Corrosion Under Insulation", "", "", "E", 0, DateTime.Now.ToShortDateString());
                }
                else
                {
                    MessageBox.Show("This proposal does not have mitigation plan, please add mitigation planning.", "Inspection / Mitigation", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    return;
                }
            }
        }