//constructor and initialization for needed properties public MagViewModel(MagView magViewOpen) { magView = magViewOpen; //getting list and sum from tables ListProduct = GetProducts(); Suma = GetSum(); }
/// <summary> /// Method for determining which user has logged in /// </summary> private void LoginExecute() { try { //if magacioner is logged if (Username == "Mag2019" && Password == "Mag2019") { MagView magView = new MagView(); magView.ShowDialog(); } //if manager is logged else if (Username == "Man2019" && Password == "Man2019") { ManView manView = new ManView(); manView.ShowDialog(); } //if invalid parametres are inputed else { MessageBox.Show("Invalid parametres"); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }