Exemplo n.º 1
0
        private void Next_Click(object sender, RoutedEventArgs e)
        {
            string   assetName, category, createdBy, notes;
            string   lastUpdatedBy;
            double   assetValue, assetQuantity;
            DateTime createdOn, lastUpdatedOn;
            int      ID;

            ID            = AssetCollection.GetAssetID(passedAssetName);
            assetName     = AssetName.Text;
            assetValue    = Convert.ToDouble(AssetValue.Text);
            assetQuantity = Convert.ToDouble(AssetQuantity.Text);
            category      = AssetCategory.Text;
            createdBy     = sessionUserAssetShow;
            createdOn     = DateTime.Now;
            lastUpdatedBy = sessionUserAssetShow;
            lastUpdatedOn = DateTime.Now;
            notes         = NotesTextBox.Text;

            //adds on to the back
            //so access with AssetCollection.last();
            //AssetCollection.AddAsset(ass, assValue, assQuant, cgory, cOn, cBy, notes);
            AssetCollection.ModifyAsset(ID, assetName, assetValue, assetQuantity,
                                        category, createdOn, createdBy, lastUpdatedOn, lastUpdatedBy, notes);

            MainMenu main = new MainMenu(sessionUserAssetShow);

            App.Current.MainWindow = main;
            this.Close();
            main.Show();
        }
Exemplo n.º 2
0
        public SelectAssetToView(string sessionUserMainMenu)
        {
            InitializeComponent();
            sessionUserSelectAssetToView = sessionUserMainMenu;

            List <Asset> ListOfAssets = new List <Asset>();

            ListOfAssets = AssetCollection.ReturnAList();

            this.AssetListSelect.ItemsSource = ListOfAssets;
        }
Exemplo n.º 3
0
 //constructor
 public Asset(string assetName, double assetValue, double assetQuantity, string category,
              DateTime createdOn, string createdBy, DateTime updatedOn, string updatedBy, string notes)
     : base(createdOn, createdBy, updatedOn, updatedBy, notes)
 {
     AssetID       = AssetCollection.SetAssetID();
     AssetName     = assetName;
     AssetValue    = assetValue;
     AssetQuantity = assetQuantity;
     Category      = category;
     TotalValue    = assetValue * assetQuantity;
 }
        public TransactionSelectAsset(string sessionUserMainMenu, string sentCustomer)
        {
            InitializeComponent();
            passedCustomer = sentCustomer;
            sessionUserSelectAssetToView = sessionUserMainMenu;

            List <Asset> ListOfAssets = new List <Asset>();

            ListOfAssets = AssetCollection.ReturnAList();

            this.AssetListSelect.ItemsSource = ListOfAssets;
        }
Exemplo n.º 5
0
        public AssetShow(string sessionUser, string sentUsername)
        {
            InitializeComponent();
            sessionUserAssetShow = sessionUser;
            passedAssetName      = sentUsername;

            AssetID.Content    = AssetCollection.GetAssetID(passedAssetName);
            AssetName.Text     = passedAssetName;
            AssetValue.Text    = AssetCollection.GetAssetValue(passedAssetName).ToString();
            AssetQuantity.Text = AssetCollection.GetAssetQuantity(passedAssetName).ToString();
            AssetCategory.Text = AssetCollection.GetAssetCategory(passedAssetName);
            NotesTextBox.Text  = AssetCollection.GetAssetNotes(passedAssetName);
        }
Exemplo n.º 6
0
        private void AssetListSelect_CellClick(object sender, SelectedCellsChangedEventArgs e)
        {
            string x = GetSelectedCellValue();

            TestLabel.Content = x;
            selectedAssetName = x;
            List <Asset> checkXList = new List <Asset>();

            checkXList = AssetCollection.ReturnAList();
            bool isThere = false;

            foreach (var element in checkXList)
            {
                if (element.AssetName == x)
                {
                    isThere = true;
                }
            }
            if (isThere == false)
            {
                MessageBox.Show("Please Select a AssetName before trying to click the Next button");
            }
        }
