コード例 #1
0
 /// <summary>
 /// 更新满减活动
 /// </summary>
 /// <param name="data"></param>
 /// <param name="rules"></param>
 /// <param name="products"></param>
 public void UpdateActive(ActiveInfo data, IEnumerable <FullDiscountRuleInfo> rules, IEnumerable <ActiveProductInfo> products)
 {
     DbFactory.Default.InTransaction(() =>
     {
         var obj          = DbFactory.Default.Get <ActiveInfo>().Where(d => d.Id == data.Id).FirstOrDefault();
         obj.ShopId       = data.ShopId;
         obj.ActiveName   = data.ActiveName;
         obj.StartTime    = data.StartTime;
         obj.EndTime      = data.EndTime;
         obj.IsAllProduct = data.IsAllProduct;
         DbFactory.Default.Del <FullDiscountRuleInfo>().Where(d => d.ActiveId == data.Id).Succeed();
         foreach (var item in rules)
         {
             item.ActiveId = data.Id;
         }
         DbFactory.Default.Add(rules);
         DbFactory.Default.Del <ActiveProductInfo>().Where(d => d.ActiveId == data.Id).Succeed();
         foreach (var item in products)
         {
             item.ActiveId = data.Id;
         }
         DbFactory.Default.Add(products);
         DbFactory.Default.Update(obj);
     });
 }
コード例 #2
0
        public ActiveInfo InitActiveInfo(SqlDataReader reader)
        {
            ActiveInfo activeInfo = new ActiveInfo();

            activeInfo.ActiveID     = (int)reader["ActiveID"];
            activeInfo.Description  = reader["Description"] == null ? "" : reader["Description"].ToString();
            activeInfo.Content      = reader["Content"] == null ? "" : reader["Content"].ToString();
            activeInfo.AwardContent = reader["AwardContent"] == null ? "" : reader["AwardContent"].ToString();
            activeInfo.HasKey       = (int)reader["HasKey"];
            if (!string.IsNullOrEmpty(reader["EndDate"].ToString()))
            {
                activeInfo.EndDate = new DateTime?((DateTime)reader["EndDate"]);
            }
            activeInfo.IsOnly             = (int)reader["IsOnly"];
            activeInfo.StartDate          = (DateTime)reader["StartDate"];
            activeInfo.Title              = reader["Title"].ToString();
            activeInfo.Type               = (int)reader["Type"];
            activeInfo.ActiveType         = (int)reader["ActiveType"];
            activeInfo.ActionTimeContent  = reader["ActionTimeContent"] == null ? "" : reader["ActionTimeContent"].ToString();
            activeInfo.IsAdvance          = (bool)reader["IsAdvance"];
            activeInfo.GoodsExchangeTypes = reader["GoodsExchangeTypes"] == null ? "" : reader["GoodsExchangeTypes"].ToString();
            activeInfo.GoodsExchangeNum   = reader["GoodsExchangeNum"] == null ? "" : reader["GoodsExchangeNum"].ToString();
            activeInfo.limitType          = reader["limitType"] == null ? "" : reader["limitType"].ToString();
            activeInfo.limitValue         = reader["limitValue"] == null ? "" : reader["limitValue"].ToString();
            activeInfo.IsShow             = (bool)reader["IsShow"];
            activeInfo.IconID             = (int)reader["IconID"];
            return(activeInfo);
        }
コード例 #3
0
        public static ActiveInfo GetInfo(string _sessionID)
        {
            ActiveInfo    retVal = null;
            SqlConnection dbConn = new SqlConnection(AppEnv.ConnectionString);
            SqlCommand    dbCmd  = new SqlCommand("Main_Active_GetInfo", dbConn);

            dbCmd.CommandType = CommandType.StoredProcedure;
            dbCmd.Parameters.AddWithValue("@SessionID", _sessionID);
            try
            {
                dbConn.Open();
                SqlDataReader dr = dbCmd.ExecuteReader();
                if (dr.Read())
                {
                    retVal                = new ActiveInfo();
                    retVal.SessionID      = Convert.ToString(dr["SessionID"]);
                    retVal.IP             = Convert.ToString(dr["IP"]);
                    retVal.User_ID        = Convert.ToInt32(dr["User_ID"]);
                    retVal.LoginTime      = Convert.ToDateTime(dr["LoginTime"]);
                    retVal.LastActiveTime = Convert.ToDateTime(dr["LastActiveTime"]);
                }
                if (dr != null)
                {
                    dr.Close();
                }
            }
            finally
            {
                dbConn.Close();
            }
            return(retVal);
        }
