ATM-Banking-System/Controllers/CustomerController.cs

63 lines
1.6 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.AspNetCore.Mvc;
using ATM_Banking_System.Models;
using ATM_Banking_System.Services;
namespace ATM_Banking_System.Controllers
{
public class CustomerController : Controller
{
private readonly CustomerService _customerService;
public CustomerController(CustomerService customerService)
{
_customerService = customerService;
}
public IActionResult CreateCustomer()
{
// CreateCustomer sayfasını görüntüle
return View();
}
[HttpPost]
public IActionResult CreateCustomer(Customer customer)
{
// Yeni müşteriyi oluştur
_customerService.CreateCustomer(customer);
// Ana sayfaya yönlendir
return RedirectToAction("Index", "Home");
}
public IActionResult ViewCustomer()
{
// ViewCustomer sayfasını görüntüle
return View();
}
public IActionResult AddAccountDetails()
{
// AddAccountDetails sayfasını görüntüle
return View();
}
public IActionResult TransactionDetails()
{
// TransactionDetails sayfasını görüntüle
return View();
}
public IActionResult Details(int id)
{
// Müşteri detaylarını getir
var customer = _customerService.GetCustomerById(id);
if (customer == null)
{
return NotFound();
}
return View(customer);
}
}
}