Ejemplo n.º 1
0
        public Form(int _FormId)
        {
            FormId = _FormId;

            FormInfo form = FormDataAccess.GetForm(_FormId);

            FormName = form.FormName;
            FlowXml  = form.FlowXml;

            //Load Active
            List <ActiveInfo> listActive = ActiveDataAccess.GetAll(_FormId);


            foreach (ActiveInfo active in listActive)
            {
                m_listActive.Add(new Active(active.ActiveId));
            }

            //Load Condition
            List <ConditionInfo> listCondition = ConditionDataAccess.GetAll(_FormId);

            foreach (ConditionInfo condition in listCondition)
            {
                Condition obj = new Condition(condition.ConditionId);

                obj.FromActive = m_listActive.Find(delegate(Active active) { return(active.ActiveId == condition.FromActiveId); });
                obj.ToActive   = m_listActive.Find(delegate(Active active) { return(active.ActiveId == condition.ToActiveId); });

                m_listCondition.Add(obj);
            }

            //Load Condition Sub
            //List<ConditionInfoSub> listConditionSub = SqlHelper.QueryTable<ConditionInfoSub>(BizConfig.ConnectionString, cfl);

            //foreach (ConditionInfoSub conditionSub in listConditionSub)
            //{
            //    m_listConditionSub.Add(new ConditionSub(conditionSub.ConditionSubId));
            //}
        }
Ejemplo n.º 2
0
        public Condition(string _ConditionId)
        {
            ConditionId = _ConditionId;

            ConditionInfo condition = ConditionDataAccess.GetCondition(_ConditionId);

            ConditionName = condition.ConditionName;

            ConditionJoin = condition.ConditionJoin;

            //m_FromActive = new Active(condition.FromActiveId);

            //m_ToActive = new Active(condition.ToActiveId);


            //Load Condition Sub
            List <ConditionSubInfo> listConditionSub = ConditionSubDataAccess.GetConditionSubList(_ConditionId);

            foreach (ConditionSubInfo conditionSub in listConditionSub)
            {
                m_listConditionSub.Add(new ConditionSub(conditionSub.ConditionSubId));
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 更新流程xml
        /// </summary>
        /// <param name="workFlowXml">流程xml描述</param>
        public static bool UpdateWorkFlowXML(string workFlowXml)
        {
            Byte[]      b         = System.Text.UTF8Encoding.UTF8.GetBytes(workFlowXml);
            XmlDocument objXmlDoc = new XmlDocument();

            objXmlDoc.Load(System.Xml.XmlReader.Create(new MemoryStream(b)));

            #region form
            XmlNode  node   = objXmlDoc.SelectSingleNode("WebFlow/FlowConfig/BaseProperties");
            int      flowId = Convert.ToInt32(node.Attributes["flowId"].Value);
            FormInfo form   = FormBiz.GetForm(flowId);
            form.FormName = node.Attributes["flowText"].Value;
            form.FlowXml  = workFlowXml;
            #endregion

            #region active
            List <ActiveInfo> listActive = new List <ActiveInfo>();

            XmlNodeList nodeStepList = objXmlDoc.SelectNodes("WebFlow/Steps/Step");

            foreach (XmlNode nodeStep in nodeStepList)
            {
                XmlNode nodeBase = nodeStep.SelectSingleNode("BaseProperties");

                ActiveInfo active = ActiveDataAccess.GetActive(nodeBase.Attributes["id"].Value);

                if (active == null)
                {
                    active = new ActiveInfo();
                }

                active.ActiveId   = nodeBase.Attributes["id"].Value;
                active.ActiveName = nodeBase.Attributes["text"].Value;
                active.ActiveType = nodeBase.Attributes["stepType"].Value;
                active.FormId     = form.FormId;
                listActive.Add(active);
            }
            #endregion

            #region condition
            List <ConditionInfo> listCondition  = new List <ConditionInfo>();
            XmlNodeList          nodeActionList = objXmlDoc.SelectNodes("WebFlow/Actions/Action");

            foreach (XmlNode nodeAction in nodeActionList)
            {
                XmlNode nodeBase = nodeAction.SelectSingleNode("BaseProperties");

                ConditionInfo condition = ConditionDataAccess.GetCondition(nodeBase.Attributes["id"].Value);

                if (condition == null)
                {
                    condition = new ConditionInfo();
                }

                condition.FromActiveId  = nodeBase.Attributes["from"].Value;
                condition.ToActiveId    = nodeBase.Attributes["to"].Value;
                condition.ConditionId   = nodeBase.Attributes["id"].Value;
                condition.ConditionName = nodeBase.Attributes["text"].Value;
                condition.FormId        = form.FormId;
                listCondition.Add(condition);
            }

            #endregion

            return(FlowDataAccess.UpdateFlow(form, listActive, listCondition));
        }
Ejemplo n.º 4
0
 public static void UpdateCondition(ConditionInfo condition)
 {
     ConditionDataAccess.Update(condition);
 }
Ejemplo n.º 5
0
 public static ConditionInfo GetCondition(string ConditionId)
 {
     return(ConditionDataAccess.GetCondition(ConditionId));
 }