public async Task <bool> AddBank(BankView banks) { string test = banks.kdbank.ToUpper(); var cekFirst = _context.Banks.Where(x => x.KodeBank == test).ToList(); if (cekFirst.Count == 0) { CbBank Bank = new CbBank() { KodeBank = banks.kdbank.ToUpper(), NmBank = banks.namabank, Kurs = banks.kurs, Acctset = banks.Acctset, ClrDate = banks.ClrDate, SldAWal = banks.SldAWal, KSldAwal = banks.KSldAwal, Saldo = banks.SldAWal, KSaldo = banks.KSldAwal, Status = banks.Status }; _context.Banks.Add(Bank); await _context.SaveChangesAsync(); return(true); } else { return(false); } }
public async Task <bool> EditBank(BankView banks) { try { var ExistingBank = _context.Banks.Where(x => x.CbBankId == banks.bankId).FirstOrDefault(); if (ExistingBank != null) { ExistingBank.NmBank = banks.namabank; ExistingBank.Kurs = banks.kurs; ExistingBank.Acctset = banks.Acctset; ExistingBank.ClrDate = banks.ClrDate; ExistingBank.SldAWal = banks.SldAWal; ExistingBank.KSldAwal = banks.KSldAwal; ExistingBank.Saldo = banks.SldAWal; ExistingBank.KSaldo = banks.KSldAwal; ExistingBank.Status = banks.Status; ExistingBank.Kurs = banks.kurs; _context.Banks.Update(ExistingBank); await _context.SaveChangesAsync(); return(true); } } catch (Exception ex) { throw ex; } return(false); }
static void Main(string[] args) { try { Console.WriteLine("BankApp v1.1"); BankView bankView = new BankView(); //bankView.DeleteBank(); //bankView.CreateBankCustomerAccount(); //AccountView accountView = new AccountView(); //accountView.AddTransaction(); bankView.PrintAllBanks(); //AccountRepository accountRepository = new AccountRepository(); ////var account = accountRepository.GetAccountByIban("FI44 1234"); //Transaction transaction = new Transaction //{ // Iban= "FI44 1234", // Amount = -500, // TimeStamp = DateTime.Today //}; //accountRepository.AddTransaction(transaction); } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.ReadLine(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); IBankModel model = new BankModel(); BankView view = new BankView(); BankPresenter presenter = new BankPresenter(model, view); Application.Run(view); }
public static BANK convertToModel(BankView bankView) { BANK bank = new BANK(); bank.BankID = bankView.BankId; bank.BankCode = bankView.BankCode; bank.BankName = bankView.BankName; bank.BankLink = bankView.URL; bank.DataExtractor = bankView.DataExtractor; return(bank); }
public static BankView convertToModelView(BANK bank) { BankView bankView = new BankView(); bankView.BankId = bank.BankID; bankView.BankCode = bank.BankCode; bankView.BankName = bank.BankName; bankView.URL = bank.BankLink; bankView.DataExtractor = bank.DataExtractor; return(bankView); }
static void Main(string[] args) { try { Console.WriteLine("Nice Bank App 1.02"); BankView bankView = new BankView(); bankView.PrintAllBanks(); } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.ReadLine(); }
public ActionResult Edit(int?bankPK) { if (bankPK != null) { IBanksRepository banksRepository = new BanksRepository(db); Bank bank = banksRepository.GetBankByPK((int)bankPK); BankView bankView = new BankView(); bankView.ConvertFrom(bank, bankView); return(View(bankView)); } else { return(RedirectToAction("Index", "Bank")); } }
private void BankMenu() { string choice = null; BankView bankView = new BankView(); string msg = ""; do { choice = UserInterface(); switch (choice.ToUpper()) { case "C": bankView.Create(); msg = "\n----------------------------> \nPress a key to continue!"; break; case "R": bankView.Read(); msg = "\n----------------------------> \nPress a key to continue!"; break; case "U": bankView.Update(); msg = "\n---------------------------->! \nPress a key to continue!"; break; case "D": bankView.Delete(); msg = "\n---------------------------->! \nPress a key to continue!"; break; case "X": msg = "\nChanging to main menu\nPress a key to continue"; break; default: msg = "Error occured - Press Enter and start over!"; break; } Console.WriteLine(msg); Console.ReadKey(); }while (choice.ToUpper() != "X"); }
public ActionResult Edit(BankView bankModel) { if (ModelState.IsValid) { IBanksRepository banksRepository = new BanksRepository(db); Bank bank = banksRepository.GetBankByPK((int)bankModel.BankPK); bankModel.ConvertTo(bankModel, bank); banksRepository.SaveChanges(); TempData["message"] = LayoutHelper.GetMessage("UPDATE", bank.BankPK); return(RedirectToAction("Index", "Bank")); } else { return(View(bankModel)); } }
public ActionResult Add(BankView bankView) { if (ModelState.IsValid) { IBanksRepository banksRepository = new BanksRepository(db); Bank bank = new Bank(); bankView.ConvertTo(bankView, bank); banksRepository.Add(bank); banksRepository.SaveChanges(); TempData["message"] = LayoutHelper.GetMessage("INSERT", bank.BankPK); return(RedirectToAction("Index", "Bank")); } else { return(View(bankView)); } }
static void BankView() { BankView bankView = new BankView(); bankView.PrintAllBanks(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ISeedData seedData) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseSignalR((cfg) => { cfg.MapHub <NotificationHub>("/notifications"); }); app.UseMvc(routes => routes.MapRoute( name: "WebAPI", template: "api/{controller}/{action}/{id?}" ) //.MapRoute( // name: "WebAPIForYear", // template: "api/foryear/{year:int}/{controller}/{action}/{id?}" //) ); seedData.SeedCompanyData(); seedData.SeedUserData(); //var tmp1 = UnitOfWork.ContoShemeOptions; //seedData.PopulateData(); // Create views BankView.CreateView(); BusinessPartnerBankView.CreateView(); BusinessPartnerByConstructionSiteView.CreateView(); BusinessPartnerInstitutionView.CreateView(); BusinessPartnerLocationView.CreateView(); BusinessPartnerDocumentView.CreateView(); BusinessPartnerNoteView.CreateView(); BusinessPartnerOrganizationUnitView.CreateView(); BusinessPartnerPhoneView.CreateView(); BusinessPartnerView.CreateView(); BusinessPartnerTypeView.CreateView(); //CompanyView.CreateView(); //??? //UserView.CreateView(); InputInvoiceView.CreateView(); InputInvoiceNoteView.CreateView(); InputInvoiceDocumentView.CreateView(); OutputInvoiceDocumentView.CreateView(); OutputInvoiceView.CreateView(); OutputInvoiceNoteView.CreateView(); CountryView.CreateView(); RegionView.CreateView(); MunicipalityView.CreateView(); CityView.CreateView(); ProfessionView.CreateView(); SectorView.CreateView(); AgencyView.CreateView(); TaxAdministrationView.CreateView(); ToDoView.CreateView(); EmployeeByBusinessPartnerView.CreateView(); EmployeeByConstructionSiteView.CreateView(); EmployeeCardView.CreateView(); EmployeeView.CreateView(); EmployeeDocumentView.CreateView(); EmployeeItemView.CreateView(); EmployeeLicenceView.CreateView(); EmployeeNoteView.CreateView(); EmployeeProfessionView.CreateView(); FamilyMemberView.CreateView(); LicenceTypeView.CreateView(); PhysicalPersonView.CreateView(); PhysicalPersonItemView.CreateView(); PhysicalPersonNoteView.CreateView(); PhysicalPersonLicenceView.CreateView(); PhysicalPersonDocumentView.CreateView(); PhysicalPersonCardView.CreateView(); PhysicalPersonProfessionView.CreateView(); ConstructionSiteCalculationView.CreateView(); ConstructionSiteDocumentView.CreateView(); ConstructionSiteNoteView.CreateView(); ConstructionSiteView.CreateView(); VatView.CreateView(); ServiceDeliveryView.CreateView(); DiscountView.CreateView(); StatusView.CreateView(); ShipmentView.CreateView(); ShipmentDocumentView.CreateView(); PhonebookView.CreateView(); PhonebookDocumentView.CreateView(); PhonebookNoteView.CreateView(); PhonebookPhoneView.CreateView(); InvoiceView.CreateView(); InvoiceItemView.CreateView(); CallCentarView.CreateView(); CalendarAssignmentView.CreateView(); EmployeeAttachmentView.CreateView(); PhysicalPersonAttachmentView.CreateView(); ToDoStatusView.CreateView(); var mailingTime = new Config().GetConfiguration()["MailTime"]; Console.WriteLine("Sending mails scheduled at: {0}\nCurrent time: {1}", mailingTime, DateTime.Now.ToString("HH:mm:ss")); Thread mailThread = new Thread(() => MailTask.SendMailTime(mailingTime)); mailThread.IsBackground = true; mailThread.Start(); }
public void deleteBankView(BankView bankView) { BANK bank = convertToModel(bankView); deleteBank(bank); }
public void editBankView(BankView bankView) { BANK bank = convertToModel(bankView); editBank(bank); }
void Awake() { instance = this; ShoeBankView(); // Hide(); }
static void Main(string[] args) { ConsoleKeyInfo cki; string message = string.Empty; BankView bankView = new BankView(); AccountView accountView = new AccountView(); Console.OutputEncoding = System.Text.Encoding.UTF8; do { cki = UserInterface(); switch (cki.Key) { case ConsoleKey.C: bankView.CreateBank(); message = "\n------------------------------------\nPaina Enter jatkaaksesi!"; break; case ConsoleKey.U: bankView.UpdateBank(); message = "\n-----------------------------------\nPaina Enter jatkaaksesi!"; break; case ConsoleKey.D: bankView.DeleteBank(8); message = "\n------------------------------------\nPaina Enter jatkaaksesi!"; break; case ConsoleKey.A: bankView.CreateCustomer(); message = "\n------------------------------------\nPaina Enter jatkaaksesi!"; break; case ConsoleKey.B: accountView.CreateAccount(); message = "\n------------------------------------\nPaina Enter jatkaaksesi!"; break; case ConsoleKey.E: bankView.PrintAccounts(_accountRepository.Read()); message = "\n------------------------------------\nPaina Enter jatkaaksesi!"; break; case ConsoleKey.F: bankView.PrintCustomers(_customerRepository.Read()); message = "\n------------------------------------\nPaina Enter jatkaaksesi!"; break; case ConsoleKey.G: bankView.UpdateCustomer(); message = "\n------------------------------------\nPaina Enter jatkaaksesi!"; break; case ConsoleKey.H: bankView.DeleteCustomer(14); message = "\n------------------------------------\nPaina Enter jatkaaksesi!"; break; case ConsoleKey.I: accountView.DeleteAccount("22113344556677"); message = "\n------------------------------------\nPaina Enter jatkaaksesi!"; break; case ConsoleKey.J: accountView.ReadbyId(1); message = "\n------------------------------------\nPaina Enter jatkaaksesi!"; break; case ConsoleKey.K: accountView.CreateTransaction(); message = "\n------------------------------------\nPaina Enter jatkaaksesi!"; break; case ConsoleKey.L: accountView.GetTransactionByIban("112233445566778"); message = "\n------------------------------------\nPaina Enter jatkaaksesi!"; break; case ConsoleKey.R: accountView.PrintAll(); message = "\n------------------------------------\nPaina Enter jatkaaksesi!"; break; case ConsoleKey.Escape: message = "\nOhjelman suoritus päättyy."; break; default: message = "Virhe - Paina Enter ja aloita alusta!"; break; } Console.WriteLine(message); Console.ReadLine(); Console.Clear(); } while (cki.Key != ConsoleKey.Escape); Console.WriteLine("Ohjelman suoritus päättyi!"); }
public void addBankView(BankView bankView) { BANK bank = convertToModel(bankView); addBank(bank); }
static void PrintAllBanks() // hakee kaikki tehtävän hae- tiedot // TOIMII Testattu { BankView bankView = new BankView(); bankView.PrintAllBanks(); }