static public CollectTotal Parse(int collectTotalId) { DataRow row = CollectData.GetCollectTotal(collectTotalId); CollectTotal collect = new CollectTotal(); collect.Id = collectTotalId; collect.OrganizationId = (int) row["OrganizationId"]; collect.Organization = (string) row["Organization"]; collect.CollectorId = (int) row["CollectorId"]; collect.Collector = (string) row["Collector"]; collect.CashierId = (int) row["CashierId"]; //collect.Cashier = CashRegister.Parse(collect.CashierId); collect.CollectDate = (DateTime) row["CollectDate"]; collect.Notes = (string) row["Notes"]; collect.CashTotal = (decimal) row["CashTotal"]; collect.ChecksTotal = (decimal) row["ChecksTotal"]; collect.PrePaidCardTotal = (decimal) row["PrePaidCardTotal"]; collect.EPaymentTotal = (decimal) row["EPaymentTotal"]; collect.BankDepositTotal = (decimal) row["BankDepositTotal"]; collect.CreditsRewardsTotal = (decimal) row["CreditsRewardsTotal"]; collect.PostingTime = DateTime.Today; collect.PostedById = 0; collect.status = (string) row["CollectTotalStatus"]; collect.collectTotalItemsTable = CollectData.GetCollectTotalItems(collectTotalId); collect.collectTotalByInstrument = CollectData.GetCollectTotalByInstrument(collectTotalId); return collect; }
public void Delete(CollectTotal collectTotal) { using (DataWriterContext context = DataWriter.CreateContext("OnDeleteFSMTransaction")) { if (collectTotal.Status == "P") { context.Add(AccountTransactionData.CancelAccountTransaction(this, Empiria.ExecutionServer.CurrentUserId, DateTime.Now)); if (this.FinancialConcept.Id == 722) { CRTransaction crTransaction = CRTransaction.Parse(this.CRTransactionId); crTransaction.Delete(); //OOJJOO } context.Update(); this.Status = "X"; } } FinancialAccountData.UpdateAccountsTable(this.Account.Id); }