Пример #1
0
 static TicketHelpers()
 {
     TicketStatus   = new TicketStatusService();
     TicketCategory = new TicketCategoryService();
     TicketPriority = new TicketPriorityService();
     TicketType     = new TicketTypeService();
     UserRepository = new UserService();
 }
Пример #2
0
 public TicketController()
 {
     _categoryService       = new CategoryService();
     _ticketService         = new TicketService();
     _userService           = new UserService();
     _ticketCategoryService = new TicketCategoryService();
     _ticketPriority        = new TicketPriorityService();
     _ticketStatus          = new TicketStatusService();
     _ticketType            = new TicketTypeService();
     _emailService          = new Core.Implementation.EmailService();
     _ticketProject         = new TicketProjectService();
 }
Пример #3
0
        public override void UpdateDatabaseAfterUpdateSchema()
        {
            base.UpdateDatabaseAfterUpdateSchema();

            // Ticket Type//
            Type dataType = module.TicketTypeDataType;

            foreach (string name in new[] { "Task", "Idea", "Error" })
            {
                ITicketType type = null;
                type = ObjectSpace.FindObject(dataType, new BinaryOperator(nameof(type.Ticket_Type), name)) as ITicketType;
                if (type == null)
                {
                    type             = ObjectSpace.CreateObject(dataType) as ITicketType;
                    type.Ticket_Type = name;
                }
            }

            ObjectSpace.CommitChanges();

            //Ticket Priority//
            Type dtTypeTicketPriority = module.TicketPriorityDataType;

            foreach (string name in new[] { "High", "Medium", "Low" })
            {
                ITicketPriority typePriority = null;
                typePriority =
                    ObjectSpace.FindObject(dtTypeTicketPriority, new BinaryOperator(nameof(typePriority.Ticket_Priority), name)) as ITicketPriority;
                if (typePriority == null)
                {
                    typePriority = ObjectSpace.CreateObject(dtTypeTicketPriority) as ITicketPriority;
                    typePriority.Ticket_Priority = name;
                }
            }

            ObjectSpace.CommitChanges();

            //string name = "MyName";
            //DomainObject1 theObject = ObjectSpace.FindObject<DomainObject1>(CriteriaOperator.Parse("Name=?", name));
            //if(theObject == null) {
            //    theObject = ObjectSpace.CreateObject<DomainObject1>();
            //    theObject.Name = name;
            //}

            //ObjectSpace.CommitChanges(); //Uncomment this line to persist created object(s).
        }