|
@@ -77,6 +77,30 @@ namespace Acosta.ViewModels
|
|
|
UC = new VisitsView();
|
|
|
}
|
|
|
|
|
|
+ public void EditUser(int userId)
|
|
|
+ {
|
|
|
+ editUserVM = new EditEmployeeViewModel(myConnection5, userId);
|
|
|
+ UC = new EditEmployeesView();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void EditOutlet(int outletId)
|
|
|
+ {
|
|
|
+ editOutletVM = new EditOutletViewModel(myConnection6, outletId);
|
|
|
+ UC = new EditOutletsView();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void SaveEditUser()
|
|
|
+ {
|
|
|
+ myConnection5.SaveChanges();
|
|
|
+ UC = new EmployeesView();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void SaveEditOutlet()
|
|
|
+ {
|
|
|
+ myConnection6.SaveChanges();
|
|
|
+ UC = new OutletsView();
|
|
|
+ }
|
|
|
+
|
|
|
public UserControl UC { get => uc; set => this.RaiseAndSetIfChanged(ref uc, value); }
|
|
|
private UserControl uc = new AuthorizationView();
|
|
|
public int curUsId;
|
|
@@ -103,20 +127,22 @@ namespace Acosta.ViewModels
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void SavePassword()
|
|
|
+ /*public void SavePassword()
|
|
|
{
|
|
|
ChangePasswordView changePasswordView = new ChangePasswordView();
|
|
|
currentUser = myConnection.Employees.FirstOrDefault(x => x.Email == AuthorizationVM.Login && x.Password == AuthorizationVM.Password);
|
|
|
changePasswordView.cp(currentUser);
|
|
|
myConnection.SaveChanges();
|
|
|
UC = new PersonalAccountView();
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
public List<Project> ListProjects => myConnection.Projects.ToList();
|
|
|
public List<TradeNetwork> ListTrades => myConnection.TradeNetworks.ToList();
|
|
|
public List<Employee> ListEmployees => myConnection.Employees.Include(x => x.RoleNavigation).ToList().Where(x => x.Employeesid != curUsId).ToList();
|
|
|
public List<Outlet> ListOutlets => myConnection.Outlets.ToList();
|
|
|
public List<Visit> ListVisits => myConnection.Visits.ToList();
|
|
|
+
|
|
|
+ public List<Acceptance> ListAcceptance => myConnection.Acceptances.ToList();
|
|
|
//List<a> newList = new List<a>(new a((from p in myConnection.Outlets.ToList() select p.Outletid).ToImmutableList().ToList().FirstOrDefault(), (from p in myConnection.Outlets.ToList() select p.Address).ToImmutableList().ToList().FirstOrDefault(), (from p in myConnection.Outlets.ToList() select p.Location).ToImmutableList().ToList().FirstOrDefault(), (from p in myConnection.TradeNetworks.ToList() select p.Title).ToImmutableList().ToList().FirstOrDefault()));
|
|
|
//public List<string> fkTrade => myConnection.TradeNetworks.ToList().Select(x => x.Title).Where()
|
|
|
//List<a> newList = new List<a>(new a((from p in myConnection.Outlets.ToList() select p.Outletid).ToImmutableList().ToList().FirstOrDefault(), (from p in myConnection.Outlets.ToList() select p.Address).ToImmutableList().ToList().FirstOrDefault(), (from p in myConnection.Outlets.ToList() select p.Location).ToImmutableList().ToList().FirstOrDefault(), (from p in myConnection.TradeNetworks.ToList() select p.Title).ToImmutableList().ToList().FirstOrDefault()));
|