private Ledger GetLedger(Record record, ref double previousBalance) { BankRecord bankRecord = GetBankRecord(record.ID); double newBalance = previousBalance + record.Debit - record.Credit; Ledger ledger = new Ledger { Credit = record.Credit, Debit = record.Debit, Date = record.Date, VoucherNo = record.VoucherType + "-" + record.VoucherSerialNo, Particular = bankRecord != null ? "Bank" : "Cash", ChequeNo = bankRecord != null ? bankRecord.ChequeNo : "", Remarks = record.Narration, Balance = newBalance }; previousBalance = newBalance; return ledger; }
/// <summary> /// Create a new Record object. /// </summary> /// <param name="id">Initial value of the ID property.</param> /// <param name="projectHeadID">Initial value of the ProjectHeadID property.</param> /// <param name="date">Initial value of the Date property.</param> /// <param name="voucherType">Initial value of the VoucherType property.</param> /// <param name="debit">Initial value of the Debit property.</param> /// <param name="credit">Initial value of the Credit property.</param> /// <param name="ledgerType">Initial value of the LedgerType property.</param> /// <param name="voucherSerialNo">Initial value of the VoucherSerialNo property.</param> /// <param name="isActive">Initial value of the IsActive property.</param> public static Record CreateRecord(global::System.Int32 id, global::System.Int32 projectHeadID, global::System.DateTime date, global::System.String voucherType, global::System.Double debit, global::System.Double credit, global::System.String ledgerType, global::System.Int32 voucherSerialNo, global::System.Boolean isActive) { Record record = new Record(); record.ID = id; record.ProjectHeadID = projectHeadID; record.Date = date; record.VoucherType = voucherType; record.Debit = debit; record.Credit = credit; record.LedgerType = ledgerType; record.VoucherSerialNo = voucherSerialNo; record.IsActive = isActive; return record; }
/// <summary> /// Deprecated Method for adding a new object to the Records EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToRecords(Record record) { base.AddObject("Records", record); }
private int InsertLedgerRecord(BLL.Model.Entity.Record record) { Record dalRecord = new Record { ProjectHeadID = GetProjectHeadId(record.ProjectName, record.HeadName), Date = record.Date, VoucherType = record.VoucherTypeKey, Debit = record.Debit, Credit = record.Credit, Narration = record.Narration, LedgerType = record.LedgerType, VoucherSerialNo = record.VoucherSerialNo, Link = record.LinkedVoucherNo, Tag = record.Tag, IsActive = true }; _db.AddToRecords(dalRecord); _db.SaveChanges(); return dalRecord.ID; }