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(); } }
public static void SetSeccode_OnAfterInsertStep(Sage.Entity.Interfaces.IStampMaster stampmaster) { // TODO: Complete business rule implementation Sage.Entity.Interfaces.IOwner objOwner = Sage.Platform.EntityFactory.GetById <Sage.Entity.Interfaces.IOwner>("SYST00000001"); stampmaster.Owner = objOwner; stampmaster.Save(); }
public static void SetSeccode_OnAfterInsertStep(Sage.Entity.Interfaces.IBranch branch) { // TODO: Complete business rule implementation //Sage.Entity.Interfaces.IUser currentUser = BusinessRuleHelper.GetCurrentUser(session); Sage.Entity.Interfaces.IOwner objOwner = Sage.Platform.EntityFactory.GetById <Sage.Entity.Interfaces.IOwner>("SYST00000001"); branch.Owner = objOwner; branch.Save(); }