Beispiel #1
0
        public async Task <IEnumerable <dynamic> > GetAsync(string tenant, PlAccountQueryModel query)
        {
            string sql  = "SELECT * FROM finance.get_profit_and_loss_statement(@0::date,@1::date,@2::integer,@3::integer,@4::integer,@5::boolean)";
            string json = await Factory.ScalarAsync <string>(tenant, sql, query.From, query.To, query.UserId, query.OfficeId, query.Factor, query.Compact).ConfigureAwait(false);

            return(JsonConvert.DeserializeObject <IEnumerable <dynamic> >(json));
        }
Beispiel #2
0
        public async Task <ActionResult> GetPlAccountAsync(PlAccountQueryModel model)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.InvalidModelState(this.ModelState));
            }


            var meta = await AppUsers.GetCurrentAsync().ConfigureAwait(true);

            model.OfficeId = meta.OfficeId;
            model.UserId   = meta.UserId;

            try
            {
                var result = await ProfitLossStatement.GetAsync(this.Tenant, model).ConfigureAwait(true);

                return(this.Ok(result));
            }
            catch (Exception ex)
            {
                return(this.Failed(ex.Message, HttpStatusCode.InternalServerError));
            }
        }
Beispiel #3
0
        public async Task <IEnumerable <dynamic> > GetAsync(string tenant, PlAccountQueryModel query)
        {
            string sql = "EXECUTE finance.get_profit_and_loss_statement @0,@1,@2,@3,@4,@5;";

            return(await Factory.GetAsync <dynamic>(tenant, sql, query.From, query.To, query.UserId, query.OfficeId, query.Factor, query.Compact).ConfigureAwait(false));
        }
Beispiel #4
0
        public static async Task <IEnumerable <dynamic> > GetAsync(string tenant, PlAccountQueryModel query)
        {
            var service = GetService(tenant);

            return(await service.GetAsync(tenant, query).ConfigureAwait(false));
        }