コード例 #4
0
        /// <summary>
        /// 是否可以操作(添加/修改)活动
        /// </summary>
        /// <param name="active"></param>
        /// <param name="products"></param>
        /// <returns></returns>
        public bool CanOperationActive(ActiveInfo active, IEnumerable <ActiveProductInfo> products)
        {
            bool     result = false;
            DateTime now    = DateTime.Now;
            var      actsql = Context.ActiveInfo.Where(d => d.ActiveType == CurrentActiveType && d.EndTime > now && d.ShopId == active.ShopId);

            if (active.Id > 0)
            {
                actsql = actsql.Where(d => d.Id != active.Id);
            }
            if (active.IsAllProduct && actsql.Count() > 0)
            {
                return(false);
            }
            if (!actsql.Any(d => d.IsAllProduct))
            {
                var actids = actsql.Select(d => d.Id);
                var proids = Context.ActiveProductInfo.Where(d => actids.Contains(d.ActiveId)).Select(d => d.ProductId).ToList();
                result = true;
                foreach (var item in products)
                {
                    if (proids.Contains(item.ProductId))
                    {
                        result = false;
                    }
                }
            }
            return(result);
        }
コード例 #5
0
ファイル: PieceItem02.cs プロジェクト: 37Sir/WarChess
    /// <summary>
    /// 拖动结束
    /// </summary>
    public void OnDragEnd()
    {
        if (canMove == false || m_type == Config.PieceType.K)
        {
            return;
        }
        m_isTipsShow = false;
        var     px     = m_target.transform.position.x - m_beginPos.x;
        var     pz     = m_target.transform.position.z - m_beginPos.z;
        var     d      = Math.Sqrt(px * px + pz * pz);
        var     dx     = Math.Abs(px);
        var     dz     = Math.Abs(pz);
        int     xblock = (int)Math.Round(dx / Config.PieceWidth, 0);
        int     zblock = (int)Math.Round(dz / Config.PieceWidth, 0);
        var     dir    = GetDirectByDeltaXZ(px, pz);
        Vector2 to     = new Vector2(m_X + xblock * dir.x, m_Z + zblock * dir.y);

        if (d >= Config.MoveDistance && to.x <= 8 && to.x >= 1 && to.y >= 1 && to.y <= 8)//todo 不能直接套用
        {
            var tempEat = App.ChessLogic02.GetPiece(to.x - 1, to.y - 1);
            m_body = new object[] { m_X, m_Z, m_mediator.pieceData.color, to, tempEat };
            if (App.ChessLogic02.DoMove(new Vector2(m_X - 1, m_Z - 1), new Vector2(to.x - 1, to.y - 1)))
            {
                var piece     = App.ChessLogic02.GetPiece((int)to.x - 1, (int)to.y - 1);//移动后的棋子
                var indexFrom = CoorToIndex((int)m_X, (int)m_Z);
                var indexTo   = CoorToIndex((int)to.x, (int)to.y);

                ActiveInfo.Builder activeInfo = ActiveInfo.CreateBuilder();
                MoveInfo.Builder   moveInfo   = MoveInfo.CreateBuilder();
                moveInfo.SetFrom(indexFrom);
                moveInfo.SetTo(indexTo);
                moveInfo.SetUserId(m_UserProxy.GetPlayerId());
                activeInfo.SetIsCall(false);
                activeInfo.SetMoveInfo(moveInfo);
                m_mediator.NotityDragEnd(activeInfo);
                object[] args = new object[] { new Vector2(m_X, m_Z), to, new Vector2(-1, tempEat) };//0:from, 1:to, 2.x:兵生变类型 -1为没有, 2.y:吃棋信息
                ShowMove(args);
                StopFlash();
                App.SoundManager.PlaySoundClip(Config.Sound.DragSuccess);
            }
            else
            {
                SetPiecePos(m_X, m_Z);
                m_mediator.NotityDragEnd(null);//不能移动
                App.SoundManager.PlaySoundClip(Config.Sound.DragFail);
            }
        }
        else
        {
            SetPiecePos(m_X, m_Z);
            m_mediator.NotityDragEnd(null);//距离不够 驳回
        }
        m_target.SetActive(false);
    }
