} // For the Ok btn that in the error panel public LogInViewModel(ILoadable loadable) { this.loadable = loadable; LoginCommand = new DelegateCommand(x => UserName.Length > 0, x => { BussinesLogic bl = new BussinesLogic(); p = bl.GetPersonByEmail(UserName); IsLogInActive = false; Notify("MutexIndex", "ErrorTitle"); if (p != null && Password.Equals(p.Password)) { BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += (s, e) => { while (progress < 1) { Thread.Sleep(50); progress += 0.01; Notify("Progress"); } }; worker.RunWorkerCompleted += (s, e) => loadable.Loaded(p.PersonType); worker.RunWorkerAsync(); } }); ErrorOkCommand = new DelegateCommand(x => IsLogInActive = true); CancelCommand = new DelegateCommand(x => { loadable.Cancel(); }); }
public CustomiseWindow() { InitializeComponent(); bl = new BussinesLogic(); activeTables = bl.GetAllTables(); products = Enum.GetNames(typeof(RationType)).ToList <String>(); cmbTable.ItemsSource = activeTables; cmbProduct.ItemsSource = products; }
public TableViewModel() { bl = new BussinesLogic(); //List<Ration> rations = bl.GetAllRations(); //List<Order> orders = bl.GetAllOrders(); Tables = new ObservableCollection <Table>(); _PopulateTables(bl.GetAllTables().AsQueryable()); Delete = new DeleteCommand( () => CanDelete, table => { CurrentTable = null; _PopulateTables(bl.GetAllTables().AsQueryable()); }); DeleteRationCmd = new DelegateCommand( ration => CanDelete, ration => { CurrentTable.RationList.Remove(CurrentRation); bl.Delete(CurrentRation); bl.Update(CurrentTable); CurrentRation = null; _PopulateTables(bl.GetAllTables().AsQueryable()); }); AddTableCmd = new DelegateCommand( ration => { //CurrentOrder.RationList.Add(new Ration()); //bl.Delete(CurrentRation); //bl.Update(CurrentOrder); Table newTable = new Table(); bl.Insert(newTable); CurrentTable = newTable; _PopulateTables(bl.GetAllTables().AsQueryable()); }); AddRationCmd = new DelegateCommand( ration => { CurrentTable.RationList.Add(new Ration() { CreationDate = DateTime.Now }); //bl.Delete(CurrentRation); bl.Update(CurrentTable); _PopulateTables(bl.GetAllTables().AsQueryable()); }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); BussinesLogic logic = new BussinesLogic(); AddressBussinesObject address = logic.AddressService.Create( new AddressBussinesObject() { City = "myslowice", Street = "armii", Number = "21" }); var Customer = logic.CustomerService.Create( new CustomerBussinesObject() { FirstName = "Jebus", LastName = "Lukasz", Addresses = new List <AddressBussinesObject>() { address } }); logic.CustomerService.Create( new CustomerBussinesObject() { FirstName = "Anita", LastName = "Tomalczyk", Addresses = new List <AddressBussinesObject>() { address } }); logic.OrderService.Create( new OrderBussinesObject() { DeliveryDate = DateTime.Now.AddMonths(-1), OrderDate = DateTime.Now.AddMonths(+1), Customer = Customer, }); } app.UseMvc(); }
//public ObservableCollection<RationModel> allRations { get; set; } public KitchenViewModel() { bl = new BussinesLogic(); Rations = new ObservableCollection <RationModel>(); //allRations = new ObservableCollection<RationModel>(); ActiveTables = bl.GetAllTables(); RationTaypes = Enum.GetNames(typeof(RationType)).ToList <String>(); _PopulateRations(bl.GetAllRations().AsQueryable()); DoneRationCmd = new DelegateCommand( ration => CanDeleteRation, ration => { CurrentRation.the_r.Done = true;; bl.Update(CurrentRation.the_r); CurrentRation = null; _PopulateRations(bl.GetAllRations().AsQueryable()); }); }
public void Execute(object parameter) { if (CanExecute(parameter)) { var table = parameter as Table; if (table != null) { var result = MessageBox.Show("Are you sure you wish to delete the Table?", "Confirm Delete", MessageBoxButton.OKCancel); if (result.Equals(MessageBoxResult.OK)) { BussinesLogic bl = new BussinesLogic(); bl.Delete(table); if (_deleted != null) { _deleted(table); } } } } }
public LoginController() { var bl = new BussinesLogic(); _session = bl.GetSessionBL(); }
public AdminModAttribute() { var businessLogic = new BussinesLogic(); _sessionBusinessLogic = businessLogic.GetSessionBL(); }
public RegisterController() { BussinesLogic bl = new BussinesLogic(); _register = bl.GetRegisterBL(); }
public AddressController(BussinesLogic bussinesLogic) { _bussinesLogic = bussinesLogic; }
public AuthentificationController() { var bl = new BussinesLogic(); _session = bl.GetSessionBl(); }
public RegisterController() { var bl = new BussinesLogic(); _register = bl.GetSessionBL(); }