private void btnRestoreInspectionPlan_Click(object sender, EventArgs e)
        {
            WaitForm2 wf = new WaitForm2();

            wf.Show();
            dtgvInsHis.Rows.Clear();

            RW_ASSESSMENT_BUS              rwAssBus    = new RW_ASSESSMENT_BUS();
            INSPECTION_COVERAGE_BUS        insCovBus   = new INSPECTION_COVERAGE_BUS();
            INSPECTION_PLAN_BUS            inPlanBus   = new INSPECTION_PLAN_BUS();
            INSPECTION_COVERAGE_DETAIL_BUS insCovDeBus = new INSPECTION_COVERAGE_DETAIL_BUS();
            DM_ITEMS_BUS dmItemsBus     = new DM_ITEMS_BUS();
            List <int>   listIDCoverage = insCovBus.getlistIDbyEquipmentIDandComponentID(rwAssBus.getEquipmentID(IDAss), rwAssBus.getComponentID(IDAss));

            foreach (int i in listIDCoverage)
            {
                List <int> listIDDetal = insCovDeBus.getIDbyCoverageID(i);
                foreach (int j in listIDDetal)
                {
                    INSPECTION_COVERAGE_DETAIL insCovDe = insCovDeBus.getDataSourcebyID(j);
                    dtgvInsHis.Rows.Add(inPlanBus.getPlanName(insCovBus.getPlanIDbyID(i)), insCovDe.InspectionDate.ToShortDateString(), dmItemsBus.getDMDescriptionbyDMItemID(insCovDe.DMItemID), insCovDe.InspectionSummary, "...", insCovDe.EffectivenessCode, insCovDe.IsCarriedOut, insCovDe.CarriedOutDate.ToShortDateString(), "Delete");
                }
            }
            int n = dtgvInsHis.RowCount;

            for (int i = 0; i < n; i++)
            {
                dtgvInsHis.Rows[i].ReadOnly          = true;
                dtgvInsHis.Rows[i].Cells[6].ReadOnly = false;
                dtgvInsHis.Rows[i].Cells[5].ReadOnly = false;
                dtgvInsHis.Rows[i].Cells[8].ReadOnly = false;
                dtgvInsHis.Rows[i].Cells[3].ReadOnly = false;
            }
            wf.Close();
        }
Esempio n. 2
0
 public void Showtab(int PlanID)
 {
     try
     {
         INSPECTION_PLAN_BUS businsplan = new INSPECTION_PLAN_BUS();
         InspectionPlanName.Text = businsplan.getPlanName(PlanID);
         InspectionDate.Text     = businsplan.getPlanDate(PlanID).ToString();
         IDPlan = PlanID;
     }
     catch
     {
         // do nothing
     }
 }
Esempio n. 3
0
        private List <INSPECTION_COVERAGE> getDataPlanCoverage(int PlanID)
        {
            INSPECTION_COVERAGE_BUS    busInspcove = new INSPECTION_COVERAGE_BUS();
            List <INSPECTION_COVERAGE> listInscove = busInspcove.getDataID(PlanID);
            List <INSPECTION_COVERAGE> listData    = new List <INSPECTION_COVERAGE>();
            EQUIPMENT_MASTER_BUS       buseq       = new EQUIPMENT_MASTER_BUS();
            COMPONENT_MASTER_BUS       buscom      = new COMPONENT_MASTER_BUS();
            INSPECTION_PLAN_BUS        businsplan  = new INSPECTION_PLAN_BUS();

            foreach (INSPECTION_COVERAGE inspCove in listInscove)
            {
                INSPECTION_COVERAGE rwInspCove = inspCove;
                rwInspCove.EquipmentName      = buseq.getEquipmentName(inspCove.EquipmentID);
                rwInspCove.ComponentName      = buscom.getComponentName(inspCove.ComponentID);
                rwInspCove.InspectionPlanName = businsplan.getPlanName(inspCove.PlanID);
                rwInspCove.InspectionPlanDate = businsplan.getPlanDate(inspCove.PlanID).ToString();
                listData.Add(rwInspCove);
            }
            return(listData);
        }