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); }
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(); }
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); }
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); } }
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); }
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)); }
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); }
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); }
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"))); }