コード例 #6
0
ファイル: PVP02Panel.cs プロジェクト: 37Sir/WarChess
    public void OnModelClick(Vector3 clickPoint)
    {
        if (m_selectType > -1)
        {
            var pointX  = clickPoint.x;
            var pointZ  = clickPoint.z;
            var offsetX = pointX % 2;
            var offsetZ = pointZ % 2;
            var x       = (pointX - offsetX) / 2;
            var z       = (pointZ - offsetZ) / 2;
            var point   = new Vector2(x, z);

            if (canNext == true && App.ChessLogic02.DoSummon(point, m_selectType))
            {
                Debug.Log("召唤成功");
                var type = m_selectType % 10;
                m_mediator.Energy -= Config.PieceCost[type];
                if (m_isTest == false)
                {
                    ActiveInfo.Builder activeInfo = ActiveInfo.CreateBuilder();
                    activeInfo.SetIsCall(true);
                    CallInfo.Builder callInfo = CallInfo.CreateBuilder();
                    callInfo.SetIndex(CoorToIndex((int)(x + 1), (int)(z + 1)));
                    callInfo.SetType(type);
                    callInfo.SetUserId(m_proxy.GetPlayerId());
                    activeInfo.SetCallInfo(callInfo);
                    m_mediator.NotifyPlayerActive(activeInfo);
                }
                OnSummon(m_selectType, new Vector2(point.x + 1, point.y + 1));
            }
            else
            {
                Debug.Log("召唤失败");
            }
            m_selectType = -1;
            OnSummonTipsHide();
            OnEnergyEffectHide();
        }
        else
        {
            var pointX  = clickPoint.x;
            var pointZ  = clickPoint.z;
            var offsetX = pointX % 2;
            var offsetZ = pointZ % 2;
            var x       = (pointX - offsetX) / 2;
            var z       = (pointZ - offsetZ) / 2;
            var point   = new Vector2(x + 1, z + 1);

            m_mediator.NotifyPieceClick(point);
        }
    }
コード例 #7
0
 public static XElement CreateActiveInfo(ActiveInfo info)
 {
     return(new XElement("Item", new XAttribute("ActiveID", info.ActiveID),
                         new XAttribute("Description", info.Description == null ? "" : info.Description),
                         new XAttribute("Content", info.Content == null ? "" : info.Content),
                         new XAttribute("AwardContent", info.AwardContent == null ? "" : info.AwardContent),
                         new XAttribute("HasKey", info.HasKey),
                         new XAttribute("EndDate", info.EndDate == null ? "" : ((DateTime)info.EndDate).ToString("yyyy-MM-dd HH:mm:ss")),
                         new XAttribute("IsOnly", info.IsOnly),
                         new XAttribute("StartDate", string.IsNullOrEmpty(info.StartDate.ToString()) ? "" : info.StartDate.ToString("yyyy-MM-dd HH:mm:ss")),
                         new XAttribute("Title", info.Title == null ? "" : info.Title),
                         new XAttribute("Type", info.Type),
                         new XAttribute("ActionTimeContent", info.ActionTimeContent == null ? "" : info.ActionTimeContent)));
 }
コード例 #8
0
    /// <summary>
    /// 在最后回调的时候调用
    /// </summary>
    /// <param name="target"></param>
    /// <param name="id"></param>
    private void AddActivePoolInfo(Object target, AssetID id)
    {
        if (target == null)
        {
            return;
        }
        ActiveInfo info;

        if (!mActivePools.TryGetValue(target, out info))
        {
            info = new ActiveInfo(target, id);
            mActivePools.Add(target, info);
        }
        info.AddCount();
    }
