예제 #1
0
        //Delegate function to setup Tag Set Information
        void SetTagSetInfo(cls_Tag_Set ts_info, bool edit_flag)
        {
            if (edit_flag)
            {
                int i = 0;

                if (tsm.tag_set_list.Count > 0)
                {
                    foreach (cls_Tag_Set ts in tsm.tag_set_list)
                    {
                        if (ts.TagSetName == ts_info.TagSetName)
                        {
                            break;
                        }
                        i++;
                    }

                    tsm.tag_set_list[i] = ts_info;
                }
            }
            else
            {
                tsm.tag_set_list.Add(ts_info);
            }
        }
예제 #2
0
        private void lvTagSetList_DoubleClick(object sender, EventArgs e)
        {
            string      strTagSetID;
            cls_Tag_Set tsTemp = new cls_Tag_Set();

            if (lvTagSetList.SelectedItems.Count == 0)
            {
                MessageBox.Show("Please select the tag set first!", "Error");
                return;
            }

            strTagSetID = lvTagSetList.SelectedItems[0].Text.Trim();

            int i = 0;

            foreach (cls_Tag_Set ts in this.tsm.tag_set_list)
            {
                if (ts.TagSetName == strTagSetID)
                {
                    tsTemp = this.tsm.tag_set_list[i];
                    break;
                }
                i++;
            }

            frmEditTagSetTemplate frm = new frmEditTagSetTemplate(SetTagSetInfo, tsTemp, i);

            frm.Owner = this;
            frm.ShowDialog();

            tsTemp = null;

            RefreshTagSetList();
            lvTagSetList.Focus();
        }
예제 #3
0
 //Edit Tag Set Constructor
 public frmEditTagSetTemplate(cls_Tag_Set tag_set, int index)
 {
     InitializeComponent();
     this.isEdit        = true;
     this.tag_set_data  = tag_set;
     this.tag_list      = tag_set.tag_set;
     this.calc_tag_list = tag_set.calc_tag_set;
     this.tag_set_index = index;
 }
예제 #4
0
 //Counstructor to Edit Tag Set Template
 public frmEditTagSetTemplate(SetTagSetInfo set_ts, cls_Tag_Set tag_set, int index)
 {
     InitializeComponent();
     this.isEdit = true;
     if (tag_set.TagSetName == "")
     {
         this.isCopy = true;
     }
     this.tag_set_data  = tag_set;
     this.tag_list      = tag_set.tag_set;
     this.calc_tag_list = tag_set.calc_tag_set;
     this.tag_set_index = index;
     this.delgSetTagSet = set_ts;
 }
예제 #5
0
        private void btnTemplateSave_Click(object sender, EventArgs e)
        {
            cls_Tag_Set tmpTagSet = new cls_Tag_Set();

            if (txtTagSetName.Text.Trim() == "")
            {
                MessageBox.Show("Please enter the tag name!", "Error");
                return;
            }
            else
            {
                if (!this.isEdit || this.isCopy)
                {
                    /*
                     * if (!this.delgCheckDuplicate(txtTagSetName.Text.Trim()))
                     * {
                     *  return;
                     * }
                     */
                    bool set_duplicate_flag = (bool)IEW.Platform.Kernel.Platform.Instance.Invoke("GatewayService", "CheckDuplicateTagSetName", new object[] { txtTagSetName.Text.Trim() });
                    if (set_duplicate_flag)
                    {
                        MessageBox.Show(" TagSet Name [" + txtTagSetName.Text.Trim() + "] is duplicate, it should be unique!!", "Error");
                        return;
                    }
                }
            }

            tmpTagSet.TagSetName        = txtTagSetName.Text.Trim();
            tmpTagSet.TagSetDescription = txtTagSetDescription.Text.Trim();
            tmpTagSet.tag_set           = this.tag_list;
            tmpTagSet.calc_tag_set      = this.calc_tag_list;

            if (this.isCopy)
            {
                delgSetTagSet(tmpTagSet, false);
            }
            else
            {
                delgSetTagSet(tmpTagSet, this.isEdit);
            }

            this.Close();
        }