Ejemplo n.º 1
0
        public void Update(string planID, string planFile)
        {
            //if plan does not exit, alert
            PlanEntity originalPlan = CheckPlanExists(planID);

            XDocument planDefinition = GetPlanXDocument(planFile);

            PlanEntity plan = GetPlanInformationFromXDocument(planDefinition);

            plan.ID         = originalPlan.ID;
            plan.Status     = originalPlan.Status;
            plan.UpdateTime = DateTime.Now;

            using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions()
            {
                IsolationLevel = System.Transactions.IsolationLevel.RepeatableRead
            }))
            {
                PlanDA.Update(plan);

                BuildPlanScriptReference(plan);

                ts.Complete();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 更新数据
        /// </summary>
        /// <param name="plan">数据实体</param>
        public void Update(PlanVO plan)
        {
            PlanEntity entity = plan.ToPlanEntity();

            if (entity.Id == 0)
            {
                throw new BusinessException("活动id为空");
            }
            this.CheckPlanEntity(entity);

            this.HandlePlanDateTime(entity);
            PlanDA.Update(entity);
        }