public static void ManagerLogin()

        {
            Console.Clear();

            ManagerDetails CurrentUser = new ManagerDetails();

            Console.Write("Manager Email:");
            string email = Console.ReadLine();

            Console.Write("Manager Password:"******"There is not a manager with that email or passord :( ... \n Please Try again\n");
                Start();
                return;
            }

            CurrentUser.CurrentStore = storeRepos.Get(new StoreDetails("MizzaPizza", " Arlington, TX"));

            Console.Clear();
            Console.WriteLine("...Login SUCCESSFUL...\n");
            MDash(CurrentUser);
        }
        public static void ManagDash(ManagerDetails manag)
        {
            Console.WriteLine("Welcome {0} from {1}", manag.FirstName, manag.CurrentStore);
            Console.WriteLine("1. View your store orders");
            Console.WriteLine("2. Change your current store");
            Console.WriteLine("3.Or logout");
            Console.Write("Plese choose an option to continue");

            int input = ValidateUserInput();

            switch (input)
            {
            case 1:
                ViewStoreOrders(manag);
                break;

            case 2:
                ChangeCurrentStore(manag);
                break;

            case 3:
                Console.WriteLine("GoodBye {0}", manag.FirstName);
                Start();
                break;

            default:
                ManagDash(manag);
                break;
            }
        }
        public static void MDash(ManagerDetails man)
        {
            Console.WriteLine("Welcome {0} from {1}", man.FirstName, man.CurrentStore);
            Console.WriteLine("1. View store orders");
            Console.WriteLine("2. Change current store");
            Console.WriteLine("3. Logout");
            Console.Write("What would you like to do:");

            int input = UserInput();

            switch (input)
            {
            case 1:
                ViewStoreOrders(man);
                break;

            case 2:
                ChangeCurrentStore(man);
                break;

            case 3:
                Console.WriteLine("Okay, Good Bye {0}", man.FirstName);
                Start();
                break;

            default:
                MDash(man);
                break;
            }
        }
        public static void ManagerLogin()
        {
            Console.Clear();

            ManagerDetails CurrentUser = new ManagerDetails();

            Console.WriteLine("Enter Manager Email: ");
            string email = Console.ReadLine();

            Console.WriteLine("Enter Manager Password: "******"There is not a manager associated with this Email or Password. Please Try again ");
                Start();
                return;
            }

            // invoke currentStore from store repository to associate manager to their store.
            CurrentUser.CurrentStore = storeRepos.Read(new StoreDetails("MizzaPizza", "Lubbock, TX"));

            Console.Clear();
            Console.WriteLine("....Login Succesful");
            ManagDash(CurrentUser);
        }
        public void PropertyOnBaseClassThatIsOverriddenWithNewOnDerivedClass()
        {
            var source = new ManagerDetails(123, "abc");
            var clone  = BinarySerialisationCloner.Clone(new ManagerDetails(123, "abc"), _referenceReuseStrategy);

            Assert.IsType <ManagerDetails>(clone);
            Assert.Equal(123, clone.Id);
            Assert.Equal("abc", ((EmployeeDetails)clone).Name);
        }
        private ManagerDetails CreateManager()
        {
            ManagerDetails m = new ManagerDetails();

            m.FirstName = "Admin";
            m.Address   = "Arlington, TX";
            m.Email     = "*****@*****.**";
            m.Password  = "******";
            return(m);
        }
Exemple #7
0
        public ManagerDetails CreateManager()

        {
            ManagerDetails man = new ManagerDetails();

            man.FirstName = "Admin";
            man.Address   = "Arlington, TX";
            man.Email     = "*****@*****.**";
            man.Password  = "******";
            return(man);
        }
Exemple #8
0
        public ActionResult ManagerEdit(ManagerDetails manager)
        {
            var db    = new ManagerDbContext();
            var user  = db.Managers.Find(manager.ID);
            var entry = db.Entry(manager);

            if (ModelState.IsValid)
            {
                manager.RoleID = 2;

                entry.State = EntityState.Modified;
                db.Entry(user).Property("ConfirmPassword").IsModified = false;
                db.SaveChanges();
                return(RedirectToAction("Managers", "Admin"));
            }
            return(View(entry));
        }
        //--------------------------------------------------------------------
        // 14.  SELECT ManagerDetailsList
        //--------------------------------------------------------------------

        public List <ManagerDetails> ReturnManagerDetailsList()
        {
            List <ManagerDetails> allManagerDetails = new List <ManagerDetails>();
            ManagerDetails        oneManagerDetails = new ManagerDetails();
            SqlConnection         con = null;

            try
            {
                con = connect("DBConnectionString");
                String     selectSTR = "select * from FlightsUsers";
                SqlCommand cmd       = new SqlCommand(selectSTR, con);
                // get a reader
                SqlDataReader dr2 = cmd.ExecuteReader(CommandBehavior.CloseConnection); // CommandBehavior.CloseConnection: the connection will be closed after reading has reached the end
                if (dr2.HasRows)
                {
                    while (dr2.Read())
                    {   // Read till the end of the data into a row
                        oneManagerDetails.UserName  = (string)(dr2["UserName"]);
                        oneManagerDetails.Password  = (string)dr2["Password"];
                        oneManagerDetails.FirstName = (string)dr2["FirstName"];
                        oneManagerDetails.LastName  = (string)dr2["LastName"];

                        allManagerDetails.Add(oneManagerDetails);
                        oneManagerDetails = new ManagerDetails();
                    }
                }
                else
                {
                    Console.WriteLine("No rows found.");
                }
            }
            catch (Exception ex)
            {
                // write to log
                throw (ex);
            }
            finally
            {
                if (con != null)
                {
                    con.Close();
                }
            }
            return(allManagerDetails);
        }
        public ActionResult ManagerRegister(ManagerDetails admin)
        {
            if (ModelState.IsValid)
            {
                var context  = new ManagerDbContext();
                var isUnique = context.Managers.Where(n => n.ManagerID == admin.ManagerID);
                foreach (var i in isUnique)
                {
                    if (i.ManagerID == admin.ManagerID)
                    {
                        ViewData["Error"] = "ManagerID Already Exists";
                        return(View(admin));
                    }
                }
                admin.RoleID = 2;
                context.Managers.Add(admin);
                context.SaveChanges();

                TempData["Msaved"] = "Manager Registration Successfully!";
                return(RedirectToAction("ManagerLogin"));
            }
            return(View());
        }
 static void ChangeCurrentStore(ManagerDetails man)
 {
     man.CurrentStore = ChooseStore();
     MDash(man);
 }
 static void ViewStoreOrders(ManagerDetails man)
 {
     Console.Clear();
     man.CurrentStore.ViewStoreOrders();
     MDash(man);
 }
Exemple #13
0
        public List <ManagerDetails> Get()
        {
            ManagerDetails md = new ManagerDetails();

            return(md.getManagerDetails());
        }