public ActionResult CustomerReport() { var data = _customerreportORM.GetList("exec prc_CariTakipRaporu").ToList(); List <CustomerReportModel> list = new List <CustomerReportModel>(); foreach (var item in data) { CustomerReportModel model = new CustomerReportModel(); model.AsistanBasTar = item.AsistanBasTar; model.AsistanIsmi = item.AsistanIsmi; model.BilBakımveDestek = item.BilBakımveDestek; model.CariKod = item.CariKod; model.CariUnvan = item.CariUnvan; model.eImza = item.eImza; model.GrupAdı = item.GrupAdı; model.Kep = item.Kep; model.KonturBasTar = item.KonturBasTar; model.MikroEgDes = item.MikroEgDes; model.MikroUzakBagTelDes = item.MikroUzakBagTelDes; model.SözBas = item.SözBas; model.SözBit = item.SözBit; model.VergiDairesiNo = item.VergiDairesiNo; model.YedeklemeSistemi = item.YedeklemeSistemi; model.Yorum1 = item.Yorum1; model.Yorum2 = item.Yorum2; list.Add(model); } return(View(list)); }
public async Task <List <CustomerReportsDto> > GetCustomerReportAsync(CustomerReportModel model) { List <CustomerReportsDto> customerReportsDtoList; if (model.CustomerId == 0) { customerReportsDtoList = await(from c in _dataContext.Customers select new CustomerReportsDto { CustomerId = c.Id, CustomerName = c.FirstName + " " + c.MiddleName + " " + c.LastName, /*IncomeAmount = model.IncomeAmount, * PaidAmount = model.PaidAmount*/ }).ToListAsync(); } else { customerReportsDtoList = await(from c in _dataContext.Customers where c.Id == model.CustomerId select new CustomerReportsDto { CustomerId = c.Id, CustomerName = c.FirstName + " " + c.MiddleName + " " + c.LastName, /* IncomeAmount = model.IncomeAmount, * PaidAmount = model.PaidAmount*/ }).ToListAsync(); } foreach (var invoice in customerReportsDtoList) { List <InvoiceListItemDto> invoiceListItemDtosList = await(from v in _dataContext.Invoices where v.CustomerId == invoice.CustomerId && v.Status != Constants.InvoiceStatus.Deleted select new InvoiceListItemDto { TotalAmount = v.TotalAmount, Status = v.Status, InvoiceDate = v.InvoiceDate }).ToListAsync(); invoiceListItemDtosList = invoiceListItemDtosList.Where(p => (p.InvoiceDate >= model.StartDate && p.InvoiceDate <= model.EndDate)).ToList(); invoice.IncomeAmount = invoiceListItemDtosList.Sum(x => x.TotalAmount); invoice.PaidAmount = invoiceListItemDtosList.Where(x => x.Status == Constants.InvoiceStatus.Paid).Sum(x => x.TotalAmount); } return(customerReportsDtoList); }
public void PopulateCustomerInfo(Customer customer, CustomerReportModel reportModel) { reportModel.CustomerName = customer.Name; var addressLines = new string[5]; addressLines[0] = customer.Address1.Trim(); addressLines[1] = customer.Address2.Trim(); addressLines[2] = customer.Address3.Trim(); addressLines[3] = customer.Address4.Trim(); addressLines[4] = customer.Address5.Trim(); var i = 0; while (i < addressLines.Length - 1 && String.IsNullOrEmpty(addressLines[i])) { i++; } reportModel.CustomerAddress1 = i < addressLines.Length ? addressLines[i++] : String.Empty; while (i < addressLines.Length - 1 && String.IsNullOrEmpty(addressLines[i])) { i++; } reportModel.CustomerAddress2 = i < addressLines.Length ? addressLines[i++] : String.Empty; while (i < addressLines.Length - 1 && String.IsNullOrEmpty(addressLines[i])) { i++; } reportModel.CustomerAddress3 = i < addressLines.Length ? addressLines[i++] : String.Empty; while (i < addressLines.Length - 1 && String.IsNullOrEmpty(addressLines[i])) { i++; } reportModel.CustomerAddress4 = i < addressLines.Length ? addressLines[i++] : String.Empty; while (i < addressLines.Length - 1 && String.IsNullOrEmpty(addressLines[i])) { i++; } reportModel.CustomerAddress5 = i < addressLines.Length ? addressLines[i++] : String.Empty; }
public async Task <CustomerDetailsReportDto> GetCustomerReportAsync(CustomerReportModel model) { var pageResult = await _reportManager.GetCustomerReportAsync(model); return(pageResult); }
private void Page_Loaded(object sender, RoutedEventArgs e) { customer = new CustomerModel(); bill = new CustomerReportModel(); POS_Customer(); }