private static object[] TakeInsert(CAPaymentEntity cAPaymentEntity) { return(new object[] { "@RefId", cAPaymentEntity.RefId, "@RefType", cAPaymentEntity.RefType, "@RefDate", cAPaymentEntity.RefDate, "@PostedDate", cAPaymentEntity.PostedDate, "@RefNo", cAPaymentEntity.RefNo, "@CurrencyCode", cAPaymentEntity.CurrencyCode, "@ExchangeRate", cAPaymentEntity.ExchangeRate, "@ParalellRefNo", cAPaymentEntity.ParalellRefNo, "@IncrementRefNo", cAPaymentEntity.IncrementRefNo, "@InwardRefNo", cAPaymentEntity.InwardRefNo, "@AccountingObjectId", cAPaymentEntity.AccountingObjectId, "@JournalMemo", cAPaymentEntity.JournalMemo, "@DocumentIncluded", cAPaymentEntity.DocumentIncluded, "@BankId", cAPaymentEntity.BankId, "@TotalAmount", cAPaymentEntity.TotalAmount, "@TotalAmountOC", cAPaymentEntity.TotalAmountOC, "@TotalTaxAmount", cAPaymentEntity.TotalTaxAmount, "@TotalFreightAmount", cAPaymentEntity.TotalFreightAmount, "@TotalInwardAmount", cAPaymentEntity.TotalInwardAmount, "@Posted", cAPaymentEntity.Posted, "@RefOrder", cAPaymentEntity.RefOrder, "@RelationRefId", cAPaymentEntity.RelationRefId, "@TotalPaymentAmount", cAPaymentEntity.TotalPaymentAmount, "@Receiver", cAPaymentEntity.Receiver, "@Address", cAPaymentEntity.Address }); }
public string DeleteCAPayment(CAPaymentEntity caPayment) { const string procedures = @"uspDelete_CAPayment"; object[] parms = { "@RefId", caPayment.RefId }; return(Db.Delete(procedures, true, parms)); }
public List <CAPaymentEntity> GetCAPaymentLists(string connectionString) { List <CAPaymentEntity> buentity = new List <CAPaymentEntity>(); using (var context = new MISAEntity(connectionString)) { var querry = context.CAPaymentDetails.ToList(); var projects = context.Projects.ToList(); var currencys = context.CCies.ToList(); var budgetsource = context.BudgetSources.ToList(); var listitems = context.ListItems.ToList(); var funds = context.Funds.ToList(); var fundstructures = context.FundStructures.ToList(); var budgetproviders = context.BudgetProvidences.ToList(); var accountingobject = context.AccountingObjects.ToList(); var projectexpenses = context.ProjectExpenses.ToList(); var activity = context.Activities.ToList(); var tasks = context.Tasks.ToList(); var stocks = context.Stocks.ToList(); //var topics = context.Topics.ToList(); var fixedassets = context.FixedAssets.ToList(); var departments = context.Departments.ToList(); var purchasepurposes = context.PurchasePurposes.ToList(); var inventoryitems = context.InventoryItems.ToList(); banks = context.BankInfoes.ToList(); var detailfixedassets = context.CAPaymentDetailFixedAssets.ToList(); var detailparallels = context.CAPaymentDetailParallels.ToList(); var detailpurchases = context.CAPaymentDetailPurchases.ToList(); var detailtax = context.CAPaymentDetailTaxes.ToList(); var resultcontext = context.CAPayments.ToList(); foreach (var result in resultcontext) { var newresult = new CAPaymentEntity(); newresult.RefId = result.RefID.ToString(); newresult.RefType = ConvRefType.ConvRefType(result.RefType); newresult.RefDate = result.RefDate; newresult.PostedDate = result.PostedDate; newresult.RefNo = result.RefNo; newresult.ExchangeRate = result.ExchangeRate ?? 0; newresult.ParalellRefNo = result.ParalellRefNo; newresult.IncrementRefNo = result.IncrementRefNo; newresult.InwardRefNo = result.InwardRefNo; newresult.AccountingObjectId = result.AccountingObject == null ? null : result.AccountingObject.AccountingObjectID.ToString(); newresult.JournalMemo = result.JournalMemo; newresult.DocumentIncluded = result.DocumentIncluded; newresult.BankId = result.BankAccount == null ? null : banks.FirstOrDefault(x => x.BankAccount == result.BankAccount).BankInfoID.ToString(); newresult.TotalAmount = result.TotalAmount; newresult.TotalAmountOC = result.TotalAmountOC; newresult.TotalTaxAmount = result.TotalTaxAmount; newresult.TotalFreightAmount = result.TotalFreightAmount; newresult.TotalInwardAmount = result.TotalInwardAmount; newresult.Posted = result.Posted; newresult.RefOrder = result.RefOrder ?? 0; newresult.RelationRefId = result.RelationRefID.ToString(); newresult.TotalPaymentAmount = result.TotalPaymentAmount; newresult.CurrencyCode = result.CCY == null ? null : result.CCY.CurrencyID; newresult.CaPaymentDetails = CAPaymentDetails(result.CAPaymentDetails.ToList(), result.RefID.ToString()); newresult.CAPaymentDetailFixedAssets = result.CAPaymentDetailFixedAssets.Count <= 0 ? null : CAPaymentDetailFixedAssets(result.CAPaymentDetailFixedAssets.ToList(), result.RefID.ToString()); newresult.CAPaymentDetailParallels = result.CAPaymentDetailParallels.Count <= 0 ? null : CAPaymentDetailParallels(result.CAPaymentDetailParallels.ToList(), result.RefID.ToString()); newresult.CAPaymentDetailPurchases = result.CAPaymentDetailPurchases.Count <= 0 ? null : CAPaymentDetailPurchases(result.CAPaymentDetailPurchases.ToList(), result.RefID.ToString()); newresult.CaPaymentDetailTaxes = result.CAPaymentDetailTaxes.Count <= 0 ? null : CAPaymentDetailTaxes(result.CAPaymentDetailTaxes.ToList(), result.RefID.ToString()); buentity.Add(newresult); } } return(buentity); }
public string UpdateCAPayment(CAPaymentEntity caPayment) { const string procedures = @"uspUpdate_CAPayment"; return(Db.Update(procedures, true, TakeInsert(caPayment))); }
public string InsertCAPayment(CAPaymentEntity caPayment) { const string procedures = @"uspInsert_CAPayment"; return(Db.Insert(procedures, true, TakeInsert(caPayment))); }