Exemplo n.º 7
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            Window1  wnd   = new Window1();
            DateTime value = new DateTime(2016, 11, 1, 5, 20, 00);

            //call for loading in users from database goes here.
            //below is a temporary test case object
            UserEmployeeCollection.addUser(1, "Derek", "Thomas", "Blankinship", 1, 1,
                                           "admin", "password", value, 'M', "574-123-1234", "574-234-2345",
                                           "N/A", "574-345-3456", "N/A", "*****@*****.**", value,
                                           value, value, "admin", value, "admin",
                                           "no notes");
            UserEmployeeCollection.addUser(1, "Hunter", "H", "Johnson", 1, 1,
                                           "user2", "12345", value, 'M', "574-410-2323", "574-234-7811",
                                           "N/A", "574-420-6969", "N/A", "*****@*****.**", value,
                                           value, value, "admin", value, "admin",
                                           "no notes");
            UserEmployeeCollection.addUser(1, "Andrew", "A", "Stone", 1, 1,
                                           "user3", "12345", value, 'M', "574-123-4201", "574-234-6955",
                                           "N/A", "574-666-1337", "N/A", "*****@*****.**", value,
                                           value, value, "admin", value, "admin",
                                           "no notes");

            UserEmployeeAddressCollection.addUserAddress1("admin", "exampleStreet1",
                                                          "exampleCity1", "exampleState1", 12345, value, "admin", value, "admin", "no notes");
            UserEmployeeAddressCollection2.addUserAddress2("admin", "exampleStreet2",
                                                           "exampleCity2", "exampleState2", 23456, value, "admin", value, "admin", "no notes");
            UserEmployeeEmergencyCollection.addUserEmergencyContact1("admin", "Tara", "Blankinship",
                                                                     "574-567-8901", "wife", value, "admin", value, "admin", "no notes");
            UserEmployeeEmergencyCollection2.addUserEmergencyContact2("admin", "ASD", "adf",
                                                                      "adsf", "adsf", value, "admin", value, "admin", "no notes");

            UserEmployeeAddressCollection.addUserAddress1("user2", "321 Red Drive",
                                                          "exampleCity1", "exampleState1", 54378, value, "admin", value, "admin", "no notes");
            UserEmployeeAddressCollection.addUserAddress1("user3", "275 Green Avenue",
                                                          "exampleCity1", "exampleState1", 43589, value, "admin", value, "admin", "no notes");
            UserEmployeeEmergencyCollection.addUserEmergencyContact1("user2", "John", "Meme",
                                                                     "574-567-6969", "wife", value, "admin", value, "admin", "no notes");
            UserEmployeeEmergencyCollection.addUserEmergencyContact1("user3", "Max", "Smith",
                                                                     "574-216-2017", "wife", value, "admin", value, "admin", "no notes");

            CustomerCollection.AddCustomer("Walmart", 3, "walmart", "edlp33", "574-201-5669", "574-420-7878",
                                           "*****@*****.**", value, "N/A", value, "N/A", "no notes");
            CustomerCollection.AddCustomer("Dicks Sporting Goods", 3, "dicks", "sports", "574-343-5555", "574-777-9999",
                                           "*****@*****.**", value, "admin", value, "admin", "no notes");
            CustomerCollection.AddCustomer("Dominos Pizza", 3, "dominos", "pizza", "574-666-6666", "574-323-0909",
                                           "*****@*****.**", value, "admin", value, "admin", "no notes");

            CustomerAddressCollection.addCustomerAddress("walmart", "123 Streert Name", "Mishawaka", "Indiana", 46544,
                                                         value, "admin", value, "admin", "no notes");
            CustomerAddressCollection.addCustomerAddress("dicks", "234 Streert Name", "Mishawaka", "Indiana", 46544,
                                                         value, "admin", value, "admin", "no notes");
            CustomerAddressCollection.addCustomerAddress("dominos", "345 Streert Name", "Mishawaka", "Indiana", 46544,
                                                         value, "admin", value, "admin", "no notes");

            AssetCollection.AddAsset("Lawnmowers", 2000.0, 10.0, "Hardware", value, "admin", value, "admin", "for cutting grass");
            AssetCollection.AddAsset("Leafblower", 500.0, 5.0, "Hardware", value, "admin", value, "admin", "for blowing leaves");
            AssetCollection.AddAsset("Snowblower", 400.0, 4.0, "Hardware", value, "admin", value, "admin", "for blowing snow");

            UserPositionIDCollection.addUserPositionID(1, "Owner", 10000000.00);
            UserPositionIDCollection.addUserPositionID(2, "Employee", 200000.00);
            UserPositionIDCollection.addUserPositionID(3, "Intern", 0.0);

            wnd.Show();
        }