public void SetCurrentCashbox( string cashBoxId ) { CashboxProcesses cashboxProcesses = new CashboxProcesses( null ); Cashbox cashbox = cashboxProcesses.FindCashBoxById( cashBoxId ); if ( cashbox == null ) throw new ArgumentOutOfRangeException( "cashBoxId" ); this.cashbox = cashbox; }
public void CheckDatabaseInitialized() { if ( !StorageContext.Current.Exists<Employee>( null ) ) { Employee employee = new Employee {FirstName = "Initial", LastName = "Employee", Login = "******"}; employee.SetPassword( "init" ); StorageContext.Current.Insert( employee ); } if ( !StorageContext.Current.Exists<Cashbox>( null ) ) { Cashbox cashbox = new Cashbox {CashboxId = "1", Name = "My Cashbox", Balance = 0}; StorageContext.Current.Insert( cashbox ); } }