示例#1
0
        public override OperationResponse Execute()
        {
            logger.Info("begin");
            OperationResponse res = new OperationResponse();

            try
            {
                CreaDelegaRequest request = new CreaDelegaRequest();
                request.Delega   = _delega;
                request.UserInfo = NavigationHandler.CurrentUser;
                logger.Debug("chiamata ws...");
                CreaDelegaResponse response = WSStub.creaDelega(request);
                logger.Debug("chiamata eseguita");
                if (response.Code == CreaDelegaResponseCode.OK)
                {
                    logger.Debug("delega creata");
                    res.Success = true;
                }
                else if (response.Code == CreaDelegaResponseCode.NOT_CREATED)
                {
                    logger.Debug("delega non creata");
                    res.Success = false;
                    res.Error   = Resources.Errors.Deleghe_DelegaNotCreated;
                }
                else if (response.Code == CreaDelegaResponseCode.OVERLAPPING_PERIODS)
                {
                    logger.Debug("delega non creata per periodi sovrapposti");
                    res.Success = false;
                    res.Error   = Resources.Errors.Deleghe_OverlappingPeriods;
                }
                else if (response.Code == CreaDelegaResponseCode.SYSTEM_ERROR)
                {
                    logger.Debug("errore di sistema");
                    res.Success = false;
                    res.Error   = Resources.Errors.Common_SystemError;
                }
            }
            catch (Exception e)
            {
                res.Success = false;
                res.Error   = Resources.Errors.Common_SystemError;
            }
            return(res);
        }
示例#2
0
 public CreaDelegaResponse creaDelega(CreaDelegaRequest request)
 {
     SetUserId(request.UserInfo);
     return(MobileManager.creaDelega(request));
 }