Example #1
0
        public static void EuroOnAfterTicketInsert(ITicket ticket)
        {
            //=========================================================================
            // Needed to Update IT Tickets to the Correct Owner
            //=========================================================================
            string result;

            if (ticket.ITTicketLevel != null && ticket.ITTicketLevel != string.Empty)
            {
                //Get Current user
                Sage.SalesLogix.Security.SLXUserService usersvc     = (Sage.SalesLogix.Security.SLXUserService)Sage.Platform.Application.ApplicationContext.Current.Services.Get <Sage.Platform.Security.IUserService>();
                Sage.Entity.Interfaces.IUser            currentuser = usersvc.GetUser();
                if (currentuser.Id.ToString() == "ADMIN       ")
                {
                    //Set it to the default Assigned to
                    result = GetField <string>("ASSIGNEDTOID", "EUROTICKETDEFAULTS", "");
                }
                else
                {
                    //Not the Admin User
                    result = Extentions.GetField <string>("ORIGINATORSECCODEID", "EUROXTICKETMAPPING", "USERID = '" + currentuser.Id.ToString() + "'");
                    if (result == null)
                    {
                        //Set it to the default Assigned to as there is no Origniator Team to be found.
                        result = GetField <string>("ASSIGNEDTOID", "EUROTICKETDEFAULTS", "");
                    }
                }
                Sage.Entity.Interfaces.IOwner MyOwner = Sage.Platform.EntityFactory.GetById <Sage.Entity.Interfaces.IOwner>(result);
                ticket.Owner = MyOwner;
                ticket.Save();
            }
        }
Example #2
0
 public static void EuroGetTicketOriginatorTeam(ITicket ticket, out String result)
 {
     //Get Current user
     Sage.SalesLogix.Security.SLXUserService usersvc     = (Sage.SalesLogix.Security.SLXUserService)Sage.Platform.Application.ApplicationContext.Current.Services.Get <Sage.Platform.Security.IUserService>();
     Sage.Entity.Interfaces.IUser            currentuser = usersvc.GetUser();
     if (currentuser.Id.ToString() == "ADMIN       ")
     {
         //Set it to the default Assigned to
         result = GetField <string>("ASSIGNEDTOID", "EUROTICKETDEFAULTS", "");
     }
     else
     {
         //Not the Admin User
         result = Extentions.GetField <string>("ORIGINATORSECCODEID", "EUROXTICKETMAPPING", "USERID = '" + currentuser.Id.ToString() + "'");
         if (result == null)
         {
             //Set it to the default Assigned to as there is no Origniator Team to be found.
             result = GetField <string>("ASSIGNEDTOID", "EUROTICKETDEFAULTS", "");
         }
     }
 }