Esempio n. 1
0
        public GetAllActionsDataResponse Get(GetAllActionsDataRequest request)
        {
            GetAllActionsDataResponse response = new GetAllActionsDataResponse();

            try
            {
                //Get the UserId from the Header and update the request object
                //request.UserId = HttpContext.Current.Request.Headers.Get(_phytelUserIDToken);
                if (string.IsNullOrEmpty(request.UserId))
                {
                    throw new UnauthorizedAccessException("ActionDD:Get()::Unauthorized Access");
                }

                response         = ActionDataManager.GetActionsList(request);
                response.Version = request.Version;
            }
            catch (Exception ex)
            {
                CommonFormatter.FormatExceptionResponse(response, base.Response, ex);

                string aseProcessID = ConfigurationManager.AppSettings.Get("ASEProcessID") ?? "0";
                Common.Helper.LogException(int.Parse(aseProcessID), ex);
            }
            return(response);
        }
Esempio n. 2
0
        public GetAllActionsDataResponse SelectAll(double versionNumber, Status status)
        {
            GetAllActionsDataResponse response = new GetAllActionsDataResponse()
            {
                Version = versionNumber
            };

            List <DTO.ActionData> list = new List <DTO.ActionData>();

            using (ActionMongoContext ctx = new ActionMongoContext(_dbName))
            {
                //var x = (from a in ctx.Actions
                //       //where a.CompletedBy.ToString().Length > 5
                //       select new DTO.ActionData
                //       {
                //           ID = a.Id.ToString(),
                //           Name = a.Name,
                //           Description = a.Description
                //           //Status = status.ToString()
                //       });


                var l = from a in ctx.Actions
                        select a;

                //foreach (ActionData act in x)
                //{
                //    if(act.CompletedBy.ToString().Length > 5)
                //       response.Actions.Add(act);
                //}
            }

            return(response);
        }
Esempio n. 3
0
        public static GetAllActionsDataResponse GetActionsList(GetAllActionsDataRequest request)
        {
            GetAllActionsDataResponse result = new GetAllActionsDataResponse();

            MongoActionRepository <GetAllActionsDataResponse> repo = new MongoActionRepository <GetAllActionsDataResponse>(request.ContractNumber);

            repo.UserId = request.UserId;

            result = repo.SelectAll(request.Version, Status.Active);

            return(result);
        }