Пример #1
0
        public GetMongoProceduresListResponse GetProceduresList(GetMongoProceduresListRequest request)
        {
            try
            {
                GetMongoProceduresListResponse response = new GetMongoProceduresListResponse();
                response.Procedures = new List <Program.DTO.MongoProcedure>();

                foreach (Type mytype in Assembly.GetExecutingAssembly().GetTypes()
                         .Where(mytype => mytype.GetInterfaces().Contains(typeof(IMongoProcedure)) && !mytype.IsAbstract))
                {
                    var allProcedureConsts = GetProcedureConstValues <string>(mytype);
                    response.Procedures.Add(new Program.DTO.MongoProcedure
                    {
                        Name        = allProcedureConsts[0],
                        Description = allProcedureConsts.Count > 1 ? allProcedureConsts[1] : null
                    });
                }

                response.Version = 1.0;

                return(response);
            }
            catch (Exception ex)
            {
                throw new Exception("DD:DataProgramManager:ExecuteProcedure()::" + ex.Message, ex.InnerException);
            }
        }
Пример #2
0
        public GetMongoProceduresListResponse Get(GetMongoProceduresListRequest request)
        {
            GetMongoProceduresListResponse response = new GetMongoProceduresListResponse();

            try
            {
                if (string.IsNullOrEmpty(request.UserId))
                {
                    throw new UnauthorizedAccessException("ProgramDD:Post()::Unauthorized Access");
                }

                IProceduresManager pm = new ProceduresManager();
                response         = pm.GetProceduresList(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);
        }