public static void GetById() { Console.WriteLine("Enter bank id:"); var id = Convert.ToInt32(Console.ReadLine()); var _mapper = SetupMapper(); DalEF.Concrete.BankDalEf bankDal = new DalEF.Concrete.BankDalEf(_mapper); var bank = bankDal.GetBankById(id); Console.WriteLine("BankID \t" + "Name \t" + "Swift"); Console.WriteLine("{0} \t {1} \t {2}", bank.BankID, bank.Name, bank.Swift); }
public static void Update() { Console.WriteLine("Enter bank id:"); var id = Convert.ToInt32(Console.ReadLine()); var _mapper = SetupMapper(); DalEF.Concrete.BankDalEf bankDal = new DalEF.Concrete.BankDalEf(_mapper); var bank = bankDal.GetBankById(id); Console.WriteLine("Enter bank name:"); var name = Console.ReadLine(); bank.Name = (name != "") ? name : bank.Name; Console.WriteLine("Enter swift name:"); var swift = Console.ReadLine(); bank.Swift = (swift != "") ? swift : bank.Swift; bankDal.UpdateBank(bank); }