Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="xmlDoc"></param>
        public static void DelSecsOfLeader(XmlDocument xmlDoc)
        {
            DataOpContext dataOpContext = InitEventContexts();

            dataOpContext.OnBeforeDelSecsOfLeader(xmlDoc);

            using (TransactionScope scope = TransactionScopeFactory.Create())
            {
                dataOpContext.OnDelSecsOfLeader(xmlDoc);
                scope.Complete();
            }
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="xmlDoc"></param>
        public static void RealDeleteObjects(XmlDocument xmlDoc)
        {
            DataOpContext dataOpContext = InitEventContexts();

            dataOpContext.OnBeforeRealDeleteObjects(xmlDoc);

            using (TransactionScope scope = TransactionScopeFactory.Create())
            {
                dataOpContext.OnRealDeleteObjects(xmlDoc);
                scope.Complete();
            }
        }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="xmlDoc"></param>
        public static void SetUserMainDuty(XmlDocument xmlDoc)
        {
            DataOpContext dataOpContext = InitEventContexts();

            dataOpContext.OnBeforeSetUserMainDuty(xmlDoc);

            using (TransactionScope scope = TransactionScopeFactory.Create())
            {
                dataOpContext.OnSetUserMainDuty(xmlDoc);
                scope.Complete();
            }
        }
Exemple #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="xmlDoc"></param>
        public static void InitPassword(XmlDocument xmlDoc)
        {
            DataOpContext dataOpContext = InitEventContexts();

            dataOpContext.OnBeforeInitPassword(xmlDoc);

            using (TransactionScope scope = TransactionScopeFactory.Create())
            {
                dataOpContext.OnInitPassword(xmlDoc);
                scope.Complete();
            }
        }
Exemple #5
0
        private static DataOpContext InitEventContexts()
        {
            DataOpContext contexts = new DataOpContext();

            foreach (IOguDataOperation op in OguDataOperationSettings.GetConfig().Operations)
            {
                OguDataOperationEventContainer container = new OguDataOperationEventContainer();

                op.Init(container);
                contexts.EventContainers.Add(container);
            }

            return(contexts);
        }
Exemple #6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="xmlDoc"></param>
        public static XmlDocument SetSecsToLeader(XmlDocument xmlDoc)
        {
            List <XmlDocument> xmlDocList = new List <XmlDocument>();
            XmlDocument        result     = null;

            DataOpContext dataOpContext = InitEventContexts();

            dataOpContext.OnBeforeSetSecsToLeader(xmlDoc);

            using (TransactionScope scope = TransactionScopeFactory.Create())
            {
                xmlDocList = dataOpContext.OnSetSecsToLeader(xmlDoc);
                scope.Complete();
            }

            if (xmlDocList.Count == 1)
            {
                result = xmlDocList[0];
            }
            return(result);
        }
		private static DataOpContext InitEventContexts()
		{
			DataOpContext contexts = new DataOpContext();

			foreach (IOguDataOperation op in OguDataOperationSettings.GetConfig().Operations)
			{
				OguDataOperationEventContainer container = new OguDataOperationEventContainer();

				op.Init(container);
				contexts.EventContainers.Add(container);
			}

			return contexts;
		}