Пример #1
0
        public void ShowCompletedLabels()
        {
            int i;
            UILabel hfSectionPwrIds = (UILabel)View.ViewWithTag(iSectionRowsTagId * (m_iEquipmentSectionCounter+ 1));
            int iTotalPwrIds = Convert.ToInt32(hfSectionPwrIds.Text);
            UILabel lblCompleted = (UILabel)View.ViewWithTag (iSectionCompleteLabelTagId * (m_iEquipmentSectionCounter + 1));
            ProjectITPage QuestionsScreen = new ProjectITPage ();
            QuestionsScreen = GetProjectITPPage ();
            if(PowerConversionFullyComplete())
            {
                lblCompleted.Hidden = false;

                for(i = 0 ; i< iTotalPwrIds ; i++)
                {
                    UILabel lblPwrIdComplete = (UILabel)View.ViewWithTag ((iPwrIdSectionCompleteLabelTagId + (i+1)) * (m_iEquipmentSectionCounter+1));
                    lblPwrIdComplete.Hidden = false;
                }

                //Now also show it on the calling ITP screen
                QuestionsScreen.SetPowerConversionCompleted(true);
            }
            else
            {
                lblCompleted.Hidden = true;
                for(i = 0 ; i< iTotalPwrIds ; i++)
                {
                    UILabel lblPwrId = (UILabel)View.ViewWithTag ((iPwrIdRowLabelTagId + (i+1)) * (m_iEquipmentSectionCounter+1));
                    string sPwrId = lblPwrId.Text;
                    UILabel lblPwrIdComplete = (UILabel)View.ViewWithTag ((iPwrIdSectionCompleteLabelTagId + (i+1)) * (m_iEquipmentSectionCounter+1));
                    if(PowerConversionPwrIdComplete(sPwrId))
                    {
                        lblPwrIdComplete.Hidden = false;
                    }
                    else
                    {
                        lblPwrIdComplete.Hidden = true;
                    }
                }

                //Now also show it on the calling ITP screen
                QuestionsScreen.SetPowerConversionCompleted(false);

            }
        }
Пример #2
0
        public void AddNewItem(object sender, EventArgs e, int iBtnIndex, int iPwrIdRow)
        {
            int iEquipmentType = 5;
            float iHeightToAdd = 0.0f;
            UILabel hfThisPwrIdStringRows = (UILabel)View.ViewWithTag((ihfPwrIdStringRowsTagId + iPwrIdRow) * (m_iEquipmentSectionCounter + 1));
            int iTotalStrings = Convert.ToInt32(hfThisPwrIdStringRows.Text);
            UILabel hfPwrId = (UILabel)View.ViewWithTag((iPwrIdRowLabelTagId + iPwrIdRow) * (m_iEquipmentSectionCounter+1));
            string sPwrId = hfPwrId.Text;

            switch (iBtnIndex)
            {
                case 0: //Rack
                    iEquipmentType = 3;
                    break;
                case 1: //SubRack
                    iEquipmentType = 4;
                    break;
                case 2: //Postion
                    iEquipmentType = 5;
                    break;
                case 3: //String
                    iEquipmentType = 7;
                    break;
            }

            UIView EquipmentItemRow = BuildEquipmentItemRowDetails(m_iEquipmentSectionCounter, iPwrIdRow - 1,
                                                                   iTotalStrings, sPwrId, -1,
                                                                   -1, "",
                                                                   "", "", "", "",
                                                                   "", "", "", "", "",
                                                                   "N", "", iEquipmentType, -1,
                                                                   false, false,ref iHeightToAdd);

            //Get the position of the last row in this internal pwrId battery block
            UIView vwPwrInternalRowId = (UIView)View.ViewWithTag((iPwrIdSectionInnerTagId + (iPwrIdRow)) * (m_iEquipmentSectionCounter+1));
            float iPwrIdRowVert = vwPwrInternalRowId.Frame.Height;
            EquipmentItemRow.Frame = new RectangleF(0f, iPwrIdRowVert, 1000f, iHeightToAdd);
            EquipmentItemRow.Tag = iEquipmentFullRowTagId * (iPwrIdRow) + (iTotalStrings + 1);
            vwPwrInternalRowId.AddSubview(EquipmentItemRow);
            RectangleF frame1 = vwPwrInternalRowId.Frame;
            frame1.Height += iHeightToAdd;
            vwPwrInternalRowId.Frame = frame1;

            //Now increase the view height for this new row (the whole section height is managed in the ReduceHeightAfter function)
            UILabel hfPwrIdSectionHeight = (UILabel)View.ViewWithTag((iPwrIdHeightTagId + iPwrIdRow ) * (m_iEquipmentSectionCounter + 1));
            int iPwrIdHeight = Convert.ToInt32(hfPwrIdSectionHeight.Text);
            hfPwrIdSectionHeight.Text = (iPwrIdHeight + iHeightToAdd).ToString();

            //Now increase the number of strings in the PwrId by 1
            iTotalStrings++;
            hfThisPwrIdStringRows.Text = iTotalStrings.ToString();
            ReduceHeightAfter(-iHeightToAdd, iPwrIdRow, iTotalStrings, 2);

            //Set the unsaved tags on
            SetSectionValueChanged(m_iEquipmentSectionCounter + 1);
            SetAnyValueChanged(sender, null);

            //Take off the completed or committed flags and also on the questions screen
            UILabel lblCompleted = (UILabel)View.ViewWithTag (iSectionCompleteLabelTagId * (m_iEquipmentSectionCounter + 1));
            lblCompleted.Hidden = true;
            UILabel lblPwrIdComplete = (UILabel)View.ViewWithTag ((iPwrIdSectionCompleteLabelTagId + (iPwrIdRow)) * (m_iEquipmentSectionCounter+1));
            lblPwrIdComplete.Hidden = true;
            ProjectITPage QuestionsScreen = new ProjectITPage ();
            QuestionsScreen = GetProjectITPPage ();
            QuestionsScreen.SetPowerConversionCompleted(false);

            //And move to the position
            UIScrollView scrollVw = (UIScrollView)View.ViewWithTag(2);
            float iTotalPosn = iPwrIdRowVert + scrollVw.ContentOffset.Y;
            PointF posn = new PointF(0f, iTotalPosn);
            scrollVw.SetContentOffset(posn, true);
        }