コード例 #1
0
        public ImplementAgenciesResponse GetImplementAgencies([FromBody] BaseRequest request)
        {
            ImplementAgenciesResponse response = new ImplementAgenciesResponse();

            try
            {
                if (!BAplication.ValidateAplicationToken(request.ApplicationToken))
                {
                    response.Code    = "2";
                    response.Message = Messages.ApplicationTokenNoAutorize;
                    return(response);
                }

                List <MImplementAgency> ImplementAgencies = BImplementAgency.List();

                response.ImplementAgencies = ImplementAgencies.ToArray();
                response.Code    = "0";
                response.Message = "Success";
            }
            catch (Exception ex)
            {
                response.Code    = "2";
                response.Message = ex.Message;
            }

            return(response);
        }
コード例 #2
0
ファイル: ProjectController.cs プロジェクト: Pxndit4/Easylife
        public ProjectFinancialPropertiesResponse ProjectFinancialProperties([FromBody] BaseRequest request)
        {
            ProjectFinancialPropertiesResponse response = new ProjectFinancialPropertiesResponse();

            List <MDeparment>       deparments        = new List <MDeparment>();
            List <MFund>            funds             = new List <MFund>();
            List <MImplementAgency> implementAgencies = new List <MImplementAgency>();

            try
            {
                if (!BAplication.ValidateAplicationToken(request.ApplicationToken))
                {
                    response.Code    = "2";
                    response.Message = Messages.ApplicationTokenNoAutorize;
                    return(response);
                }

                deparments        = BDeparment.List();
                funds             = BFund.List();
                implementAgencies = BImplementAgency.List();

                response.Code              = "0";
                response.Message           = "Success";
                response.Deparments        = deparments.ToArray();
                response.Funds             = funds.ToArray();
                response.ImplementAgencies = implementAgencies.ToArray();
            }
            catch (Exception ex)
            {
                response.Code    = "2";
                response.Message = ex.Message;
            }

            return(response);
        }