Example #1
0
 private void cobParamName_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.cobParamName.SelectedIndex > -1)
     {
         this.cobOper.Properties.Items.Clear();
         DEMetaAttribute attribute = (DEMetaAttribute)this.filterAttrs[this.cobParamName.SelectedIndex];
         this._curAttr = attribute;
         if (((attribute.DataType == 0) || (attribute.DataType == 1)) || ((attribute.DataType == 2) || (attribute.DataType == 6)))
         {
             this.cobOper.Properties.Items.AddRange(new object[] { "=", ">", "<", ">=", "<=", "<>", "为空", "不为空" });
             this.cobOper.Text = "=";
         }
         else if (((attribute.DataType == 4) || (attribute.DataType == 3)) || (attribute.DataType == 5))
         {
             this.cobOper.Properties.Items.AddRange(new object[] { "前几字符是", "后几字符是", "包含", "不包含", "前几字符不包含", "后几字符不包含", "是", "不是", "为空", "不为空" });
             this.cobOper.Text = "包含";
         }
         else if (attribute.DataType == 7)
         {
             this.cobOper.Properties.Items.AddRange(new object[] { "=", ">", "<", ">=", "<=", "为空", "不为空" });
             this.cobOper.Text = "=";
         }
         else
         {
             this.cobOper.Properties.Items.AddRange(new object[] { "前几字符是", "后几字符是", "包含", "不包含", "前几字符不包含", "后几字符不包含", "是", "不是", "为空", "不为空", "=", ">", "<", ">=", "<=", "<>" });
             this.cobOper.Text = "包含";
         }
     }
 }
Example #2
0
 private string ReplaceAttrName(string condStr)
 {
     if ((condStr != null) && (condStr.Trim() != ""))
     {
         for (int i = 0; i < this.filterAttrs.Count; i++)
         {
             string          str       = "PLM_";
             DEMetaAttribute attribute = (DEMetaAttribute)this.filterAttrs[i];
             str = str + attribute.Name;
             if (condStr.IndexOf(str) == 0)
             {
                 if (typeof(ArrayList).IsInstanceOfType(this.cobParamName.Tag))
                 {
                     ArrayList tag = (ArrayList)this.cobParamName.Tag;
                     foreach (DEOuterAttribute attribute2 in tag)
                     {
                         if (attribute2.FieldOid == attribute.Oid)
                         {
                             condStr = condStr.Replace(str, attribute2.OuterAttrName);
                             return(condStr);
                         }
                     }
                 }
                 return(condStr);
             }
         }
     }
     return(condStr);
 }
Example #3
0
        private void cmBox_fname_SelectedIndexChanged(object sender, EventArgs e)
        {
            int selectedIndex = 0;

            selectedIndex = this.cmBox_fname.SelectedIndex;
            int num2 = 0;

            if (this.Attrs != null)
            {
                foreach (DEMetaAttribute attribute in this.Attrs)
                {
                    if ((attribute.DataType != 8) && (attribute.Label != this.comColumn))
                    {
                        if (num2 == selectedIndex)
                        {
                            this.SetOperValue(attribute);
                            this.curFieldAttr     = attribute;
                            this.cmBox_fname.Text = attribute.Label;
                            break;
                        }
                        num2++;
                    }
                }
            }
        }
Example #4
0
        private void FilterControl(Guid g_mid, DEBoxObject o_box, int i_pos)
        {
            string filterPos = "";

            if (o_box.FilterType == 1)
            {
                filterPos = o_box.FilterPos;
                if (filterPos.Trim().Length > 0)
                {
                    ArrayList posValue = new ArrayList();
                    posValue = this.GetPosValue(filterPos);
                    for (int i = 0; i < posValue.Count; i++)
                    {
                        int         num2 = (int)posValue[i];
                        DEBoxObject obj2 = (DEBoxObject)this.al_all[num2];
                        if (obj2.ShowType == "UCGrid")
                        {
                            DEMetaAttribute metaObject         = (DEMetaAttribute)o_box.MetaObject;
                            DEMetaClass     class2             = ModelContext.MetaModel.GetClass(metaObject.LinkedResClass);
                            UCResGrid       grid               = (UCResGrid)this.al_control[num2];
                            string          filterRefTableName = this.GetFilterRefTableName(o_box, num2);
                            grid.ReLoad(g_mid, class2.Name, filterRefTableName, false);
                        }
                    }
                }
            }
        }
