private ContraEntryWithDrawlTransactionsDto GetAccountHeadClosingBalnces() { ContraEntryWithDrawlTransactionsDto objcontraEntryWithDrawlTransactionsDto = new ContraEntryWithDrawlTransactionsDto(); objcontraEntryWithDrawlTransactionsDto = _ContraEntryService.GetAccountHeadClosingBalnces(); return(objcontraEntryWithDrawlTransactionsDto); }
private ContraEntryWithDrawlDto ReadFormDataWithDrawl(FormCollection form) { ContraEntryWithDrawlDto contraEntryWithDrawlDto = new ContraEntryWithDrawlDto(); contraEntryWithDrawlDto.AccountMasterID = Convert.ToInt32(form["hdnAccountMasterID"]); contraEntryWithDrawlDto.EmployeeID = UserInfo.UserID; DateTime transactionDate = form["TransactionDate"].ConvertToDateTime(); DateTime chequeDate = form["ChequeDate"].ConvertToDateTime(); contraEntryWithDrawlDto.TransactionDate = transactionDate; contraEntryWithDrawlDto.VoucherNumber = Convert.ToString(form["hdnVoucherNumber"]); contraEntryWithDrawlDto.VoucherRefNumber = Convert.ToString(form["VoucherRefNumber"]); contraEntryWithDrawlDto.PartyName = Convert.ToString(form["PartyName"]); contraEntryWithDrawlDto.TransactionMode = "C"; contraEntryWithDrawlDto.AHID = Convert.ToInt32(form["hdnCashInHandAHID"]); contraEntryWithDrawlDto.EmployeeID = UserInfo.UserID; contraEntryWithDrawlDto.TransactionType = Convert.ToInt32(form["TransactionType"]); contraEntryWithDrawlDto.Amount = Convert.ToInt32(form["TotalAmmount"]); contraEntryWithDrawlDto.ChequeNumber = Convert.ToString(form["ChequeNumber"]); contraEntryWithDrawlDto.ChequeDate = chequeDate; contraEntryWithDrawlDto.Narration = Convert.ToString(form["Narration"]); contraEntryWithDrawlDto.UserID = UserInfo.UserID; contraEntryWithDrawlDto.GroupID = GroupInfo.GroupID; int maxIndex = Convert.ToInt32(form["hdnMaxRateIndex"]); contraEntryWithDrawlDto.contraEntryWithDrawlTransactions = new List <ContraEntryWithDrawlTransactionsDto>(); ContraEntryWithDrawlTransactionsDto contraEntrywithdrawltransactions = null; for (int i = 1; i <= maxIndex; i++) { contraEntrywithdrawltransactions = new ContraEntryWithDrawlTransactionsDto(); contraEntrywithdrawltransactions.AHID = Convert.ToInt32(form["hdnAHID_" + i]);; contraEntrywithdrawltransactions.CrAmount = Convert.ToDecimal(form["hdnDrAmount_" + i]); contraEntrywithdrawltransactions.DrAmount = Convert.ToDecimal(form["hdnCrAmount_" + i]); contraEntryWithDrawlDto.contraEntryWithDrawlTransactions.Add(contraEntrywithdrawltransactions); } contraEntrywithdrawltransactions = new ContraEntryWithDrawlTransactionsDto(); contraEntrywithdrawltransactions.AHID = Convert.ToInt32(form["hdnCashInHandAHID"]); //Convert.ToInt32(form["AHID"]); contraEntrywithdrawltransactions.CrAmount = 0; contraEntrywithdrawltransactions.DrAmount = contraEntryWithDrawlDto.contraEntryWithDrawlTransactions.Sum(s => s.CrAmount); contraEntrywithdrawltransactions.IsMaster = true; contraEntryWithDrawlDto.contraEntryWithDrawlTransactions.Add(contraEntrywithdrawltransactions); return(contraEntryWithDrawlDto); }
public ContraEntryWithDrawlDto GroupContraEntryWithDrawlGetByAccountMasterId(long AccountMasterId) { long accountmasterID = Convert.ToInt64(AccountMasterId); ObjectParameter prmAccountMasterId = new ObjectParameter("AccountMasterId", accountmasterID); var results = new MFISDBContext() .MultipleResults(CustomProcNames.uspGroupContraEntryWithDrawlByAccountMasterID, prmAccountMasterId) .With <ContraEntryWithDrawlDto>() .With <ContraEntryWithDrawlTransactionsDto>() .Execute(); var contraEntryWithDrawlDto = (results[0] as List <ContraEntryWithDrawlDto>)[0]; var contraEntryWithDrawlTransactionsList = results[1] as List <ContraEntryWithDrawlTransactionsDto>; List <ContraEntryWithDrawlTransactionsDto> finalcontraEntryWithDrawlTransactions = new List <ContraEntryWithDrawlTransactionsDto>(); ContraEntryWithDrawlTransactionsDto singleContraEntryWithDrawlTransactionsDto = null; foreach (var contraEntryWithDrawlTransactions in contraEntryWithDrawlTransactionsList) { singleContraEntryWithDrawlTransactionsDto = new ContraEntryWithDrawlTransactionsDto(); singleContraEntryWithDrawlTransactionsDto.BankAccount = contraEntryWithDrawlTransactions.BankAccount; singleContraEntryWithDrawlTransactionsDto.BankAccountName = contraEntryWithDrawlTransactions.BankAccountName; singleContraEntryWithDrawlTransactionsDto.AccountTranID = contraEntryWithDrawlTransactions.AccountTranID; singleContraEntryWithDrawlTransactionsDto.AHCode = contraEntryWithDrawlTransactions.AHCode; singleContraEntryWithDrawlTransactionsDto.AHID = contraEntryWithDrawlTransactions.AHID; singleContraEntryWithDrawlTransactionsDto.AHName = contraEntryWithDrawlTransactions.AHName; singleContraEntryWithDrawlTransactionsDto.AmountId = contraEntryWithDrawlTransactions.AmountId; singleContraEntryWithDrawlTransactionsDto.ClosingBalance = contraEntryWithDrawlTransactions.ClosingBalance; singleContraEntryWithDrawlTransactionsDto.CrAmount = contraEntryWithDrawlTransactions.CrAmount; singleContraEntryWithDrawlTransactionsDto.DrAmount = contraEntryWithDrawlTransactions.DrAmount; singleContraEntryWithDrawlTransactionsDto.Type = contraEntryWithDrawlTransactions.Type; singleContraEntryWithDrawlTransactionsDto.Narration = contraEntryWithDrawlTransactions.Narration; finalcontraEntryWithDrawlTransactions.Add(singleContraEntryWithDrawlTransactionsDto); } contraEntryWithDrawlDto.contraEntryWithDrawlTransactions = finalcontraEntryWithDrawlTransactions; return(contraEntryWithDrawlDto); }