public static int AccountDetails1(Login login, int Data, int checkValue)            //entity framework function
        {
            int result = 0;

            using (DBBankingSystemEntities model = new DBBankingSystemEntities())
            {
                CustomerDetail data1 = model.CustomerDetails.FirstOrDefault(r => r.Name == login.Name);
                if (checkValue == 3)
                {
                    if ((data1.Balance + Data) <= 8500)
                    {
                        data1.Balance = data1.Balance + Data;
                    }
                    model.SaveChanges();
                }
                if (checkValue == 4)
                {
                    if ((data1.Balance - Data) > 1000 && data1.AccountType == "Saving Account")
                    {
                        data1.Balance = data1.Balance - Data;
                    }
                    else if ((data1.Balance - Data) >= 0 && data1.AccountType == "Current Account")
                    {
                        data1.Balance = data1.Balance - Data;
                    }
                    else if ((data1.Balance - Data) >= -10000 && data1.AccountType == "DMAT Account")
                    {
                        data1.Balance = data1.Balance - Data;
                    }
                    else
                    {
                        data1.Balance           = data1.Balance;
                        Console.ForegroundColor = ConsoleColor.DarkRed;
                        Console.WriteLine("--------------------------------------------------");
                        Console.WriteLine("Sorry, we are not able to process your Transaction");
                        Console.WriteLine("--------------------------------------------------");
                        Console.ForegroundColor = ConsoleColor.White;
                    }
                    model.SaveChanges();
                }

                result = data1.Balance;
            }
            return(result);
        }
        public static int Calculted_Interest(Login login, int choice, int value)    //entity framework function
        {
            int balance  = 0;
            int interest = 0;

            using (DBBankingSystemEntities model = new DBBankingSystemEntities())
            {
                CustomerDetail data1 = model.CustomerDetails.FirstOrDefault(r => r.Name == login.Name);
                interest = data1.Balance;

                if (value == 1)
                {
                    balance = (4 * interest) / 100;
                }
                if (value == 2)
                {
                    balance = (1 * interest) / 100;
                }
            }
            return(balance);
        }
        public static int LoginData2(Login login)              //entity framework function
        {
            int flag = 0;

            if (flag == 0)
            {
                using (DBBankingSystemEntities model = new DBBankingSystemEntities())
                {
                    CustomerDetail data1 = model.CustomerDetails.FirstOrDefault(r => r.Name == login.Name);
                    int            ID    = data1.AccountID;


                    if (data1.Name == login.Name && data1.Password == login.password)
                    {
                        Console.ForegroundColor = ConsoleColor.Green;
                        Console.WriteLine("You are logging in....");
                        Console.WriteLine("-----------------------------------------------------------");
                        Console.WriteLine("Name: " + data1.Name + "   Your ID is: " + ID);
                        Console.WriteLine("Password: "******"-----------------------------------------------------------");
                        Console.ForegroundColor = ConsoleColor.White;
                        flag = 1;
                    }
                }
            }
            if (flag == 1)
            {
                return(1);
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Invalid");
                Console.ForegroundColor = ConsoleColor.White;
                return(0);
            }
        }