Example #5
0
 private void comBoxAttrName_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(this.comBoxAttrName.Text))
     {
         string text = this.comBoxAttrName.Text;
         this.pnlValue.Controls.Clear();
         ComboBoxEditPLM tplm     = new ComboBoxEditPLM();
         DEMetaAttribute metaAttr = this.GetMetaAttr(text);
         if (metaAttr != null)
         {
             DEMetaClass myCls = ModelContext.MetaModel.GetClass(metaAttr.LinkedResClass);
             if (myCls != null)
             {
                 ResFunc func = new ResFunc();
                 foreach (DEMetaAttribute attribute2 in func.GetResAttrs(myCls))
                 {
                     if ((!attribute2.IsSystem && (attribute2.DataType2 == PLMDataType.String)) && (attribute2.Name != "OID"))
                     {
                         tplm.Properties.Items.Add(attribute2.Label);
                     }
                 }
                 if (tplm.Properties.Items.Count > 0)
                 {
                     this.pnlValue.Controls.Add(tplm);
                     tplm.Dock = DockStyle.Fill;
                 }
             }
         }
     }
 }
Example #6
0
        private void ActiveDropDownUC(UltraTextEditor txtEditor, string str_clsname, bool b_isTree, int i_pos)
        {
            DEMetaAttribute metaAttr = new DEMetaAttribute();
            DEBoxObject     obj2     = (DEBoxObject)this.al_all[i_pos];

            metaAttr = (DEMetaAttribute)obj2.MetaObject;
            if (b_isTree)
            {
                ArrayList list  = new ArrayList();
                Guid      empty = Guid.Empty;
                list.Add(empty);
                string refTableName = this.GetRefTableName(obj2, i_pos);
                list.Add(refTableName);
                DEMetaClass class2 = ModelContext.MetaModel.GetClass(metaAttr.LinkedResClass);
                list.Add(class2.Name);
                UCResTree tree = new UCResTree(list, i_pos);
                this.al_control.Add(tree);
                DropDownEditorButton button = txtEditor.ButtonsRight["SelectRes"] as DropDownEditorButton;
                button.Control    = tree;
                this.handler      = new SelectResHandler(this.ucUser_ResSelected);
                tree.ResSelected += this.handler;
            }
            else
            {
                this.ucUser = new UCResGrid(str_clsname, metaAttr, i_pos);
                this.al_control.Add(this.ucUser);
                DropDownEditorButton button2 = txtEditor.ButtonsRight["SelectRes"] as DropDownEditorButton;
                button2.Control          = this.ucUser;
                this.handler             = new SelectResHandler(this.ucUser_ResSelected);
                this.ucUser.ResSelected += this.handler;
            }
        }
Example #7
0
 private void InitControl(DEBoxObject o_box, int i_len, int i_jg, bool b_isdrwaline)
 {
     this.utEditor[i_jg]             = new UltraTextEditor();
     this.utEditor[i_jg].BorderStyle = UIElementBorderStyle.None;
     this.utEditor[i_jg].Location    = new Point(i_len + (4 * i_jg), 0);
     this.utEditor[i_jg].Text        = o_box.CONVALUE.ToString();
     this.utEditor[i_jg].Size        = new Size(o_box.Width, 0x15);
     this.utEditor[i_jg].Appearance.FontData.SizeInPoints = o_box.Height - 4;
     this.utEditor[i_jg].SupportThemes = false;
     new ArrayList();
     if (o_box.ControlType.Equals("UltraTextBox"))
     {
         DEMetaAttribute metaObject = (DEMetaAttribute)o_box.MetaObject;
         DEMetaClass     class2     = ModelContext.MetaModel.GetClass(metaObject.LinkedResClass);
         this.DrawDropDownTBtn(this.utEditor[i_jg], class2.Name, i_jg);
     }
     else
     {
         this.al_control.Add(this.utEditor[i_jg]);
     }
     base.Controls.Add(this.utEditor[i_jg]);
     if (b_isdrwaline)
     {
         this.DrawLine(((i_len + o_box.Width) + (4 * i_jg)) + 1, 0, 2, base.Height);
     }
 }
