Exemplo n.º 1
0
        public bool LoadWorkFlowProj(XmlElement source)
        {
            XmlElement projNode = source;

            if (projNode.Name != "work_wlow_project")
            {
                return(false);
            }

            Name      = projNode.GetAttribute("name");
            DB_Config = projNode.GetAttribute("db");
            XmlNodeList wfs = projNode.SelectNodes("work_flow");

            foreach (XmlNode xn in wfs)
            {
                XmlElement  xe  = (XmlElement)xn;
                WorkFlowMan wfm = NewWrokFlowMan(xe.GetAttribute("name"), xe.GetAttribute("desc"), false);
                if (!wfm.LoadWorkFlow(xe))
                {
                    return(false);
                }
            }

            XmlNodeList records = projNode.SelectSingleNode("record_items").SelectNodes("item");

            if (Record_Items == null)
            {
                Record_Items = new ObservableCollection <RecordItem>();
            }
            foreach (XmlNode ri in records)
            {
                Record_Items.Add(new RecordItem()
                {
                    Name = ((XmlElement)ri).GetAttribute("name"),
                    Desc = ((XmlElement)ri).GetAttribute("desc")
                });
            }

            DB_Config = projNode.SelectSingleNode("database").Attributes["connection"].Value;

            XmlElement app_res = (XmlElement)projNode.SelectSingleNode("param_app");

            Param_AppRes.Clear();
            if (app_res != null)
            {
                foreach (XmlNode res in app_res.SelectNodes("item"))
                {
                    Param_AppRes.Add(res.InnerText);
                }
            }
            return(true);
        }
Exemplo n.º 2
0
        private void Add_NewRecordButton_Click(object sender, RoutedEventArgs e)
        {
            if (Item_Name.Text == "")
            {
                return;
            }

            foreach (RecordItem ri in Record_Items)
            {
                if (ri.Name == Item_Name.Text.Trim())
                {
                    return;
                }
            }

            Record_Items.Add(new RecordItem()
            {
                Name = Item_Name.Text.Trim(), Desc = Item_Desc.Text.Trim()
            });
        }