コード例 #9
0
    /// <summary>
    /// 回收时对激活池进行减处理
    /// </summary>
    /// <param name="target"></param>
    /// <returns></returns>
    private ActiveInfo DecActivePoolInfo(Object target)
    {
        ActiveInfo info = null;

        if (mActivePools.TryGetValue(target, out info))
        {
            info.DecCount();
            if (info.IsEmpty)
            {
                mActivePools.Remove(target);
                info.Dispose();
            }
        }
        return(info);
    }
コード例 #10
0
 /// <summary>
 /// 新增满减活动
 /// </summary>
 /// <param name="data"></param>
 /// <param name="rules"></param>
 /// <param name="products"></param>
 public void AddActive(ActiveInfo data, IEnumerable <FullDiscountRulesInfo> rules, IEnumerable <ActiveProductInfo> products)
 {
     data.ActiveType = CurrentActiveType;
     Context.ActiveInfo.Add(data);
     Context.SaveChanges();
     foreach (var item in rules)
     {
         item.ActiveId = data.Id;
     }
     foreach (var item in products)
     {
         item.ActiveId = data.Id;
     }
     Context.FullDiscountRulesInfo.AddRange(rules);
     Context.ActiveProductInfo.AddRange(products);
     Context.SaveChanges();
 }
コード例 #11
0
 /// <summary>
 /// 更新满减活动
 /// </summary>
 /// <param name="data"></param>
 /// <param name="rules"></param>
 /// <param name="products"></param>
 public void UpdateActive(ActiveInfo data, IEnumerable <FullDiscountRulesInfo> rules, IEnumerable <ActiveProductInfo> products)
 {
     UpdateData(data);
     Context.FullDiscountRulesInfo.Remove(d => d.ActiveId == data.Id);
     foreach (var item in rules)
     {
         item.ActiveId = data.Id;
     }
     Context.FullDiscountRulesInfo.AddRange(rules);
     Context.ActiveProductInfo.Remove(d => d.ActiveId == data.Id);
     foreach (var item in products)
     {
         item.ActiveId = data.Id;
     }
     Context.ActiveProductInfo.AddRange(products);
     Context.SaveChanges();
 }
コード例 #12
0
    private void ActiveShua(PActiveBox boxinfo)
    {
        if (boxinfo == null)
        {
            return;
        }
        GameObject stateobj = state[boxinfo.id];

        if (stateobj == null)
        {
            Logger.LogError("can not find award state obj");
            return;
        }
        ActiveInfo active = stateobj.GetComponentDefault <ActiveInfo>();

        active.Click(boxinfo.id, Award_show);
        active.Show(moduleActive.Activestae[boxinfo.id], boxinfo.activePoint);
    }
コード例 #13
0
        public Active(string activeId)
        {
            ActiveId = activeId;

            ActiveInfo active = ActiveDataAccess.GetActive(activeId);

            ActiveName = active.ActiveName;
            FormId     = active.FormId;
            ActiveType = active.ActiveType;

            List <ParticipantInfo> listParameterInfo = ParticipantDataAccess.GetParticipantByActive(activeId);

            //participant
            if (listParameterInfo.Count > 0)
            {
                m_Participant = (Participant)Assembly.Load("SimpleFlow.BusinessRules").CreateInstance("SimpleFlow.BusinessRules.Participant" + listParameterInfo[0].ParticipantKind);
                m_Participant.ParticipantId = listParameterInfo[0].ParticipantId;
            }
        }
コード例 #14
0
        /// <summary>
        /// 更新满减活动
        /// </summary>
        /// <param name="model"></param>
        public static void UpdateActive(FullDiscountActive model)
        {
            ActiveInfo data = Mapper.Map <FullDiscountActive, ActiveInfo>(model);
            List <FullDiscountRulesInfo> rules    = Mapper.Map <List <FullDiscountRules>, List <FullDiscountRulesInfo> >(model.Rules);
            List <ActiveProductInfo>     products = Mapper.Map <List <FullDiscountActiveProduct>, List <ActiveProductInfo> >(model.Products);

            if (data.Id == 0)
            {
                throw new HimallException("错误的活动编号");
            }

            //判断活动是否可添加
            if (!_iFullDiscountService.CanOperationActive(data, products))
            {
                throw new HimallException("有其他冲突活动存在,不可以完成操作");
            }

            _iFullDiscountService.UpdateActive(data, rules, products);
        }