Example #8
0
 private void OnSetDataHiddenCol(object sender, EventArgs e)
 {
     try {
         DEMetaAttribute attribute = ModelContext.MetaModel.GetAttribute("PPCRDTEMPLATE", "DATAHIDDENCOL");
         if (attribute == null)
         {
             MessageBox.Show("请先为“卡片模板”类定制“数据隐藏列(DATAHIDDENCOL)”属性。长度应不小于50。", "PPM", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             ArrayList midColNameList = this.pageMainPage.GetMidColNameList();
             ArrayList nextColList    = null;
             if (this.pageNextPage != null)
             {
                 nextColList = this.pageNextPage.GetMidColNameList();
             }
             DlgDataHiddenCol col = new DlgDataHiddenCol(this.m_tp.DataHiddenCol, this.m_tp.HasNextPage, this.m_tp.ReadOnly, midColNameList, nextColList);
             if (col.ShowDialog() == DialogResult.OK)
             {
                 if (col.dataHiddenCol.Length > attribute.Size)
                 {
                     MessageBox.Show(string.Concat(new object[] { "设置数据隐藏列形成的脚本长度 ", col.dataHiddenCol.Length.ToString(), " 超过了“卡片模板”类属性“DATAHIDDENCOL”的长度 ", attribute.Size, " 。\n请修改该属性的长度,否则模板将不会保存该规则。" }), "PPM", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 }
                 else
                 {
                     this.m_tp.DataHiddenCol = col.dataHiddenCol;
                     this.m_tp.IsSaved       = false;
                 }
             }
         }
     } catch (Exception exception) {
         MessageBox.Show("数据隐藏列设置出错,请重试。具体原因为:\n" + exception.Message, "PPM", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Example #9
0
 private void OnAutoNumber(object sender, EventArgs e)
 {
     try {
         DEMetaAttribute attribute = ModelContext.MetaModel.GetAttribute("PPCRDTEMPLATE", "AUTONUMBER");
         if (attribute == null)
         {
             MessageBox.Show("请先为“卡片模板”类定制“自动编号规则(AUTONUMBER)”属性,长度应不小于100。", "PPM", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             DlgAutoNumber number = new DlgAutoNumber(this.m_tp, true);
             if (number.ShowDialog() == DialogResult.OK)
             {
                 string str = PPCardCompiler.CreateXML(number.NumberFormat);
                 if (str.Length > attribute.Size)
                 {
                     MessageBox.Show(string.Concat(new object[] { "设置自动编号规则形成的脚本长度 ", str.Length.ToString(), " 超过了“卡片模板”类属性“AUTONUMBER”的长度 ", attribute.Size, " 。\n请修改该属性的长度,否则模板将不会保存该规则。" }), "PPM", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 }
                 else
                 {
                     this.m_tp.AutoNumber = str;
                     this.m_tp.IsSaved    = false;
                 }
             }
         }
     } catch (Exception exception) {
         MessageBox.Show("自动编号规则设置出错,请重试。具体原因为:\n" + exception.Message, "PPM", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Example #10
0
 public bool UpdateData(bool updateIteration)
 {
     try {
         foreach (Control control in this.pnlProperty.Controls)
         {
             if (typeof(TextBox).IsInstanceOfType(control) && !((TextBox)control).ReadOnly)
             {
                 DEMetaAttribute tag       = (DEMetaAttribute)control.Tag;
                 object          attrValue = PSConvert.String2Attribute(((TextBox)control).Text, tag);
                 if (!tag.NullAllowed && ((attrValue == null) || attrValue.Equals("")))
                 {
                     MessageBox.Show(tag.Label + "不能为空。", "输入提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                     control.Focus();
                     return(false);
                 }
                 this.Item.Iteration.SetAttrValue(tag.Name, attrValue);
             }
         }
         if (updateIteration)
         {
             this.Item.Iteration = PLItem.UpdateItemIteration(this.Item.Iteration, this.uOid, false);
         }
         return(true);
     } catch (Exception exception) {
         MessageBox.Show("输入信息格式错误,请检查信息合法性!" + exception.Message);
         return(false);
     }
 }
Example #11
0
        private void FilterData()
        {
            int           num3     = 0;
            StringBuilder builder  = new StringBuilder();
            StringBuilder builder2 = new StringBuilder();

            if (this.myView != null)
            {
                for (int i = 0; i < this.txtBoxList.Count; i++)
                {
                    TextEditPLM txtBox = (TextEditPLM)this.txtBoxList[i];
                    if (txtBox.Text != "")
                    {
                        ComboBoxEditPLM cob = (ComboBoxEditPLM)this.cobList[i];
                        if ((cob.Text == "在..之间") || (cob.Text == "不在..之间"))
                        {
                            DEMetaAttribute tag = (DEMetaAttribute)txtBox.Tag;
                            for (int j = 0; j < this.txtList.Count; j++)
                            {
                                TextEditPLM     tplm2      = (TextEditPLM)this.txtList[j];
                                DEMetaAttribute attribute2 = (DEMetaAttribute)tplm2.Tag;
                                if ((tag.Oid == attribute2.Oid) && (tplm2.Text != ""))
                                {
                                    num3++;
                                    if (num3 > 1)
                                    {
                                        builder.Append(" AND ");
                                    }
                                    builder2 = this.CreateCondition(cob, txtBox);
                                    builder.Append(builder2.ToString());
                                }
                            }
                        }
                        else
                        {
                            num3++;
                            if (num3 > 1)
                            {
                                builder.Append(" AND ");
                            }
                            builder.Append(this.CreateCondition(cob, txtBox).ToString());
                        }
                    }
                }
                try
                {
                    this.myView.RowFilter = builder.ToString();
                    this.DisplayData(this.myView);
                }
                catch (PLMException exception)
                {
                    PrintException.Print(exception);
                }
                catch
                {
                    MessageBoxPLM.Show("过滤数据发生错误:请检查输入的数据类型是否正确", "筛选数据集", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }
            }
        }
Example #12
0
 private void cobName_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.cobName.SelectedIndex > -1)
     {
         DEMetaAttribute myAttr = (DEMetaAttribute)this.attrList[this.cobName.SelectedIndex];
         this.LoadOperData(myAttr);
     }
 }
Example #13
0
        private void SetConAttrShowPos()
        {
            ArrayList list = new ArrayList();

            list = this.LoadConAttrLst();
            if (list.Count != 0)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    ArrayList list2       = (ArrayList)list[i];
                    string    combination = "";
                    string    str2        = "";
                    foreach (Guid guid in list2)
                    {
                        for (int j = 0; j < this.al_all.Count; j++)
                        {
                            DEBoxObject obj2 = (DEBoxObject)this.al_all[j];
                            if (obj2.ControlType != "TextEditPLM")
                            {
                                DEMetaAttribute metaObject = (DEMetaAttribute)obj2.MetaObject;
                                if (metaObject.Oid == guid)
                                {
                                    if (str2.Length == 0)
                                    {
                                        str2        = j.ToString();
                                        combination = metaObject.Combination;
                                    }
                                    else
                                    {
                                        str2        = str2 + "," + j.ToString();
                                        combination = combination + metaObject.Combination;
                                    }
                                }
                            }
                        }
                    }
                    foreach (Guid guid2 in list2)
                    {
                        foreach (DEBoxObject obj3 in this.al_all)
                        {
                            if (obj3.ControlType != "TextEditPLM")
                            {
                                DEMetaAttribute attribute2 = (DEMetaAttribute)obj3.MetaObject;
                                if (attribute2.Oid == guid2)
                                {
                                    attribute2.Combination = combination;
                                    obj3.MetaObject        = attribute2;
                                    obj3.ConAttrShowPos    = str2;
                                    obj3.IsConAttrType     = true;
                                }
                            }
                        }
                    }
                }
            }
        }
Example #14
0
        private void Initialize()
        {
            string str4 = "PLM_CUS_" + this.clsName;

            UCCusResource.GetData(out Stamp, out this.myds, this.clsName, this.attrs);
            if (this.myds != null)
            {
                this.metaAttr = (DEMetaAttribute)base.Tag;
                if (((this.metaAttr != null) && (this.metaAttr.LinkType == 1)) && (this.metaAttr.Combination != ""))
                {
                    DataColumn column = new DataColumn("PLM_Res_ComColumn")
                    {
                        DataType = typeof(string)
                    };
                    this.myds.Tables[str4].Columns.Add(column);
                    foreach (DataRow row in this.myds.Tables[str4].Rows)
                    {
                        string combination = this.metaAttr.Combination;
                        string str3        = combination;
                        foreach (DEMetaAttribute attribute in this.attrs)
                        {
                            if (this.metaAttr.Combination.IndexOf("[" + attribute.Name + "]") > -1)
                            {
                                string str2 = "PLM_" + attribute.Name;
                                combination = combination.Replace("[" + attribute.Name + "]", Convert.ToString(row[str2]));
                                str3        = str3.Replace("[" + attribute.Name + "]", "");
                            }
                        }
                        if (combination == str3)
                        {
                            combination = "";
                        }
                        row["PLM_Res_ComColumn"] = combination;
                    }
                }
                else if ((this.metaAttr.LinkType == 0) && (this.metaAttr.DataType == 8))
                {
                    DataColumn column2 = new DataColumn("PLM_Res_ComColumn")
                    {
                        DataType = typeof(string)
                    };
                    this.myds.Tables[str4].Columns.Add(column2);
                    foreach (DataRow row2 in this.myds.Tables[str4].Rows)
                    {
                        row2["PLM_Res_ComColumn"] = row2["PLM_ID"].ToString();
                    }
                    this.resOid = this.GetResourceOID(this.txtInput.Text, this.clsName);
                }
                this.myView = this.myds.Tables[str4].DefaultView;
                if (this.txtInput != null)
                {
                    this.flag      = 0;
                    this.attrValue = this.txtInput.Text.Trim();
                }
            }
        }
Example #15
0
        public object GetAttrValue(string itemClassName, string itemAttribute)
        {
            this.LoadData();
            DEMetaAttribute attribute = ModelContext.MetaModel.GetAttribute(itemClassName, itemAttribute);

            if (((attribute != null) && (attribute.LinkedResClass != Guid.Empty)) && (ModelContext.MetaModel.GetClass(attribute.LinkedResClass).Name == this.className))
            {
                return(this.GetAttrValue(attribute.Combination));
            }
            return(null);
        }
Example #16
0
        public UCRes(string clsName, DEMetaAttribute metaAttr) : this()
        {
            this.className   = clsName;
            this.deMetaAttri = metaAttr;
            DEMetaClass class2 = ModelContext.MetaModel.GetClass(this.className);

            if (class2 != null)
            {
                this.classOid = class2.Oid;
                this.InitializeData();
            }
        }
Example #17
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (this.lB_Attr.SelectedItems.Count != 0)
     {
         DEResModelPrimaryKey key      = new DEResModelPrimaryKey();
         DEMetaAttribute      metaAttr = new DEMetaAttribute();
         metaAttr = this.GetMetaAttr(this.lB_Attr.SelectedItem.ToString());
         if (((metaAttr.DataType2 == PLMDataType.Guid) || (metaAttr.DataType2 == PLMDataType.Grid)) || (((metaAttr.DataType2 == PLMDataType.Card) || (metaAttr.DataType2 == PLMDataType.Blob)) || (metaAttr.DataType2 == PLMDataType.Clob)))
         {
             MessageBoxPLM.Show("此类型的属性不能设为分类主键!", "模型定义", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else if (this.tV_define.SelectedNode != null)
         {
             if (this.IsExistSameNodeName(this.tV_define.SelectedNode, this.lB_Attr.SelectedItem.ToString()))
             {
                 MessageBoxPLM.Show("同级目录下有相同的主键名!", "模型定义", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
             else
             {
                 TreeNode             node = new TreeNode();
                 DEResModelPrimaryKey tag  = new DEResModelPrimaryKey();
                 tag               = (DEResModelPrimaryKey)this.tV_define.SelectedNode.Tag;
                 node.Text         = this.lB_Attr.SelectedItem.ToString();
                 key.PLM_OID       = Guid.NewGuid();
                 key.PLM_FATHEROID = tag.PLM_OID;
                 key.PLM_MODELOID  = this.myModel.PLM_OID;
                 key.PLM_ATTROID   = metaAttr.Oid;
                 key.PLM_SHOWNAME  = this.lB_Attr.SelectedItem.ToString();
                 key.PLM_OPTION    = 0;
                 node.Tag          = key;
                 this.tV_define.SelectedNode.Nodes.Add(node);
             }
         }
         else if (this.IsExistSameNodeName(null, this.lB_Attr.SelectedItem.ToString()))
         {
             MessageBoxPLM.Show("同级目录下有相同的主键名!", "模型定义", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             TreeNode node2 = new TreeNode {
                 Text = this.lB_Attr.SelectedItem.ToString()
             };
             key.PLM_OID       = Guid.NewGuid();
             key.PLM_FATHEROID = Guid.Empty;
             key.PLM_MODELOID  = this.myModel.PLM_OID;
             key.PLM_ATTROID   = metaAttr.Oid;
             key.PLM_SHOWNAME  = this.lB_Attr.SelectedItem.ToString();
             key.PLM_OPTION    = 0;
             node2.Tag         = key;
             this.tV_define.Nodes.Add(node2);
         }
     }
 }
Example #18
0
 private void AddFilter(ArrayList attrList)
 {
     for (int i = 0; i < attrList.Count; i++)
     {
         DEMetaAttribute attribute = (DEMetaAttribute)attrList[i];
         if (attribute.Name == "PLM_ID")
         {
             this.txtValue.Tag = attribute;
             return;
         }
     }
 }
Example #19
0
        public UCResSelect(Guid classOid, DEMetaAttribute metaAttr, int i_pos) : this()
        {
            this.classOid    = classOid;
            this.deMetaAttri = metaAttr;
            this.i_pos       = i_pos;
            DEMetaClass class2 = ModelContext.MetaModel.GetClass(this.classOid);

            if (class2 != null)
            {
                this.className = class2.Name;
                this.InitializeData();
            }
        }
Example #20
0
        public UCselRes(Guid classOid, DEMetaAttribute metaAttr)
        {
            this.Attrs       = new ArrayList();
            this.resOid      = Guid.Empty;
            this.classOid    = classOid;
            this.deMetaAttri = metaAttr;
            this.InitializeComponent();
            this.ucUser = new UCRes(classOid, metaAttr);
            DropDownEditorButton button = base.ButtonsRight["SelectRes"] as DropDownEditorButton;

            button.Control           = this.ucUser;
            this.handler             = new Thyt.TiPLM.UIL.Resource.Common.UserControl.SelectResHandler(this.ucUser_ResSelected);
            this.ucUser.ResSelected += this.handler;
        }
Example #21
0
 public UCResGrid(string clsName, DEMetaAttribute metaAttr, int i_pos)
     : this()
 {
     this.className = clsName;
     this.deMetaAttri = metaAttr;
     this.i_pos = i_pos;
     DEMetaClass class2 = ModelContext.MetaModel.GetClass(this.className);
     if (class2 != null)
     {
         this.classOid = class2.Oid;
         this.InitObject();
         this.InitializeData();
     }
 }
Example #22
0
        private void SetSelAttr(string str_label, bool b_isAsc)
        {
            DEMetaAttribute metaAttr = this.GetMetaAttr(str_label);
            DEDefSort       deSort   = new DEDefSort {
                OID      = Guid.NewGuid(),
                ATTROID  = metaAttr.Oid,
                CLSOID   = this.g_SaveOid,
                ISASC    = b_isAsc ? true : false,
                POSITION = 0x7fffffff
            };

            this.AddLVObj(str_label, b_isAsc, deSort);
            this.al_NewAttr.Add(deSort);
        }
Example #23
0
 public void Output(DEResFolder curResFolder)
 {
     if (curResFolder != null)
     {
         this.curFolder = curResFolder;
         this.InitResInfo();
         this.TotalNum = this.GetResDataCount();
         if (this.TotalNum == 0)
         {
             MessageBoxPLM.Show("资源的记录数为零,不能导出", "资源数据导出", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         }
         else
         {
             this.TotalPage = ((this.TotalNum % this.showNum) == 0) ? (this.TotalNum / this.showNum) : ((this.TotalNum / this.showNum) + 1);
             this.attrShow  = new PLReference().GetDefAttrLst(this.curFolder.Oid, emTreeType.NodeTree);
             foreach (DEDefAttr attr in this.attrShow)
             {
                 if (!attr.ISVISUAL)
                 {
                     for (int i = this.attrList.Count - 1; i >= 0; i--)
                     {
                         DEMetaAttribute attribute = this.attrList[i] as DEMetaAttribute;
                         if (attribute.Oid == attr.ATTROID)
                         {
                             this.attrList.RemoveAt(i);
                         }
                     }
                 }
             }
             FrmOutputOption option = new FrmOutputOption(this.TotalPage, this.attrList);
             if (option.ShowDialog() == DialogResult.OK)
             {
                 SaveFileDialog dialog;
                 this.StartNum       = option.StartPage;
                 this.EndNum         = option.EndPage;
                 this.IsMultiPageOut = option.IsMultiPage;
                 if (this.saveFile(out dialog))
                 {
                     IProgressCallback progressWindow = ClientData.GetProgressWindow();
                     ArrayList         state          = new ArrayList {
                         progressWindow,
                         dialog.FileName
                     };
                     ThreadPool.QueueUserWorkItem(new WaitCallback(this.outPageExcel), state);
                     progressWindow.ShowWindow();
                 }
             }
         }
     }
 }
Example #24
0
        private void ActiveDropDownUC(UltraTextEditor txtEditor)
        {
            DEMetaAttribute metaAttr = new DEMetaAttribute {
                LinkType    = 1,
                Combination = this.str_field
            };

            this.ucUser = new UCRes(this.clsName, metaAttr);
            DropDownEditorButton button = txtEditor.ButtonsRight["SelectRes"] as DropDownEditorButton;

            button.Control           = this.ucUser;
            this.handler             = new SelectResHandler(this.ucUser_ResSelected);
            this.ucUser.ResSelected += this.handler;
        }
Example #25
0
 private void txtInput_DragDrop(object sender, DragEventArgs e)
 {
     if (!this.txtInput.ReadOnly)
     {
         this.metaAttr = (DEMetaAttribute)base.Tag;
         CLCopyData data = new CLCopyData();
         data = (CLCopyData)e.Data.GetData(typeof(CLCopyData));
         if (data != null)
         {
             DECopyData data2 = (DECopyData)data[0];
             if (data2 != null)
             {
                 if (data2.ClassName != this.clsName)
                 {
                     MessageBoxPLM.Show("资源类不匹配", "工程资源", MessageBoxButtons.OK);
                     this.txtInput.Focus();
                 }
                 else
                 {
                     DataRowView view = (DataRowView)data2.ItemList[0];
                     if (view != null)
                     {
                         if ((this.metaAttr != null) && (this.metaAttr.LinkType == 1))
                         {
                             this.flag = 1;
                             string combination = this.metaAttr.Combination;
                             foreach (DEMetaAttribute attribute in this.attrs)
                             {
                                 if (this.metaAttr.Combination.IndexOf("[" + attribute.Name + "]") > -1)
                                 {
                                     string str2 = "PLM_" + attribute.Name;
                                     combination = combination.Replace("[" + attribute.Name + "]", Convert.ToString(view[str2]));
                                 }
                             }
                             this.txtInput.Text = combination.Trim();
                         }
                         else
                         {
                             this.flag          = 1;
                             this.txtInput.Text = view["PLM_ID"].ToString();
                         }
                         this.resOid = new Guid((byte[])view["PLM_OID"]);
                         this.txtInput.Focus();
                     }
                 }
             }
         }
     }
 }
Example #26
0
        private void AddOperLst(DEMetaAttribute attr)
        {
            int       num  = 0;
            ArrayList list = new ArrayList();

            foreach (PLMOperator @operator in SelectionOperator.GetOperator(attr.DataType2))
            {
                if (num == 0)
                {
                    this.cmBox_oper.Text = @operator.OperName;
                }
                this.cmBox_oper.Properties.Items.Add(@operator.OperName);
                num++;
            }
        }
Example #27
0
        private void SetGridValue(string str_res, int i_pos)
        {
            Guid      empty          = Guid.Empty;
            ArrayList list           = new ArrayList();
            string    conAttrShowPos = "";

            char[]   separator = "}".ToCharArray();
            string[] strArray  = null;
            if ((base.Tag == null) && (str_res != null))
            {
                strArray = str_res.Split(separator);
            }
            DEBoxObject obj2 = (DEBoxObject)this.al_all[i_pos];

            conAttrShowPos = obj2.ConAttrShowPos;
            if (conAttrShowPos.Trim().Length > 0)
            {
                ArrayList posValue = new ArrayList();
                posValue = this.GetPosValue(conAttrShowPos);
                for (int i = 0; i < posValue.Count; i++)
                {
                    list.Add(strArray[i].ToString().Substring(1, strArray[i].ToString().Length - 1));
                }
                for (int j = 0; j < posValue.Count; j++)
                {
                    int index = (int)posValue[j];
                    this.utEditor[index].Text = list[j].ToString();
                }
                if (obj2.IsReflex || (obj2.FilterType != 0))
                {
                    string          g          = strArray[posValue.Count].ToString().Substring(1, strArray[posValue.Count].ToString().Length - 1);
                    Guid            iterOid    = new Guid(g);
                    DEMetaAttribute metaObject = (DEMetaAttribute)obj2.MetaObject;
                    DEMetaClass     class2     = ModelContext.MetaModel.GetClass(metaObject.LinkedResClass);
                    Guid            curView    = ClientData.UserGlobalOption.CurView;
                    DEBusinessItem  item       = (DEBusinessItem)PLItem.Agent.GetBizItemByIteration(iterOid, class2.Name, curView, ClientData.LogonUser.Oid, BizItemMode.BizItem);
                    empty = item.MasterOid;
                    if (obj2.FilterType == 1)
                    {
                        this.FilterControl(empty, obj2, i_pos);
                    }
                    if (obj2.IsReflex)
                    {
                        this.ReflexControl(empty, obj2, i_pos);
                    }
                }
            }
        }
Example #28
0
 private void FilterAttributes(ArrayList attris, string className)
 {
     for (int i = 0; i < attris.Count; i++)
     {
         GenericAttribute attribute = (GenericAttribute)attris[i];
         if ((attribute.Category == "I") || (attribute.Category == "S"))
         {
             DEMetaAttribute attach = attribute.Attach as DEMetaAttribute;
             if (!attach.IsViewable)
             {
                 attris.Remove(attribute);
                 i--;
             }
         }
     }
 }
Example #29
0
        public ResCombo(string clsName, DEMetaAttribute metaAttr)
        {
            this.Attrs         = new ArrayList();
            this.comColumn     = "选_中";
            this.resOid        = Guid.Empty;
            this.al_guid       = new ArrayList();
            this.al_ShowColumn = new ArrayList();
            this.InitializeConfig();
            this.className   = clsName;
            this.deMetaAttri = metaAttr;
            DEMetaClass class2 = ModelContext.MetaModel.GetClass(this.className);

            if (class2 != null)
            {
                this.classOid = class2.Oid;
            }
        }
Example #30
0
 private void CreateLvwStyle(ListView lvw, ArrayList attrList)
 {
     lvw.Clear();
     for (int i = 0; i < attrList.Count; i++)
     {
         DEMetaAttribute attribute = (DEMetaAttribute)attrList[i];
         if (attribute.IsViewable)
         {
             ColumnHeader header = new ColumnHeader {
                 Text      = attribute.Label,
                 TextAlign = HorizontalAlignment.Center,
                 Width     = 100
             };
             lvw.Columns.Add(header);
         }
     }
 }