Beispiel #1
0
        public override async Task <PostResponse> AsyncSetter(string token)
        {
            using (var context = new Storage.TMSEntities())
            {
                var coa      = context.GL_GetCOACombineTransactionVW.ToList();
                var vouchers = context.Vouchers.ToList();
                foreach (var voucher in vouchers)
                {
                    var detailVoucher = VoucherDetailBodyRequests(voucher, coa);

                    var body = new VoucherPostRequestBody
                    {
                        branch = new GeneralDto {
                            id = voucher.Branch.RefNo, name = voucher.Branch.BranchDescription
                        },
                        desc           = voucher.Description,
                        date           = voucher.VoucherDate,
                        voucher_detail = detailVoucher
                    };

                    await(string.IsNullOrEmpty(voucher.RefNo) ?
                          Create(body, voucher) :
                          Update(voucher.RefNo, body, voucher));

                    context.SaveChanges();
                }
                return(new PostResponse
                {
                    NoOfRecordEffected = 10,
                    Status = ResponseStatus.Ok.ToString()
                });
            }
            //Storage.Voucher
        }
        public override async Task <PostResponse> AsyncSetter(string token)
        {
            using (var context = new Storage.TMSEntities())
            {
                var localSubSubsidiarieses = GetCoaSubSubsidiaries(context);
                foreach (var coaLocal in localSubSubsidiarieses)
                {
                    await(string.IsNullOrEmpty(coaLocal.RefNo) ?
                          Create(coaLocal) :
                          Update(coaLocal.RefNo, coaLocal));

                    context.SaveChanges();
                }
                return(new PostResponse
                {
                    NoOfRecordEffected = 10,
                    Status = ResponseStatus.Ok.ToString()
                });
            }
            //Storage.COAControl
        }
Beispiel #3
0
        public override async Task <PostResponse> AsyncSetter(string token)
        {
            using (var context = new Storage.TMSEntities())
            {
                var branches = context.Branches.ToList();
                foreach (var local in branches)
                {
                    await(string.IsNullOrEmpty(local.RefNo) ?
                          Create(local) :
                          Update(local.RefNo, local));

                    context.SaveChanges();
                }
                return(new PostResponse
                {
                    NoOfRecordEffected = 10,
                    Status = ResponseStatus.Ok.ToString()
                });
            }
            //Storage.Branch
        }