コード例 #15
0
        /// <summary>
        /// 新增满减活动
        /// </summary>
        /// <param name="data"></param>
        /// <param name="rules"></param>
        /// <param name="products"></param>
        public void AddActive(ActiveInfo data, IEnumerable <FullDiscountRuleInfo> rules, IEnumerable <ActiveProductInfo> products)
        {
            DbFactory.Default.InTransaction(() =>
            {
                data.ActiveType = CurrentActiveType;
                DbFactory.Default.Add(data);

                foreach (var item in rules)
                {
                    item.ActiveId = data.Id;
                }
                foreach (var item in products)
                {
                    item.ActiveId = data.Id;
                }
                DbFactory.Default.Add(rules);
                DbFactory.Default.Add(products);
            });
        }
コード例 #16
0
        public ActiveInfo InitActiveInfo(SqlDataReader reader)
        {
            ActiveInfo info = new ActiveInfo();

            info.ActiveID     = (int)reader["ActiveID"];
            info.Description  = ((reader["Description"] == null) ? "" : reader["Description"].ToString());
            info.Content      = ((reader["Content"] == null) ? "" : reader["Content"].ToString());
            info.AwardContent = ((reader["AwardContent"] == null) ? "" : reader["AwardContent"].ToString());
            info.HasKey       = (int)reader["HasKey"];
            if (!string.IsNullOrEmpty(reader["EndDate"].ToString()))
            {
                info.EndDate = (DateTime)reader["EndDate"];
            }
            info.IsOnly            = (bool)reader["IsOnly"];
            info.StartDate         = (DateTime)reader["StartDate"];
            info.Title             = reader["Title"].ToString();
            info.Type              = (int)reader["Type"];
            info.ActionTimeContent = ((reader["ActionTimeContent"] == null) ? "" : reader["ActionTimeContent"].ToString());
            return(info);
        }
コード例 #17
0
        public static void Update(ActiveInfo _activeInfo)
        {
            SqlConnection dbConn = new SqlConnection(AppEnv.ConnectionString);
            SqlCommand    dbCmd  = new SqlCommand("Main_Active_Update", dbConn);

            dbCmd.CommandType = CommandType.StoredProcedure;
            dbCmd.Parameters.AddWithValue("@SessionID", _activeInfo.SessionID);
            dbCmd.Parameters.AddWithValue("@IP", _activeInfo.IP);
            dbCmd.Parameters.AddWithValue("@User_ID", _activeInfo.User_ID);
            dbCmd.Parameters.AddWithValue("@LoginTime", _activeInfo.LoginTime);
            dbCmd.Parameters.AddWithValue("@LastActiveTime", _activeInfo.LastActiveTime);
            try
            {
                dbConn.Open();
                dbCmd.ExecuteNonQuery();
            }
            finally
            {
                dbConn.Close();
            }
        }
コード例 #18
0
        /// <summary>
        ///   校验是否激活
        /// </summary>
        /// <param name = "str1">CDKEY</param>
        /// <param name = "str2">HashCode</param>
        /// <returns></returns>
        public ActiveInfo CheckActive(string str1, string str2)
        {
            //检验成功为false
            //失败为true = =恶趣味
            //此处设计需要进行加强 以免爆破

            //拆包str2
            var iInfo = new ActiveInfo();

            string[] tempArr = Regex.Split(GetHash(str2), "!");
            iInfo.isSuccess = false;
            //iSystem.CPUID() 1
            if (DecryptRijndael(iCrype.CryptString(tempArr[1])) == iSystem.CPUID())
            {
                if (DecryptRijndael(iCrype.CryptString(tempArr[2])) == iSystem.HardDiskID())
                {
                    if (DecryptRijndael(iCrype.CryptString(tempArr[3])) == iSystem.WinDIR())
                    {
                        if (DecryptRijndael(iCrype.CryptString(tempArr[4])) == iSystem.MachineName())
                        {
                            if (DecryptRijndael(iCrype.CryptString(tempArr[5])) == str1)
                            {
                                //这里测试时间!注意 长度和激活开始时间

                                //(DecryptRijndael(iCrype.CryptString(tempArr[6])) //ReqTime
                                //(DecryptRijndael(iCrype.CryptString(tempArr[7])) //ActTime

                                //全对 那么表示校验完全正确
                                iInfo.ActTime   = DecryptRijndael(iCrype.CryptString(tempArr[7]));
                                iInfo.isSuccess = true;
                                iInfo.aDuration = int.Parse(tempArr[0]);
                            }
                        }
                    }
                }
            }
            return(iInfo);
        }
