コード例 #1
0
        public RetentionDetails LoadRetentionDetails(int retentionId)
        {
            RetentionDetails retentionDetails = null;
            ChargeCollection charges          = LoadCharges(retentionId);

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader reader = SqlHelper.ExecuteReader(connection,
                                                                      "stGetRetentionDetails",
                                                                      CreateRetentionIdParameter(retentionId)))
                {
                    CleverReader cleverReader = new CleverReader(reader);
                    if (cleverReader.Read())
                    {
                        RetentionInfo               retentionInfo               = new RetentionInfoBuilder(cleverReader).Build();
                        RetentionDeductable         retentionDeductable         = new RetentionDeductableBuilder(cleverReader).Build();
                        TransactionsAfterEndOfMonth transactionsAfterEndOfMonth = new TransactionsAfterEndOfMonthBuilder(cleverReader).Build();
                        RetentionSummary            retentionSummary            = new RetentionSummaryBuilder(cleverReader).Build();
                        OverdueFee overdueFee = new OverdueFeeBuidler(cleverReader).Build();

                        retentionDetails = new RetentionDetailsBuilder(cleverReader).Build(retentionInfo,
                                                                                           retentionDeductable,
                                                                                           transactionsAfterEndOfMonth,
                                                                                           retentionSummary,
                                                                                           charges,
                                                                                           overdueFee);
                    }
                }
            }
            return(retentionDetails);
        }
コード例 #2
0
ファイル: ChargeViewModel.cs プロジェクト: ybailm/JXC
        public ChargeViewModel()
        {
            GridVisibility = Visibility.Collapsed;

            ChargeCollection = Common.Instance.GetAllCharge();

            DisplayChargeCollection = ChargeCollection;

            UnitList      = ChargeCollection.Select(p => p.Unit).Distinct().ToList();
            CategoryList  = ChargeCollection.Select(p => p.Category).Distinct().ToList();
            AttendantList = ChargeCollection.Select(p => p.AttendantName).Distinct().ToList();

            GridCollapseCommand = new DelegateCommand(GridCollapse);

            NewChargeCommand        = new DelegateCommand(NewCharge);
            EditChargeItemCommand   = new DelegateCommand <Charge>(EditCharge);
            SaveChargeCommand       = new DelegateCommand <Charge>(SaveCharge);
            ChargeNameSearchCommand = new DelegateCommand <string>(ChargeNameSearch);
            CategorySearchCommand   = new DelegateCommand <string>(CategorySearch);

            ChargeNameChangedCommand         = new DelegateCommand <string>(ChargeNameChanged);
            CategorySelectionChangedCommand  = new DelegateCommand <string>(CategorySelectionChanged);
            UnitSelectionChangedCommand      = new DelegateCommand <string>(UnitSelectionChanged);
            AttendantSelectionChangedCommand = new DelegateCommand <string>(AttendantSelectionChanged);

            DateReport();
            CategoryReport();
        }
コード例 #3
0
        public BatchScheduleFinanceInfo Build(DataTable batchTable, ChargeCollection charges)
        {
            BatchScheduleFinanceInfo batchScheduleFinanceInfo = null;
            var reader = new DataRowReader(batchTable.Rows);

            if (reader.Read())
            {
                batchScheduleFinanceInfo = new BatchScheduleFinanceInfo(
                    reader.ToDecimal("FacInv"),
                    reader.ToDecimal("NFInv"),
                    reader.ToDecimal("Admin"),
                    reader.ToDecimal("AdminGST"),
                    reader.ToDecimal("FactorFee"),
                    reader.ToDecimal("Retention"),
                    reader.ToDecimal("Repurchase"),
                    reader.ToDecimal("Credit"),
                    reader.ToDecimal("Post"),
                    reader.ToDecimal("PostGST"),
                    reader.ToDecimal("CheckConfirm"),
                    reader.ToDecimal("TotalInv"), charges,
                    reader.ToInteger("FacilityType"),
                    reader.ToDecimal("NonCompliantFee"),
                    reader.ToDecimal("RetnPercent"));
            }
            return(batchScheduleFinanceInfo);
        }
コード例 #4
0
        public void LoadBatchScheduleFor(int clientId, int batchId)
        {
            ChargeCollection charges       = repository.LoadBatchCharges(batchId);
            BatchSchedule    batchSchedule = repository.LoadBatchScheduleFor(clientId, batchId, charges);

            if (batchSchedule != null)
            {
                batchSchedule.Display(view);
            }
        }
コード例 #5
0
        public void LoadBatchChargesFor(int batchId)
        {
            IList <Charge>   chargeList = new List <Charge>();
            ChargeCollection charges    = repository.LoadBatchCharges(batchId);

            if (charges != null)
            {
                chargeList = charges.GetList();
            }

            view.DisplayBatchCharges(chargeList);
        }
コード例 #6
0
        public BatchSchedule LoadBatchScheduleFor(int clientId, int batchId, ChargeCollection charges)
        {
            DataSet             ds     = batches.LoadBatches(Action, -1, batchId.ToString(), DateTime.Today, DateTime.Today, ref clientId, 7);
            DataTableCollection tables = (ds == null)?null:ds.Tables;

            if (tables == null)
            {
                return(null);
            }

            BatchScheduleFinanceInfo scheduleFinanceInfo = new BatchScheduleFinanceInfoBuilder().Build(tables["Batches"], charges);
            ClientAttribute          clientAttribute     = new ClientAttributeBuilder().Build(tables["Batches2"]);

            return(new ScheduleBuilder().Build(tables["Batches"], scheduleFinanceInfo, clientAttribute));
        }
コード例 #7
0
        public void LoadCharges(RetentionSchedule retentionSchedule)
        {
            IList <Charge> chargeList = new List <Charge>();

            if (retentionSchedule != null)
            {
                ChargeCollection charges = repository.LoadCharges(retentionSchedule.Id);
                if (charges != null)
                {
                    chargeList = charges.GetList();
                }
            }

            view.DisplayCharges(chargeList);
        }
コード例 #8
0
        public ChargeCollection LoadBatchCharges(int batchId)
        {
            ChargeCollection charges = new ChargeCollection();

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader reader = SqlHelper.ExecuteReader(connection,
                                                                      "stGetBatchCharges",
                                                                      CreateBatchIdParameter(batchId)))
                {
                    CleverReader cleverReader = new CleverReader(reader);
                    while (cleverReader.Read())
                    {
                        charges.Add(new BatchChargeBuilder(cleverReader).Build());
                    }
                }
            }
            return(charges);
        }
コード例 #9
0
 public RetentionDetails Build(RetentionInfo retentionInfo, RetentionDeductable retentionDeductable,
                               TransactionsAfterEndOfMonth transactionsAfterEndOfMonth,
                               RetentionSummary retentionSummary, ChargeCollection charges, OverdueFee overdueFee)
 {
     return(new RetentionDetails(reader.FromBigInteger("RetnID"),
                                 reader.ToNullableDate("Released"),
                                 reader.ToDate("eom"),
                                 reader.ToDecimal("nfinvs"),
                                 reader.ToDecimal("facinvs"),
                                 retentionInfo,
                                 retentionDeductable,
                                 reader.ToDecimal("nfrec"),
                                 transactionsAfterEndOfMonth,
                                 retentionSummary,
                                 charges,
                                 overdueFee,
                                 reader.ToString("status"),
                                 reader.ToSmallInteger("hold"),
                                 reader.ToSmallInteger("clientFacilityType")));
 }