Example #1
0
        public void VersionCompareButtonClicked(object sender, VersionCompareButtonClickedEventArgs args)
        {
            LinkedList llCondition = new LinkedList("CHART_ID", args.ModelID);

            llCondition.Add("VERSIONS", args.Versions);
            this.spcModelVersionCompareResultUC1.LOCATION_RAWID = this._line;
            this.spcModelVersionCompareResultUC1.AREA_RAWID     = this._area;
            this.spcModelVersionCompareResultUC1.EQP_MODEL      = this._eqpModel;
            this.spcModelVersionCompareResultUC1.GROUP_NAME     = this._groupName;
            this.spcModelVersionCompareResultUC1.ISMET          = this.isMETModelHistory;
            this.spcModelVersionCompareResultUC1.PageSearch(llCondition);
            this.spcModelVersionCompareResultUC1.Compare(llCondition);

            bTabControl1.SelectedIndex = 1;
        }
        private void VersionCompareClicked()
        {
            if (!(this.bSpread1 != null && this.bSpread1.ActiveSheet.RowCount > 0))
            {
                MSGHandler.DisplayMessage(MSGType.Information, "SPC_INFO_SEARCH_HISTORY", null, null);
                return;
            }

            //int selectColumnIndex = GetColumnIndex("SELECT");
            //if(selectColumnIndex == -1)
            //    throw new Exception("There is no 'select' column.");

            ArrayList selectedList = bSpread1.GetCheckedList(0);

            if (selectedList.Count < 1)
            {
                MSGHandler.DisplayMessage(MSGType.Information, "SPC_INFO_SELECT_COMPARE_MODEL", null, null);
                return;
            }

            string modelID = lastestCondition[Definition.CONDITION_KEY_MODEL_CONFIG_RAWID].ToString();

            List <string> version      = new List <string>();
            int           versionIndex = GetColumnIndex(COLUMN.VERSION);

            foreach (int i in selectedList)
            {
                //version.Add(this.bSpread1.ActiveSheet.GetText(i, versionIndex));
                version.Add(Convert.ToInt32((Convert.ToDouble(this.bSpread1.ActiveSheet.GetText(i, versionIndex)) - 1) * 100).ToString());
            }

            if (VersionCompareButtonClicked != null)
            {
                var args = new VersionCompareButtonClickedEventArgs {
                    ModelID = modelID, Versions = version.ToArray()
                };
                VersionCompareButtonClicked(this, args);
            }
        }