Exemple #1
0
        private void 添加标签_Click(object sender, EventArgs e)
        {
            TreeNode node = this.treeView1.SelectedNode;

            if (node != null)
            {
                NameDialog dialog = new NameDialog();
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    if (node.Tag.GetType() == typeof(CalModel))
                    {
                        CalModel model = node.Tag as CalModel;
                        if (model != null)
                        {
                            model.AddTag(dialog.Result);
                        }
                    }
                    else if (node.Tag.GetType() == typeof(CalOrg))
                    {
                        CalOrg org = node.Tag as CalOrg;
                        if (org != null)
                        {
                            org.AddTag(dialog.Result);
                        }
                    }
                    bindingSource1.ResetBindings(false);
                }
            }
        }
Exemple #2
0
        private void 添加组织结构ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TreeNode node = this.treeView1.SelectedNode;

            if (node != null)
            {
                NameDialog dialog = new NameDialog();
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    if (node.Tag.GetType() == typeof(CalModel))
                    {
                        CalModel model = node.Tag as CalModel;
                        if (model != null)
                        {
                            CalOrg   nOrg  = model.AddOrg(dialog.Result);
                            TreeNode nNode = node.Nodes.Add(nOrg.OrgName);
                            nNode.Tag = nOrg;
                        }
                    }
                    else if (node.Tag.GetType() == typeof(CalOrg))
                    {
                        CalOrg org = node.Tag as CalOrg;
                        if (org != null)
                        {
                            CalOrg   nOrg  = org.AddOrg(dialog.Result);
                            TreeNode nNode = node.Nodes.Add(nOrg.OrgName);
                            nNode.Tag = nOrg;
                        }
                    }
                }
            }
        }
Exemple #3
0
        private void 添加标签组ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NameDialog dialog = new NameDialog();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                Calf_Taggroup group = new Calf_Taggroup();
                group.EID   = Guid.NewGuid().ToString();
                group.ENAME = dialog.Result;
                taggroupTable.Add(group);
                lstTagGroups.Items.Add(group);
            }
        }
Exemple #4
0
        private void 添加模型ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NameDialog dialog = new NameDialog();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                CalModel model = new CalModel();
                model.EID       = Guid.NewGuid().ToString();
                model.ModelName = dialog.Result;
                TreeNode node = treeView1.Nodes.Add(model.ModelName);
                node.Tag = model;
            }
        }
Exemple #5
0
 private void 添加标签ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (SelectTagGroup != null)
     {
         NameDialog dialog = new NameDialog();
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             Calf_Taggroup_Item groupItem = new Calf_Taggroup_Item();
             groupItem.EID        = Guid.NewGuid().ToString();
             groupItem.TAGGROUPID = SelectTagGroup.EID;
             groupItem.TAGNAME    = dialog.Result;
             SelectTagGroup.Calf_Taggroup_ItemTable.Add(groupItem);
             lstTags.Items.Add(groupItem);
         }
     }
 }
Exemple #6
0
        private void 设定分摊公式ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NameDialog dialog = new NameDialog();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                foreach (Row row in c1FlexGrid1.Rows)
                {
                    if (c1FlexGrid1.Selection.ContainsRow(row.SafeIndex))
                    {
                        CalTag tag = row.DataSource as CalTag;

                        CalTag fenTanTag = tag.GetBrotherTag(dialog.Result);
                        if (fenTanTag != null)
                        {
                            List <CalTag> subTags = tag.GetChildTags();
                            if (subTags.Count > 1)
                            {
                                string lastFormua = "";
                                for (int i = 0; i < subTags.Count - 1; i++)
                                {
                                    CalTag item = subTags[i];
                                    lastFormua += "-" + item.TagFullName;
                                    CalTag subFenTag = item.GetBrotherTag(dialog.Result);
                                    if (subFenTag != null)
                                    {
                                        item.Forma = string.Format("{0}*{1}/{2}", tag.TagFullName, subFenTag.TagFullName, fenTanTag.TagFullName);
                                    }
                                }
                                subTags[subTags.Count - 1].Forma = tag.TagFullName + lastFormua;
                            }
                            else if (subTags.Count == 1)
                            {
                                subTags[0].Forma = tag.TagFullName;
                            }
                        }
                    }
                }
            }
        }
Exemple #7
0
        private void 添加标签ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TreeNode node = this.treeView1.SelectedNode;

            if (node != null)
            {
                NameDialog dialog = new NameDialog();
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    //string tagName = dialog.Result;
                    //string formula = "";
                    //int splitIdx = dialog.Result.IndexOf('=');
                    //if (splitIdx > 0)
                    //{
                    //    tagName = dialog.Result.Substring(0, splitIdx);
                    //    formula = dialog.Result.Substring(splitIdx, dialog.Result.Length - splitIdx - 1);
                    //}

                    if (node.Tag.GetType() == typeof(CalModel))
                    {
                        CalModel model = node.Tag as CalModel;
                        if (model != null)
                        {
                            model.AddTagGroup(dialog.Result);
                        }
                    }
                    else if (node.Tag.GetType() == typeof(CalOrg))
                    {
                        CalOrg org = node.Tag as CalOrg;
                        if (org != null)
                        {
                            org.AddTagGroup(dialog.Result);
                        }
                    }
                    bindingSource1.ResetBindings(false);
                }
            }
        }