public ServiceResult <object> AutocompleteView(Clause clause)
        {
            var userInfo    = _userSessionManager.GetUserInfo(clause.Ticket, Request);
            var bp          = new BusinessParam(userInfo, clause);
            var checkAccess = _userSessionManager.CheckAccess(bp, ClassDetails[0].Clazz, "autocomplete");

            return(checkAccess.Done
                ? LocationFacade.GetInstance().AutocompleteView(bp)
                : checkAccess);
        }
        public ServiceResult <object> Save()
        {
            var dtoFromRequest = LocationFacade.GetInstance().GetDtoFromRequest(HttpContext.Request);

            if (!dtoFromRequest.Done)
            {
                return(dtoFromRequest);
            }
            var dto         = (LocationDto)dtoFromRequest.Result;
            var userInfo    = _userSessionManager.GetUserInfo(dto.Ticket, Request);
            var bp          = new BusinessParam(userInfo);
            var checkAccess = _userSessionManager.CheckAccess(bp, ClassDetails[0].Clazz,
                                                              dto.EntityId == 0 ? "insert" : "update");

            return(checkAccess.Done ? LocationFacade.GetInstance().Save(bp, dto) : checkAccess);
        }
Example #3
0
        public DataLayer.Model.Core.Location.Location GetEntity(LocationDto dto, BusinessParam bp, bool setCreate)
        {
            var location = new DataLayer.Model.Core.Location.Location
            {
                EntityId  = dto.EntityId,
                Active    = dto.Active,
                Code      = dto.Code,
                Deleted   = dto.Deleted,
                FullTitle = LocationFacade.GetInstance().GetParent(bp, dto.Parent?.EntityId) + " - " + dto.Name,
                Name      = dto.Name,
                ParentId  = dto.Parent?.EntityId,
                Type      = dto.Type.EntityId
            };

            return(SetMandatoryField(location, bp, setCreate));
        }