コード例 #19
0
        public static int Insert(ActiveInfo _activeInfo)
        {
            SqlConnection dbConn = new SqlConnection(AppEnv.ConnectionString);
            SqlCommand    dbCmd  = new SqlCommand("Main_Active_Insert", dbConn);

            dbCmd.CommandType = CommandType.StoredProcedure;
            dbCmd.Parameters.AddWithValue("@SessionID", _activeInfo.SessionID);
            dbCmd.Parameters.AddWithValue("@IP", _activeInfo.IP);
            dbCmd.Parameters.AddWithValue("@User_ID", _activeInfo.User_ID);
            dbCmd.Parameters.AddWithValue("@LoginTime", _activeInfo.LoginTime);
            dbCmd.Parameters.AddWithValue("@LastActiveTime", _activeInfo.LastActiveTime);
            dbCmd.Parameters.AddWithValue("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue;
            try
            {
                dbConn.Open();
                dbCmd.ExecuteNonQuery();
                return((int)dbCmd.Parameters["@RETURN_VALUE"].Value);
            }
            finally
            {
                dbConn.Close();
            }
        }
コード例 #20
0
ファイル: FlashUtils.cs プロジェクト: SkelletonX/DDTServer
    public static XElement CreateActiveInfo(ActiveInfo info)
    {
        XName arg_1C0_0 = "Item";

        object[] array = new object[11];
        array[0] = new XAttribute("ActiveID", info.ActiveID);
        array[1] = new XAttribute("Description", (info.Description == null) ? "" : info.Description);
        array[2] = new XAttribute("Content", (info.Content == null) ? "" : info.Content);
        array[3] = new XAttribute("AwardContent", (info.AwardContent == null) ? "" : info.AwardContent);
        array[4] = new XAttribute("HasKey", info.HasKey);
        object[] arg_ED_0 = array;
        int      arg_ED_1 = 5;
        XName    arg_E8_0 = "EndDate";
        DateTime arg_D4_0 = info.EndDate;

        arg_ED_0[arg_ED_1] = new XAttribute(arg_E8_0, info.EndDate.ToString("yyyy-MM-dd HH:mm:ss"));
        array[6]           = new XAttribute("IsOnly", info.IsOnly);
        array[7]           = new XAttribute("StartDate", string.IsNullOrEmpty(info.StartDate.ToString()) ? "" : info.StartDate.ToString("yyyy-MM-dd HH:mm:ss"));
        array[8]           = new XAttribute("Title", (info.Title == null) ? "" : info.Title);
        array[9]           = new XAttribute("Type", info.Type);
        array[10]          = new XAttribute("ActionTimeContent", (info.ActionTimeContent == null) ? "" : info.ActionTimeContent);
        return(new XElement(arg_1C0_0, array));
    }
コード例 #21
0
        public static void AddActive(FullDiscountActive model)
        {
            ActiveInfo data = Mapper.Map <FullDiscountActive, ActiveInfo>(model);
            List <FullDiscountRulesInfo> rules    = Mapper.Map <List <FullDiscountRules>, List <FullDiscountRulesInfo> >(model.Rules);
            List <ActiveProductInfo>     products = Mapper.Map <List <FullDiscountActiveProduct>, List <ActiveProductInfo> >(model.Products);

            //判断活动是否可添加
            if (!_iFullDiscountService.CanOperationActive(data, products))
            {
                throw new HimallException("有其他冲突活动存在,不可以完成操作");
            }

            _iFullDiscountService.AddActive(data, rules, products);
            //值回填
            model.Id = data.Id;
            foreach (var item in model.Rules)
            {
                item.ActiveId = model.Id;
            }
            foreach (var item in model.Products)
            {
                item.ActiveId = model.Id;
            }
        }
コード例 #22
0
ファイル: FormFlowBiz.cs プロジェクト: bertyang/SimpleFlow
        /// <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));
        }