diff --git a/.gitignore b/.gitignore index 3b87e03..bb4ab74 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ *.suo [Bb]in/ *.user -_[Rr]e[Ss]harper.*/ \ No newline at end of file +_[Rr]e[Ss]harper.*/ +.vs/ +packages/ \ No newline at end of file diff --git a/Include/NHibernate/Iesi.Collections.dll b/Include/NHibernate/Iesi.Collections.dll deleted file mode 100644 index 7520b0e..0000000 Binary files a/Include/NHibernate/Iesi.Collections.dll and /dev/null differ diff --git a/Include/NHibernate/Iesi.Collections.pdb b/Include/NHibernate/Iesi.Collections.pdb deleted file mode 100644 index 453ad1c..0000000 Binary files a/Include/NHibernate/Iesi.Collections.pdb and /dev/null differ diff --git a/Include/NHibernate/Iesi.Collections.xml b/Include/NHibernate/Iesi.Collections.xml deleted file mode 100644 index 0f9ca81..0000000 --- a/Include/NHibernate/Iesi.Collections.xml +++ /dev/null @@ -1,1903 +0,0 @@ - - - - Iesi.Collections - - - - -

DictionarySet is an abstract class that supports the creation of new Set - types where the underlying data store is an IDictionary instance.

- -

You can use any object that implements the IDictionary interface to hold set data. - You can define your own, or you can use one of the objects provided in the Framework. - The type of IDictionary you choose will affect both the performance and the behavior - of the Set using it.

- -

To make a Set typed based on your own IDictionary, simply derive a - new class with a constructor that takes no parameters. Some Set implmentations - cannot be defined with a default constructor. If this is the case for your class, - you will need to override Clone() as well.

- -

It is also standard practice that at least one of your constructors takes an ICollection or - an ISet as an argument.

-
-
- -

A collection that contains no duplicate elements. This class models the mathematical - Set abstraction, and is the base class for all other Set implementations. - The order of elements in a set is dependant on (a)the data-structure implementation, and - (b)the implementation of the various Set methods, and thus is not guaranteed.

- -

None of the Set implementations in this library are guranteed to be thread-safe - in any way unless wrapped in a SynchronizedSet.

- -

The following table summarizes the binary operators that are supported by the Set class.

- - - Operation - Description - Method - Operator - - - Union (OR) - Element included in result if it exists in either A OR B. - Union() - | - - - Intersection (AND) - Element included in result if it exists in both A AND B. - InterSect() - & - - - Exclusive Or (XOR) - Element included in result if it exists in one, but not both, of A and B. - ExclusiveOr() - ^ - - - Minus (n/a) - Take all the elements in A. Now, if any of them exist in B, remove - them. Note that unlike the other operators, A - B is not the same as B - A. - Minus() - - - - -
-
- - -

A collection that contains no duplicate elements. This interface models the mathematical - Set abstraction. - The order of elements in a set is dependant on (a)the data-structure implementation, and - (b)the implementation of the various Set methods, and thus is not guaranteed.

- -

None of the Set implementations in this library are guranteed to be thread-safe - in any way unless wrapped in a SynchronizedSet.

- -

The following table summarizes the binary operators that are supported by the Set class.

- - - Operation - Description - Method - - - Union (OR) - Element included in result if it exists in either A OR B. - Union() - - - Intersection (AND) - Element included in result if it exists in both A AND B. - InterSect() - - - Exclusive Or (XOR) - Element included in result if it exists in one, but not both, of A and B. - ExclusiveOr() - - - Minus (n/a) - Take all the elements in A. Now, if any of them exist in B, remove - them. Note that unlike the other operators, A - B is not the same as B - A. - Minus() - - -
-
- - - Performs a "union" of the two sets, where all the elements - in both sets are present. That is, the element is included if it is in either a or b. - Neither this set nor the input set are modified during the operation. The return value - is a Clone() of this set with the extra elements added in. - - A collection of elements. - A new Set containing the union of this Set with the specified collection. - Neither of the input objects is modified by the union. - - - - Performs an "intersection" of the two sets, where only the elements - that are present in both sets remain. That is, the element is included if it exists in - both sets. The Intersect() operation does not modify the input sets. It returns - a Clone() of this set with the appropriate elements removed. - - A set of elements. - The intersection of this set with a. - - - - Performs a "minus" of set b from set a. This returns a set of all - the elements in set a, removing the elements that are also in set b. - The original sets are not modified during this operation. The result set is a Clone() - of this Set containing the elements from the operation. - - A set of elements. - A set containing the elements from this set with the elements in a removed. - - - - Performs an "exclusive-or" of the two sets, keeping only the elements that - are in one of the sets, but not in both. The original sets are not modified - during this operation. The result set is a Clone() of this set containing - the elements from the exclusive-or operation. - - A set of elements. - A set containing the result of a ^ b. - - - - Returns if the set contains all the elements in the specified collection. - - A collection of objects. - if the set contains all the elements in the specified collection, otherwise. - - - - Adds the specified element to this set if it is not already present. - - The object to add to the set. - is the object was added, if it was already present. - - - - Adds all the elements in the specified collection to the set if they are not already present. - - A collection of objects to add to the set. - is the set changed as a result of this operation, if not. - - - - Remove all the specified elements from this set, if they exist in this set. - - A collection of elements to remove. - if the set was modified as a result of this operation. - - - - Retains only the elements in this set that are contained in the specified collection. - - Collection that defines the set of elements to be retained. - if this set changed as a result of this operation. - - - - Returns if this set contains no elements. - - - - -

A collection that contains no duplicate elements. This interface models the mathematical - Set abstraction. - The order of elements in a set is dependant on (a)the data-structure implementation, and - (b)the implementation of the various Set methods, and thus is not guaranteed.

- -

None of the Set implementations in this library are guranteed to be thread-safe - in any way unless wrapped in a SynchronizedSet.

- -

The following table summarizes the binary operators that are supported by the Set class.

- - - Operation - Description - Method - - - Union (OR) - Element included in result if it exists in either A OR B. - Union() - - - Intersection (AND) - Element included in result if it exists in both A AND B. - InterSect() - - - Exclusive Or (XOR) - Element included in result if it exists in one, but not both, of A and B. - ExclusiveOr() - - - Minus (n/a) - Take all the elements in A. Now, if any of them exist in B, remove - them. Note that unlike the other operators, A - B is not the same as B - A. - Minus() - - -
-
- - - Performs a "union" of the two sets, where all the elements - in both sets are present. That is, the element is included if it is in either a or b. - Neither this set nor the input set are modified during the operation. The return value - is a Clone() of this set with the extra elements added in. - - A collection of elements. - A new Set containing the union of this Set with the specified collection. - Neither of the input objects is modified by the union. - - - - Performs an "intersection" of the two sets, where only the elements - that are present in both sets remain. That is, the element is included if it exists in - both sets. The Intersect() operation does not modify the input sets. It returns - a Clone() of this set with the appropriate elements removed. - - A set of elements. - The intersection of this set with a. - - - - Performs a "minus" of set b from set a. This returns a set of all - the elements in set a, removing the elements that are also in set b. - The original sets are not modified during this operation. The result set is a Clone() - of this Set containing the elements from the operation. - - A set of elements. - A set containing the elements from this set with the elements in a removed. - - - - Performs an "exclusive-or" of the two sets, keeping only the elements that - are in one of the sets, but not in both. The original sets are not modified - during this operation. The result set is a Clone() of this set containing - the elements from the exclusive-or operation. - - A set of elements. - A set containing the result of a ^ b. - - - - Returns if this set contains the specified element. - - The element to look for. - if this set contains the specified element, otherwise. - - - - Returns if the set contains all the elements in the specified collection. - - A collection of objects. - if the set contains all the elements in the specified collection, otherwise. - - - - Adds the specified element to this set if it is not already present. - - The object to add to the set. - is the object was added, if it was already present. - - - - Adds all the elements in the specified collection to the set if they are not already present. - - A collection of objects to add to the set. - is the set changed as a result of this operation, if not. - - - - Removes the specified element from the set. - - The element to be removed. - if the set contained the specified element, otherwise. - - - - Remove all the specified elements from this set, if they exist in this set. - - A collection of elements to remove. - if the set was modified as a result of this operation. - - - - Retains only the elements in this set that are contained in the specified collection. - - Collection that defines the set of elements to be retained. - if this set changed as a result of this operation. - - - - Removes all objects from the set. - - - - - Returns if this set contains no elements. - - - - - Performs a "union" of the two sets, where all the elements - in both sets are present. That is, the element is included if it is in either a or b. - Neither this set nor the input set are modified during the operation. The return value - is a Clone() of this set with the extra elements added in. - - A collection of elements. - A new Set containing the union of this Set with the specified collection. - Neither of the input objects is modified by the union. - - - - Performs a "union" of two sets, where all the elements - in both are present. That is, the element is included if it is in either a or b. - The return value is a Clone() of one of the sets (a if it is not ) with elements of the other set - added in. Neither of the input sets is modified by the operation. - - A set of elements. - A set of elements. - A set containing the union of the input sets. if both sets are . - - - - Performs a "union" of two sets, where all the elements - in both are present. That is, the element is included if it is in either a or b. - The return value is a Clone() of one of the sets (a if it is not ) with elements of the other set - added in. Neither of the input sets is modified by the operation. - - A set of elements. - A set of elements. - A set containing the union of the input sets. if both sets are . - - - - Performs an "intersection" of the two sets, where only the elements - that are present in both sets remain. That is, the element is included if it exists in - both sets. The Intersect() operation does not modify the input sets. It returns - a Clone() of this set with the appropriate elements removed. - - A set of elements. - The intersection of this set with a. - - - - Performs an "intersection" of the two sets, where only the elements - that are present in both sets remain. That is, the element is included only if it exists in - both a and b. Neither input object is modified by the operation. - The result object is a Clone() of one of the input objects (a if it is not ) containing the - elements from the intersect operation. - - A set of elements. - A set of elements. - The intersection of the two input sets. if both sets are . - - - - Performs an "intersection" of the two sets, where only the elements - that are present in both sets remain. That is, the element is included only if it exists in - both a and b. Neither input object is modified by the operation. - The result object is a Clone() of one of the input objects (a if it is not ) containing the - elements from the intersect operation. - - A set of elements. - A set of elements. - The intersection of the two input sets. if both sets are . - - - - Performs a "minus" of set b from set a. This returns a set of all - the elements in set a, removing the elements that are also in set b. - The original sets are not modified during this operation. The result set is a Clone() - of this Set containing the elements from the operation. - - A set of elements. - A set containing the elements from this set with the elements in a removed. - - - - Performs a "minus" of set b from set a. This returns a set of all - the elements in set a, removing the elements that are also in set b. - The original sets are not modified during this operation. The result set is a Clone() - of set a containing the elements from the operation. - - A set of elements. - A set of elements. - A set containing A - B elements. if a is . - - - - Performs a "minus" of set b from set a. This returns a set of all - the elements in set a, removing the elements that are also in set b. - The original sets are not modified during this operation. The result set is a Clone() - of set a containing the elements from the operation. - - A set of elements. - A set of elements. - A set containing A - B elements. if a is . - - - - Performs an "exclusive-or" of the two sets, keeping only the elements that - are in one of the sets, but not in both. The original sets are not modified - during this operation. The result set is a Clone() of this set containing - the elements from the exclusive-or operation. - - A set of elements. - A set containing the result of a ^ b. - - - - Performs an "exclusive-or" of the two sets, keeping only the elements that - are in one of the sets, but not in both. The original sets are not modified - during this operation. The result set is a Clone() of one of the sets - (a if it is not ) containing - the elements from the exclusive-or operation. - - A set of elements. - A set of elements. - A set containing the result of a ^ b. if both sets are . - - - - Performs an "exclusive-or" of the two sets, keeping only the elements that - are in one of the sets, but not in both. The original sets are not modified - during this operation. The result set is a Clone() of one of the sets - (a if it is not ) containing - the elements from the exclusive-or operation. - - A set of elements. - A set of elements. - A set containing the result of a ^ b. if both sets are . - - - - Adds the specified element to this set if it is not already present. - - The object to add to the set. - is the object was added, if it was already present. - - - - Adds all the elements in the specified collection to the set if they are not already present. - - A collection of objects to add to the set. - is the set changed as a result of this operation, if not. - - - - Removes all objects from the set. - - - - - Returns if this set contains the specified element. - - The element to look for. - if this set contains the specified element, otherwise. - - - - Returns if the set contains all the elements in the specified collection. - - A collection of objects. - if the set contains all the elements in the specified collection, otherwise. - - - - Removes the specified element from the set. - - The element to be removed. - if the set contained the specified element, otherwise. - - - - Remove all the specified elements from this set, if they exist in this set. - - A collection of elements to remove. - if the set was modified as a result of this operation. - - - - Retains only the elements in this set that are contained in the specified collection. - - Collection that defines the set of elements to be retained. - if this set changed as a result of this operation. - - - - Returns a clone of the Set instance. This will work for derived Set - classes if the derived class implements a constructor that takes no arguments. - - A clone of this object. - - - - Copies the elements in the Set to an array. The type of array needs - to be compatible with the objects in the Set, obviously. - - An array that will be the target of the copy operation. - The zero-based index where copying will start. - - - - Gets an enumerator for the elements in the Set. - - An IEnumerator over the elements in the Set. - - - - Performs CopyTo when called trhough non-generic ISet (ICollection) interface - - - - - - - Performs Union when called trhough non-generic ISet interface - - - - - - - Performs Minus when called trhough non-generic ISet interface - - - - - - - Performs Intersect when called trhough non-generic ISet interface - - - - - - - Performs ExclusiveOr when called trhough non-generic ISet interface - - - - - - - Returns if this set contains no elements. - - - - - The number of elements currently contained in this collection. - - - - - Returns if the Set is synchronized across threads. Note that - enumeration is inherently not thread-safe. Use the SyncRoot to lock the - object during enumeration. - - - - - An object that can be used to synchronize this collection to make it thread-safe. - When implementing this, if your object uses a base object, like an IDictionary, - or anything that has a SyncRoot, return that object instead of "this". - - - - - Indicates whether the given instance is read-only or not - - - if the ISet is read-only; otherwise, . - In the default implementation of Set, this property always returns false. - - - - - Provides the storage for elements in the Set, stored as the key-set - of the IDictionary object. Set this object in the constructor - if you create your own Set class. - - - - - Adds the specified element to this set if it is not already present. - - The to add to the set. - is the object was added, if it was already present. - - - - Adds all the elements in the specified collection to the set if they are not already present. - - A collection of objects to add to the set. - is the set changed as a result of this operation, if not. - - - - Removes all objects from the set. - - - - - Returns if this set contains the specified element. - - The element to look for. - if this set contains the specified element, otherwise. - - - - Returns if the set contains all the elements in the specified collection. - - A collection of objects. - if the set contains all the elements in the specified collection, otherwise. - - - - Removes the specified element from the set. - - The element to be removed. - if the set contained the specified element, otherwise. - - - - Remove all the specified elements from this set, if they exist in this set. - - A collection of elements to remove. - if the set was modified as a result of this operation. - - - - Retains only the elements in this set that are contained in the specified collection. - - Collection that defines the set of elements to be retained. - if this set changed as a result of this operation. - - - - Copies the elements in the Set to an array of T. The type of array needs - to be compatible with the objects in the Set, obviously. - - An array that will be the target of the copy operation. - The zero-based index where copying will start. - - - - Gets an enumerator for the elements in the Set. - - An IEnumerator over the elements in the Set. - - - - Copies the elements in the Set to an array. The type of array needs - to be compatible with the objects in the Set, obviously. Needed for - non-generic ISet methods implementation - - An array that will be the target of the copy operation. - The zero-based index where copying will start. - - - - The placeholder object used as the value for the IDictionary instance. - - - There is a single instance of this object globally, used for all Sets. - - - - - Returns if this set contains no elements. - - - - - The number of elements contained in this collection. - - - - - None of the objects based on DictionarySet are synchronized. Use the - SyncRoot property instead. - - - - - Returns an object that can be used to synchronize the Set between threads. - - - - - Indicates wether the Set is read-only or not - - - - - Implements a Set based on a Dictionary (which is equivalent of - non-genric HashTable) This will give the best lookup, add, and remove - performance for very large data-sets, but iteration will occur in no particular order. - - - - - Creates a new set instance based on a Dictinary. - - - - - Creates a new set instance based on a Dictinary and - initializes it based on a collection of elements. - - A collection of elements that defines the initial set contents. - - - -

Implements an immutable (read-only) Set wrapper.

-

Although this is advertised as immutable, it really isn't. Anyone with access to the - basisSet can still change the data-set. So GetHashCode() is not implemented - for this Set, as is the case for all Set implementations in this library. - This design decision was based on the efficiency of not having to Clone() the - basisSet every time you wrap a mutable Set.

-
-
- - - Constructs an immutable (read-only) Set wrapper. - - The Set that is wrapped. - - - - Adds the specified element to this set if it is not already present. - - The object to add to the set. - nothing - is always thrown - - - - Adds all the elements in the specified collection to the set if they are not already present. - - A collection of objects to add to the set. - nothing - is always thrown - - - - Removes all objects from the set. - - is always thrown - - - - Returns if this set contains the specified element. - - The element to look for. - if this set contains the specified element, otherwise. - - - - Returns if the set contains all the elements in the specified collection. - - A collection of objects. - if the set contains all the elements in the specified collection, otherwise. - - - - Removes the specified element from the set. - - The element to be removed. - nothing - is always thrown - - - - Remove all the specified elements from this set, if they exist in this set. - - A collection of elements to remove. - nothing - is always thrown - - - - Retains only the elements in this set that are contained in the specified collection. - - Collection that defines the set of elements to be retained. - nothing - is always thrown - - - - Copies the elements in the Set to an array of T. The type of array needs - to be compatible with the objects in the Set, obviously. - - An array that will be the target of the copy operation. - The zero-based index where copying will start. - - - - Gets an enumerator for the elements in the Set. - - An IEnumerator over the elements in the Set. - - - - Returns a clone of the Set instance. - - A clone of this object. - - - - Performs a "union" of the two sets, where all the elements - in both sets are present. That is, the element is included if it is in either a or b. - Neither this set nor the input set are modified during the operation. The return value - is a Clone() of this set with the extra elements added in. - - A collection of elements. - A new Set containing the union of this Set with the specified collection. - Neither of the input objects is modified by the union. - - - - Performs an "intersection" of the two sets, where only the elements - that are present in both sets remain. That is, the element is included if it exists in - both sets. The Intersect() operation does not modify the input sets. It returns - a Clone() of this set with the appropriate elements removed. - - A set of elements. - The intersection of this set with a. - - - - Performs a "minus" of set b from set a. This returns a set of all - the elements in set a, removing the elements that are also in set b. - The original sets are not modified during this operation. The result set is a Clone() - of this Set containing the elements from the operation. - - A set of elements. - A set containing the elements from this set with the elements in a removed. - - - - Performs an "exclusive-or" of the two sets, keeping only the elements that - are in one of the sets, but not in both. The original sets are not modified - during this operation. The result set is a Clone() of this set containing - the elements from the exclusive-or operation. - - A set of elements. - A set containing the result of a ^ b. - - - - Performs CopyTo when called trhough non-generic ISet (ICollection) interface - - - - - - - Performs Union when called trhough non-generic ISet interface - - - - - - - Performs Minus when called trhough non-generic ISet interface - - - - - - - Performs Intersect when called trhough non-generic ISet interface - - - - - - - Performs ExclusiveOr when called trhough non-generic ISet interface - - - - - - - Returns if this set contains no elements. - - - - - The number of elements contained in this collection. - - - - - Returns an object that can be used to synchronize use of the Set across threads. - - - - - Returns an object that can be used to synchronize the Set between threads. - - - - - Indicates that the given instance is read-only - - - - - Implements an ordered Set based on a dictionary. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - A collection of elements that defines the initial set contents. - - - - Implements a Set based on a sorted tree. This gives good performance for operations on very - large data-sets, though not as good - asymptotically - as a HashedSet. However, iteration - occurs in order. Elements that you put into this type of collection must implement IComparable, - and they must actually be comparable. You can't mix string and int values, for example. - - - - - Creates a new set instance based on a sorted tree. - - - - - Creates a new set instance based on a sorted tree. - - The to use for sorting. - - - - Creates a new set instance based on a sorted tree and - initializes it based on a collection of elements. - - A collection of elements that defines the initial set contents. - - - - Creates a new set instance based on a sorted tree and - initializes it based on a collection of elements. - - A collection of elements that defines the initial set contents. - - - - Creates a new set instance based on a sorted tree and - initializes it based on a collection of elements. - - A collection of elements that defines the initial set contents. - The to use for sorting. - - - -

Implements a thread-safe Set wrapper. The implementation is extremely conservative, - serializing critical sections to prevent possible deadlocks, and locking on everything. - The one exception is for enumeration, which is inherently not thread-safe. For this, you - have to lock the SyncRoot object for the duration of the enumeration.

-
-
- - - Constructs a thread-safe Set wrapper. - - The Set object that this object will wrap. - - - - Adds the specified element to this set if it is not already present. - - The object to add to the set. - is the object was added, if it was already present. - - - - Adds all the elements in the specified collection to the set if they are not already present. - - A collection of objects to add to the set. - is the set changed as a result of this operation, if not. - - - - Removes all objects from the set. - - - - - Returns if this set contains the specified element. - - The element to look for. - if this set contains the specified element, otherwise. - - - - Returns if the set contains all the elements in the specified collection. - - A collection of objects. - if the set contains all the elements in the specified collection, otherwise. - - - - Removes the specified element from the set. - - The element to be removed. - if the set contained the specified element, otherwise. - - - - Remove all the specified elements from this set, if they exist in this set. - - A collection of elements to remove. - if the set was modified as a result of this operation. - - - - Retains only the elements in this set that are contained in the specified collection. - - Collection that defines the set of elements to be retained. - if this set changed as a result of this operation. - - - - Copies the elements in the Set to an array. The type of array needs - to be compatible with the objects in the Set, obviously. - - An array that will be the target of the copy operation. - The zero-based index where copying will start. - - - - Enumeration is, by definition, not thread-safe. Use a lock on the SyncRoot - to synchronize the entire enumeration process. - - - - - - Returns a clone of the Set instance. - - A clone of this object. - - - - Performs CopyTo when called trhough non-generic ISet (ICollection) interface - - - - - - - Returns if this set contains no elements. - - - - - The number of elements contained in this collection. - - - - - Returns , indicating that this object is thread-safe. The exception to this - is enumeration, which is inherently not thread-safe. Use the SyncRoot object to - lock this object for the entire duration of the enumeration. - - - - - Returns an object that can be used to synchronize the Set between threads. - - - - - Indicates whether given instace is read-only or not - - - - -

DictionarySet is an abstract class that supports the creation of new Set - types where the underlying data store is an IDictionary instance.

- -

You can use any object that implements the IDictionary interface to hold set data. - You can define your own, or you can use one of the objects provided in the Framework. - The type of IDictionary you choose will affect both the performance and the behavior - of the Set using it.

- -

To make a Set typed based on your own IDictionary, simply derive a - new class with a constructor that takes no parameters. Some Set implmentations - cannot be defined with a default constructor. If this is the case for your class, - you will need to override Clone() as well.

- -

It is also standard practice that at least one of your constructors takes an ICollection or - an ISet as an argument.

-
-
- - A collection that contains no duplicate elements. - - - This class models the mathematical set abstraction, and is the base class for all - other set implementations. The order of elements in a set is dependant on - (a) the data-structure implementation, and (b) the implementation of the various - methods, and thus is not guaranteed. - - - None of the implementations in this library are guranteed to be thread-safe - in any way unless wrapped in a . - - - The following table summarizes the binary operators that are supported by the - type. - - - - Operation - Description - Method - Operator - - - Union (OR) - Element included in result if it exists in either A OR B. - Union() - | - - - Intersection (AND) - Element included in result if it exists in both A AND B. - InterSect() - & - - - Exclusive Or (XOR) - Element included in result if it exists in one, but not both, of A and B. - ExclusiveOr() - ^ - - - Minus (n/a) - Take all the elements in A. Now, if any of them exist in B, remove - them. Note that unlike the other operators, A - B is not the same as B - A. - Minus() - - - - - - - - - Performs a "union" of the two sets, where all the elements - in both sets are present. That is, the element is included if it is in either a or b. - Neither this set nor the input set are modified during the operation. The return value - is a clone of this set with the extra elements added in. - - A collection of elements. - A new instance containing the union of this instance with the specified collection. - Neither of the input objects is modified by the union. - - - - Performs a "union" of two sets, where all the elements - in both are present. That is, the element is included if it is in either a or b. - The return value is a clone of one of the sets (a if it is not ) with elements of the other set - added in. Neither of the input sets is modified by the operation. - - A set of elements. - A set of elements. - A set containing the union of the input sets. if both sets are . - - - - Performs a "union" of two sets, where all the elements - in both are present. That is, the element is included if it is in either a or b. - The return value is a clone of one of the sets (a if it is not ) with elements of the other set - added in. Neither of the input sets is modified by the operation. - - A set of elements. - A set of elements. - A set containing the union of the input sets. if both sets are . - - - - Performs an "intersection" of the two sets, where only the elements - that are present in both sets remain. That is, the element is included if it exists in - both sets. The Intersect() operation does not modify the input sets. It returns - a Clone() of this set with the appropriate elements removed. - - A set of elements. - The intersection of this set with a. - - - - Performs an "intersection" of the two sets, where only the elements - that are present in both sets remain. That is, the element is included only if it exists in - both a and b. Neither input object is modified by the operation. - The result object is a Clone() of one of the input objects (a if it is not ) containing the - elements from the intersect operation. - - A set of elements. - A set of elements. - The intersection of the two input sets. if both sets are . - - - - Performs an "intersection" of the two sets, where only the elements - that are present in both sets remain. That is, the element is included only if it exists in - both a and b. Neither input object is modified by the operation. - The result object is a Clone() of one of the input objects (a if it is not ) containing the - elements from the intersect operation. - - A set of elements. - A set of elements. - The intersection of the two input sets. if both sets are . - - - - Performs a "minus" of set b from set a. This returns a set of all - the elements in set a, removing the elements that are also in set b. - The original sets are not modified during this operation. The result set is a Clone() - of this Set containing the elements from the operation. - - A set of elements. - A set containing the elements from this set with the elements in a removed. - - - - Performs a "minus" of set b from set a. This returns a set of all - the elements in set a, removing the elements that are also in set b. - The original sets are not modified during this operation. The result set is a Clone() - of set a containing the elements from the operation. - - A set of elements. - A set of elements. - A set containing A - B elements. if a is . - - - - Performs a "minus" of set b from set a. This returns a set of all - the elements in set a, removing the elements that are also in set b. - The original sets are not modified during this operation. The result set is a Clone() - of set a containing the elements from the operation. - - A set of elements. - A set of elements. - A set containing A - B elements. if a is . - - - - Performs an "exclusive-or" of the two sets, keeping only the elements that - are in one of the sets, but not in both. The original sets are not modified - during this operation. The result set is a clone of this set containing - the elements from the exclusive-or operation. - - A set of elements. - A set containing the result of a ^ b. - - - - Performs an "exclusive-or" of the two sets, keeping only the elements that - are in one of the sets, but not in both. The original sets are not modified - during this operation. The result set is a clone of one of the sets - (a if it is not ) containing - the elements from the exclusive-or operation. - - A set of elements. - A set of elements. - A set containing the result of a ^ b. if both sets are . - - - - Performs an "exclusive-or" of the two sets, keeping only the elements that - are in one of the sets, but not in both. The original sets are not modified - during this operation. The result set is a clone of one of the sets - (a if it is not ) containing - the elements from the exclusive-or operation. - - A set of elements. - A set of elements. - A set containing the result of a ^ b. if both sets are . - - - - Adds the specified element to this set if it is not already present. - - The object to add to the set. - is the object was added, if it was already present. - - - - Adds all the elements in the specified collection to the set if they are not already present. - - A collection of objects to add to the set. - is the set changed as a result of this operation, if not. - - - - Removes all objects from the set. - - - - - Returns if this set contains the specified element. - - The element to look for. - if this set contains the specified element, otherwise. - - - - Returns if the set contains all the elements in the specified collection. - - A collection of objects. - if the set contains all the elements in the specified collection, otherwise. - - - - Removes the specified element from the set. - - The element to be removed. - if the set contained the specified element, otherwise. - - - - Remove all the specified elements from this set, if they exist in this set. - - A collection of elements to remove. - if the set was modified as a result of this operation. - - - - Retains only the elements in this set that are contained in the specified collection. - - Collection that defines the set of elements to be retained. - if this set changed as a result of this operation. - - - - Returns a clone of the set instance. This will work for derived set - classes if the derived class implements a constructor that takes no arguments. - - A clone of this object. - - - - Copies the elements in the set to an array. The type of array needs - to be compatible with the objects in the set, obviously. - - An array that will be the target of the copy operation. - The zero-based index where copying will start. - - - - Returns an enumerator that iterates through the set. - - - An object that can be used to iterate through the set. - - - - - Returns if this set contains no elements. - - - - - The number of elements currently contained in this collection. - - - - - Returns if the set is synchronized across threads. Note that - enumeration is inherently not thread-safe. Use the to lock the - object during enumeration. - - - - - An object that can be used to synchronize this collection to make it thread-safe. - When implementing this, if your object uses a base object, like an , - or anything that has a , return that object instead - of . - - - - - Provides the storage for elements in the Set, stored as the key-set - of the IDictionary object. Set this object in the constructor - if you create your own Set class. - - - - - Adds the specified element to this set if it is not already present. - - The object to add to the set. - is the object was added, if it was already present. - - - - Adds all the elements in the specified collection to the set if they are not already present. - - A collection of objects to add to the set. - is the set changed as a result of this operation, if not. - - - - Removes all objects from the set. - - - - - Returns if this set contains the specified element. - - The element to look for. - if this set contains the specified element, otherwise. - - - - Returns if the set contains all the elements in the specified collection. - - A collection of objects. - if the set contains all the elements in the specified collection, otherwise. - - - - Removes the specified element from the set. - - The element to be removed. - if the set contained the specified element, otherwise. - - - - Remove all the specified elements from this set, if they exist in this set. - - A collection of elements to remove. - if the set was modified as a result of this operation. - - - - Retains only the elements in this set that are contained in the specified collection. - - Collection that defines the set of elements to be retained. - if this set changed as a result of this operation. - - - - Copies the elements in the Set to an array. The type of array needs - to be compatible with the objects in the Set, obviously. - - An array that will be the target of the copy operation. - The zero-based index where copying will start. - - - - Gets an enumerator for the elements in the Set. - - An IEnumerator over the elements in the Set. - - - - The placeholder object used as the value for the IDictionary instance. - - - There is a single instance of this object globally, used for all Sets. - - - - - Returns if this set contains no elements. - - - - - The number of elements contained in this collection. - - - - - None of the objects based on DictionarySet are synchronized. Use the - SyncRoot property instead. - - - - - Returns an object that can be used to synchronize the Set between threads. - - - - - Implements a Set based on a hash table. This will give the best lookup, add, and remove - performance for very large data-sets, but iteration will occur in no particular order. - - - - - Creates a new set instance based on a hash table. - - - - - Creates a new set instance based on a hash table and - initializes it based on a collection of elements. - - A collection of elements that defines the initial set contents. - - - - Implements a Set that automatically changes from a list to a hash table - when the size reaches a certain threshold. This is good if you are unsure about - whether you data-set will be tiny or huge. Because this uses a dual implementation, - iteration order is not guaranteed! - - - - - Creates a new set instance based on either a list or a hash table, depending on which - will be more efficient based on the data-set size. - - - - - Creates a new set instance based on either a list or a hash table, depending on which - will be more efficient based on the data-set size, and - initializes it based on a collection of elements. - - A collection of elements that defines the initial set contents. - - - -

Implements an immutable (read-only) Set wrapper.

-

Although this is advertised as immutable, it really isn't. Anyone with access to the - basisSet can still change the data-set. So GetHashCode() is not implemented - for this Set, as is the case for all Set implementations in this library. - This design decision was based on the efficiency of not having to Clone() the - basisSet every time you wrap a mutable Set.

-
-
- - - Constructs an immutable (read-only) Set wrapper. - - The Set that is wrapped. - - - - Adds the specified element to this set if it is not already present. - - The object to add to the set. - is the object was added, if it was already present. - - - - Adds all the elements in the specified collection to the set if they are not already present. - - A collection of objects to add to the set. - is the set changed as a result of this operation, if not. - - - - Removes all objects from the set. - - - - - Returns if this set contains the specified element. - - The element to look for. - if this set contains the specified element, otherwise. - - - - Returns if the set contains all the elements in the specified collection. - - A collection of objects. - if the set contains all the elements in the specified collection, otherwise. - - - - Removes the specified element from the set. - - The element to be removed. - if the set contained the specified element, otherwise. - - - - Remove all the specified elements from this set, if they exist in this set. - - A collection of elements to remove. - if the set was modified as a result of this operation. - - - - Retains only the elements in this set that are contained in the specified collection. - - Collection that defines the set of elements to be retained. - if this set changed as a result of this operation. - - - - Copies the elements in the Set to an array. The type of array needs - to be compatible with the objects in the Set, obviously. - - An array that will be the target of the copy operation. - The zero-based index where copying will start. - - - - Gets an enumerator for the elements in the Set. - - An IEnumerator over the elements in the Set. - - - - Returns a clone of the Set instance. - - A clone of this object. - - - - Performs a "union" of the two sets, where all the elements - in both sets are present. That is, the element is included if it is in either a or b. - Neither this set nor the input set are modified during the operation. The return value - is a Clone() of this set with the extra elements added in. - - A collection of elements. - A new Set containing the union of this Set with the specified collection. - Neither of the input objects is modified by the union. - - - - Performs an "intersection" of the two sets, where only the elements - that are present in both sets remain. That is, the element is included if it exists in - both sets. The Intersect() operation does not modify the input sets. It returns - a Clone() of this set with the appropriate elements removed. - - A set of elements. - The intersection of this set with a. - - - - Performs a "minus" of set b from set a. This returns a set of all - the elements in set a, removing the elements that are also in set b. - The original sets are not modified during this operation. The result set is a Clone() - of this Set containing the elements from the operation. - - A set of elements. - A set containing the elements from this set with the elements in a removed. - - - - Performs an "exclusive-or" of the two sets, keeping only the elements that - are in one of the sets, but not in both. The original sets are not modified - during this operation. The result set is a Clone() of this set containing - the elements from the exclusive-or operation. - - A set of elements. - A set containing the result of a ^ b. - - - - Returns if this set contains no elements. - - - - - The number of elements contained in this collection. - - - - - Returns an object that can be used to synchronize use of the Set across threads. - - - - - Returns an object that can be used to synchronize the Set between threads. - - - - - Implements a Set based on a list. Performance is much better for very small lists - than either HashedSet or SortedSet. However, performance degrades rapidly as - the data-set gets bigger. Use a HybridSet instead if you are not sure your data-set - will always remain very small. Iteration produces elements in the order they were added. - However, element order is not guaranteed to be maintained by the various Set - mathematical operators. - - - - - Creates a new set instance based on a list. - - - - - Creates a new set instance based on a list and - initializes it based on a collection of elements. - - A collection of elements that defines the initial set contents. - - - - Implements a set based on a sorted tree. This gives good performance for operations on very - large data-sets, though not as good - asymptotically - as a . - However, iteration occurs in order. Elements that you put into this type of collection must - implement , and they must actually be comparable. You can't mix - and values, for example. - - - - - Creates a new set instance based on a sorted tree. - - - - - Creates a new set instance based on a sorted tree. - - The to use for sorting. - - - - Creates a new set instance based on a sorted tree and - initializes it based on a collection of elements. - - A collection of elements that defines the initial set contents. - - - - Creates a new set instance based on a sorted tree and - initializes it based on a collection of elements. - - A collection of elements that defines the initial set contents. - The to use for sorting. - - - - Implements a thread-safe wrapper. - - - The implementation is extremely conservative, serializing critical sections - to prevent possible deadlocks, and locking on everything. The one exception - is for enumeration, which is inherently not thread-safe. For this, you have - to the object for the duration - of the enumeration. - - - - - Constructs a thread-safe wrapper. - - The object that this object will wrap. - - - - Adds the specified element to this set if it is not already present. - - The object to add to the set. - is the object was added, if it was already present. - - - - Adds all the elements in the specified collection to the set if they are not already present. - - A collection of objects to add to the set. - is the set changed as a result of this operation, if not. - - - - Removes all objects from the set. - - - - - Returns if this set contains the specified element. - - The element to look for. - if this set contains the specified element, otherwise. - - - - Returns if the set contains all the elements in the specified collection. - - A collection of objects. - if the set contains all the elements in the specified collection, otherwise. - - - - Removes the specified element from the set. - - The element to be removed. - if the set contained the specified element, otherwise. - - - - Remove all the specified elements from this set, if they exist in this set. - - A collection of elements to remove. - if the set was modified as a result of this operation. - - - - Retains only the elements in this set that are contained in the specified collection. - - Collection that defines the set of elements to be retained. - if this set changed as a result of this operation. - - - - Copies the elements in the set to an array. The type of array needs - to be compatible with the objects in the set, obviously. - - An array that will be the target of the copy operation. - The zero-based index where copying will start. - - - - Returns an enumerator that iterates through the set. - - - An object that can be used to iterate through the set. - - - Enumeration is, by definition, not thread-safe. Use a on the - to synchronize the entire enumeration process. - - - - - Returns a clone of this instance. - - A clone of this object. - - - - Returns if this set contains no elements. - - - - - The number of elements contained in this collection. - - - - - Returns , indicating that this object is thread-safe. The exception to this - is enumeration, which is inherently not thread-safe. Use the object to - lock this object for the entire duration of the enumeration. - - - - - Returns an object that can be used to synchronize the set between threads. - - -
-
diff --git a/Include/NHibernate/NHibernate.dll b/Include/NHibernate/NHibernate.dll deleted file mode 100644 index 6a68222..0000000 Binary files a/Include/NHibernate/NHibernate.dll and /dev/null differ diff --git a/Include/NHibernate/NHibernate.pdb b/Include/NHibernate/NHibernate.pdb deleted file mode 100644 index 36f9f0e..0000000 Binary files a/Include/NHibernate/NHibernate.pdb and /dev/null differ diff --git a/Include/Newtonsoft.Json.dll b/Include/Newtonsoft.Json.dll deleted file mode 100644 index a7dfbe0..0000000 Binary files a/Include/Newtonsoft.Json.dll and /dev/null differ diff --git a/Resources/Hops n Grains_1048.jpg b/Resources/Hops n Grains_1048.jpg deleted file mode 100644 index 60e697f..0000000 Binary files a/Resources/Hops n Grains_1048.jpg and /dev/null differ diff --git a/Tanshu.Accounts.Contracts/Data Contracts/Auth/Group.cs b/Tanshu.Accounts.Contracts/Data Contracts/Auth/Group.cs deleted file mode 100644 index 92d43da..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/Auth/Group.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Runtime.Serialization; -using System.Collections.Generic; -using Tanshu.Accounts.Contracts; -using NHibernate.Mapping.ByCode.Conformist; -using NHibernate.Mapping.ByCode; - -namespace Tanshu.Accounts.Entities.Auth -{ - public class Group - { - public virtual Guid GroupID { get; set; } - public virtual string Name { get; set; } - public virtual IList RoleGroups { get; set; } - public virtual IList UserGroups { get; set; } - public Group() - { - RoleGroups = new List(); - UserGroups = new List(); - } - } - public class GroupMap : ClassMapping - { - - public GroupMap() - { - Table("Auth_Groups"); - Schema("dbo"); - Lazy(true); - Id(x => x.GroupID, map => map.Generator(Generators.GuidComb)); - Property(x => x.Name, map => { map.NotNullable(true); map.Unique(true); }); - Bag(x => x.RoleGroups, colmap => { colmap.Key(x => x.Column("GroupID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - Bag(x => x.UserGroups, colmap => { colmap.Key(x => x.Column("GroupID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/Auth/Role.cs b/Tanshu.Accounts.Contracts/Data Contracts/Auth/Role.cs deleted file mode 100644 index 8f320ab..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/Auth/Role.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Runtime.Serialization; -using System.Collections.Generic; -using Tanshu.Accounts.Contracts; -using NHibernate.Mapping.ByCode.Conformist; -using NHibernate.Mapping.ByCode; - -namespace Tanshu.Accounts.Entities.Auth -{ - public class Role - { - public virtual Guid RoleID { get; set; } - public virtual string Name { get; set; } - public virtual IList Groups { get; set; } - - public Role() - { - Groups = new List(); - } - } - public class RoleMap : ClassMapping - { - public RoleMap() - { - Table("Auth_Roles"); - Schema("dbo"); - Lazy(true); - Id(x => x.RoleID, map => map.Generator(Generators.GuidComb)); - Property(x => x.Name, map => { map.NotNullable(true); map.Unique(true); }); - Bag(x => x.Groups, colmap => { colmap.Key(x => x.Column("RoleID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - } - } - -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/Auth/RoleGroup.cs b/Tanshu.Accounts.Contracts/Data Contracts/Auth/RoleGroup.cs deleted file mode 100644 index d67ce2d..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/Auth/RoleGroup.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Runtime.Serialization; -using Tanshu.Accounts.Contracts; -using NHibernate.Mapping.ByCode.Conformist; -using NHibernate.Mapping.ByCode; - -namespace Tanshu.Accounts.Entities.Auth -{ - public class RoleGroup - { - public virtual Guid RoleGroupID { get; set; } - public virtual Role Role { get; set; } - public virtual Group Group { get; set; } - } - public class RoleGroupMap : ClassMapping - { - - public RoleGroupMap() - { - Table("Auth_RoleGroups"); - Schema("dbo"); - Lazy(true); - Id(x => x.RoleGroupID, map => map.Generator(Generators.GuidComb)); - ManyToOne(x => x.Role, map => - { - map.Column("RoleID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - - ManyToOne(x => x.Group, map => - { - map.Column("GroupID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - - } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/Auth/UserBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/Auth/UserBO.cs deleted file mode 100644 index 8811d1d..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/Auth/UserBO.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Collections.Generic; -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; - -namespace Tanshu.Accounts.Entities.Auth -{ - public class User - { - public virtual Guid UserID { get; set; } - public virtual string Name { get; set; } - public virtual string MsrString { get; set; } - public virtual string Password { get; set; } - public virtual bool LockedOut { get; set; } - - public virtual IList UserGroups { get; set; } - public virtual IList Kots { get; set; } - public virtual IList Reprints { get; set; } - public virtual IList Vouchers { get; set; } - public User() - { - UserGroups = new List(); - Kots = new List(); - Reprints = new List(); - Vouchers = new List(); - } - } - public class UserMap : ClassMapping - { - public UserMap() - { - Table("Auth_Users"); - Schema("dbo"); - Lazy(true); - - Id(x => x.UserID, m => m.Generator(Generators.GuidComb)); - Property(x => x.Name, map => { map.NotNullable(true); map.Unique(true); }); - Property(x => x.MsrString); - Property(x => x.Password, m => m.NotNullable(true)); - Property(x => x.LockedOut, m => m.NotNullable(true)); - - Bag(x => x.UserGroups, colmap => { colmap.Key(x => x.Column("UserID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - Bag(x => x.Kots, colmap => { colmap.Key(x => x.Column("UserID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - Bag(x => x.Reprints, colmap => { colmap.Key(x => x.Column("UserID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - Bag(x => x.Vouchers, colmap => { colmap.Key(x => x.Column("UserID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/Auth/UserGroup.cs b/Tanshu.Accounts.Contracts/Data Contracts/Auth/UserGroup.cs deleted file mode 100644 index b1ca038..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/Auth/UserGroup.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Runtime.Serialization; -using Tanshu.Accounts.Contracts; -using NHibernate.Mapping.ByCode.Conformist; -using NHibernate.Mapping.ByCode; -using System.Collections.Generic; - -namespace Tanshu.Accounts.Entities.Auth -{ - public class UserGroup - { - public virtual Guid UserGroupID { get; set; } - public virtual User User { get; set; } - public virtual Group Group { get; set; } - } - public class UserGroupMap : ClassMapping - { - - public UserGroupMap() - { - Table("Auth_UserGroups"); - Schema("dbo"); - Lazy(true); - Id(x => x.UserGroupID, map => map.Generator(Generators.GuidComb)); - ManyToOne(x => x.User, map => - { - map.Column("UserID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - - ManyToOne(x => x.Group, map => - { - map.Column("GroupID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - - } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/Customer.cs b/Tanshu.Accounts.Contracts/Data Contracts/Customer.cs new file mode 100644 index 0000000..a6838e2 --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/Customer.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +namespace Tanshu.Accounts.Entities +{ + public class Customer + { + public Guid CustomerID { get; set; } + public string Name { get; set; } + public string Address { get; set; } + public bool Important { get; set; } + public string Phone { get; set; } + public string Remarks { get; set; } + public List Vouchers { get; set; } + } +} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/CustomerBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/CustomerBO.cs deleted file mode 100644 index 5520368..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/CustomerBO.cs +++ /dev/null @@ -1,33 +0,0 @@ -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; -using System; -using System.Collections.Generic; -namespace Tanshu.Accounts.Entities -{ - public class Customer - { - public virtual Guid CustomerID { get; set; } - public virtual string Name { get; set; } - public virtual string Address { get; set; } - public virtual bool Important { get; set; } - public virtual string Phone { get; set; } - public virtual string Remarks { get; set; } - public virtual IList Vouchers { get; set; } - } - public class CustomerMap : ClassMapping - { - public CustomerMap() - { - Table("Customers"); - Schema("dbo"); - Lazy(true); - Id(x => x.CustomerID, map => map.Generator(Generators.GuidComb)); - Property(x => x.Name, map => { map.NotNullable(true); map.Unique(true); }); - Property(x => x.Address); - Property(x => x.Important); - Property(x => x.Phone); - Property(x => x.Remarks); - Bag(x => x.Vouchers, colmap => { colmap.Key(x => x.Column("CustomerID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/FoodTable.cs b/Tanshu.Accounts.Contracts/Data Contracts/FoodTable.cs new file mode 100644 index 0000000..a7feedd --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/FoodTable.cs @@ -0,0 +1,16 @@ +using System; + +namespace Tanshu.Accounts.Entities +{ + public class FoodTable + { + public Guid FoodTableID { get; set; } + public string Name { get; set; } + public bool IsActive { get; set; } + public string Location { get; set; } + public string Status { get; set; } + public int SortOrder { get; set; } + public Guid? VoucherID { get; set; } + } + +} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/FoodTableBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/FoodTableBO.cs deleted file mode 100644 index dbb6743..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/FoodTableBO.cs +++ /dev/null @@ -1,32 +0,0 @@ -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; -using System; -namespace Tanshu.Accounts.Entities -{ - public class FoodTable - { - public virtual Guid FoodTableID { get; set; } - public virtual string Name { get; set; } - public virtual bool IsActive { get; set; } - public virtual string Location { get; set; } - public virtual string Status { get; set; } - public virtual int SortOrder { get; set; } - public virtual Guid? VoucherID { get; set; } - } - public class FoodTableMap : ClassMapping - { - public FoodTableMap() - { - Table("FoodTables"); - Schema("dbo"); - Lazy(true); - Id(x => x.FoodTableID, map => map.Generator(Generators.GuidComb)); - Property(x => x.Name, map => { map.NotNullable(true); map.Unique(true); }); - Property(x => x.IsActive); - Property(x => x.Location); - Property(x => x.Status); - Property(x => x.VoucherID); - Property(x => x.SortOrder); - } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/Inventory.cs b/Tanshu.Accounts.Contracts/Data Contracts/Inventory.cs new file mode 100644 index 0000000..3f92615 --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/Inventory.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; + +namespace Tanshu.Accounts.Entities +{ + public class Inventory + { + public Inventory() + { + InventoryModifier = new List(); + } + + public Guid InventoryID { get; set; } + public Kot Kot { get; set; } + public int SortOrder { get; set; } + public Product Product { get; set; } + public decimal Quantity { get; set; } + public decimal Price { get; set; } + public bool IsHappyHour { get; set; } + public decimal ServiceCharge { get; set; } + public bool IsScTaxable { get; set; } + public decimal ServiceTaxRate { get; set; } + public decimal VatRate { get; set; } + public Tax ServiceTax { get; set; } + public Tax Vat { get; set; } + public decimal Discount { get; set; } + + public virtual List InventoryModifier { get; set; } + + public virtual string EffectiveName + { + get + { + return IsHappyHour ? string.Format("H H {0}", Product.FullName) : Product.FullName; + } + set { } + } + public virtual decimal EffectivePrice + { + get + { + return IsHappyHour ? 0 : Price; + } + set { } + } + public virtual decimal Amount + { + get + { + if (IsScTaxable) + return Quantity * EffectivePrice * (1 - Discount) * (1 + ServiceCharge) * (1 + ServiceTaxRate + VatRate); + return Quantity * EffectivePrice * (1 - Discount) * (1 + ServiceCharge + ServiceTaxRate + VatRate); + } + set { } + } + + public virtual decimal ServiceTaxAmount + { + get + { + if (IsScTaxable) + return Quantity * EffectivePrice * (1 - Discount) * (1 + ServiceCharge) * ServiceTaxRate; + return Quantity * EffectivePrice * (1 - Discount) * ServiceTaxRate; + } + } + + public virtual decimal VatAmount + { + get + { + if (IsScTaxable) + return Quantity * EffectivePrice * (1 - Discount) * (1 + ServiceCharge) * VatRate; + return Quantity * EffectivePrice * (1 - Discount) * VatRate; + } + } + + public virtual decimal ServiceChargeAmount + { + get + { + return Quantity * EffectivePrice * (1 - Discount) * ServiceCharge; + } + } + + public virtual decimal DiscountAmount + { + get + { + return Quantity * EffectivePrice * Discount; + } + } + + public virtual decimal Net + { + get + { + return Quantity * EffectivePrice * (1 - Discount); + } + } + } +} \ No newline at end of file diff --git a/Tanshu.Accounts.Contracts/Data Contracts/InventoryBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/InventoryBO.cs deleted file mode 100644 index 7cff58b..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/InventoryBO.cs +++ /dev/null @@ -1,156 +0,0 @@ -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; -using System; -using System.Collections.Generic; - -namespace Tanshu.Accounts.Entities -{ - public class Inventory - { - public Inventory() - { - InventoryModifier = new List(); - } - - public virtual Guid InventoryID { get; set; } - public virtual Kot Kot { get; set; } - public virtual int SortOrder { get; set; } - public virtual Product Product { get; set; } - public virtual decimal Quantity { get; set; } - public virtual decimal Price { get; set; } - public virtual bool IsHappyHour { get; set; } - public virtual decimal ServiceCharge { get; set; } - public virtual bool IsScTaxable { get; set; } - public virtual decimal ServiceTaxRate { get; set; } - public virtual decimal VatRate { get; set; } - public virtual Tax ServiceTax { get; set; } - public virtual Tax Vat { get; set; } - public virtual decimal Discount { get; set; } - - public virtual IList InventoryModifier { get; set; } - - public virtual string EffectiveName - { - get - { - return IsHappyHour ? string.Format("H H {0}", Product.FullName) : Product.FullName; - } - set { } - } - public virtual decimal EffectivePrice - { - get - { - return IsHappyHour ? 0 : Price; - } - set { } - } - public virtual decimal Amount - { - get - { - if (IsScTaxable) - return Quantity * EffectivePrice * (1 - Discount) * (1 + ServiceCharge) * (1 + ServiceTaxRate + VatRate); - return Quantity * EffectivePrice * (1 - Discount) * (1 + ServiceCharge + ServiceTaxRate + VatRate); - } - set { } - } - - public virtual decimal ServiceTaxAmount - { - get - { - if (IsScTaxable) - return Quantity * EffectivePrice * (1 - Discount) * (1 + ServiceCharge) * ServiceTaxRate; - return Quantity * EffectivePrice * (1 - Discount) * ServiceTaxRate; - } - } - - public virtual decimal VatAmount - { - get - { - if (IsScTaxable) - return Quantity * EffectivePrice * (1 - Discount) * (1 + ServiceCharge) * VatRate; - return Quantity * EffectivePrice * (1 - Discount) * VatRate; - } - } - - public virtual decimal ServiceChargeAmount - { - get - { - return Quantity * EffectivePrice * (1 - Discount) * ServiceCharge; - } - } - - public virtual decimal DiscountAmount - { - get - { - return Quantity * EffectivePrice * Discount; - } - } - - public virtual decimal Net - { - get - { - return Quantity * EffectivePrice * (1 - Discount); - } - } - } - public class InventoryMap : ClassMapping - { - public InventoryMap() - { - Table("Inventories"); - Schema("dbo"); - Lazy(true); - Id(x => x.InventoryID, m => m.Generator(Generators.GuidComb)); - Property(x => x.SortOrder, map => map.NotNullable(true)); - Property(x => x.Quantity, map => map.NotNullable(true)); - Property(x => x.Price, map => map.NotNullable(true)); - Property(x => x.IsHappyHour, map => map.NotNullable(true)); - Property(x => x.ServiceTaxRate, map => map.NotNullable(true)); - Property(x => x.VatRate, map => map.NotNullable(true)); - Property(x => x.Discount, map => map.NotNullable(true)); - Property(x => x.ServiceCharge, map => map.NotNullable(true)); - Property(x => x.IsScTaxable, map => map.NotNullable(true)); - Property(x => x.EffectivePrice, map => - { - map.Formula("CASE WHEN IsHappyHour = 1 THEN 0 ELSE Price END"); - }); - Property(x => x.Amount, map => - { - map.Formula("Quantity * CASE WHEN IsHappyHour = 1 THEN 0 ELSE Price END * (1 - Discount) * CASE WHEN IsScTaxable = 1 THEN (1 + ServiceCharge) * (1 + ServiceTaxRate + VatRate) ELSE (1 + ServiceCharge + ServiceTaxRate + VatRate) END"); - }); - - ManyToOne(x => x.ServiceTax, map => - { - map.Column("ServiceTaxID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - ManyToOne(x => x.Vat, map => - { - map.Column("VatID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - ManyToOne(x => x.Kot, map => - { - map.Column("KotID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - ManyToOne(x => x.Product, map => - { - map.Column("ProductID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - Bag(x => x.InventoryModifier, colmap => { colmap.Key(x => x.Column("InventoryID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - } - } -} \ No newline at end of file diff --git a/Tanshu.Accounts.Contracts/Data Contracts/InventoryModifier.cs b/Tanshu.Accounts.Contracts/Data Contracts/InventoryModifier.cs new file mode 100644 index 0000000..4fe6d9f --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/InventoryModifier.cs @@ -0,0 +1,12 @@ +using System; + +namespace Tanshu.Accounts.Entities +{ + public class InventoryModifier + { + public Guid InventoryModifierID { get; set; } + public Inventory Inventory { get; set; } + public Modifier Modifier { get; set; } + public decimal Price { get; set; } + } +} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/InventoryModifierBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/InventoryModifierBO.cs deleted file mode 100644 index 9751e43..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/InventoryModifierBO.cs +++ /dev/null @@ -1,39 +0,0 @@ -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; -using System; - -namespace Tanshu.Accounts.Entities -{ - public class InventoryModifier - { - public virtual Guid InventoryModifierID { get; set; } - public virtual Inventory Inventory { get; set; } - public virtual Modifier Modifier { get; set; } - } - public class InventoryModifierMap : ClassMapping - { - - public InventoryModifierMap() - { - Table("InventoryModifiers"); - Schema("dbo"); - Lazy(true); - Id(x => x.InventoryModifierID, map => map.Generator(Generators.GuidComb)); - ManyToOne(x => x.Inventory, map => - { - map.Column("InventoryID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - - ManyToOne(x => x.Modifier, map => - { - map.Column("ModifierID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - - } - } - -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/Kot.cs b/Tanshu.Accounts.Contracts/Data Contracts/Kot.cs new file mode 100644 index 0000000..95eab7a --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/Kot.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; + +namespace Tanshu.Accounts.Entities +{ + public class Kot + { + public Kot() + { + Inventories = new List(); + Printed = false; + } + public Guid KotID { get; set; } + public Voucher Voucher { get; set; } + public int Code { private set; get; } + public FoodTable Table { get; set; } + public bool Printed { get; set; } + public DateTime Date { get; set; } + public User User { get; set; } + public List Inventories { get; set; } + } +} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/KotBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/KotBO.cs deleted file mode 100644 index e5507a7..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/KotBO.cs +++ /dev/null @@ -1,78 +0,0 @@ -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; -using System; -using System.Collections.Generic; -using Tanshu.Accounts.Entities.Auth; - -namespace Tanshu.Accounts.Entities -{ - public class Kot - { - public Kot() - { - Inventories = new List(); - Printed = false; - } - public virtual Guid KotID { get; set; } - public virtual Voucher Voucher { get; set; } - protected int _code; - public virtual int Code { get { return _code; } } - public virtual FoodTable Table { get; set; } - public virtual bool Printed { get; set; } - public virtual DateTime Date { get; set; } - public virtual User User { get; set; } - public virtual IList Inventories { get; set; } - } - public class KotMap : ClassMapping - { - - public KotMap() - { - Table("Kots"); - Schema("dbo"); - Lazy(true); - SqlInsert(@"exec KotInsert ?,?,?,?,?"); - Id(x => x.KotID, map => map.Generator(Generators.GuidComb)); - Property(x => x.Code, map => - { - map.NotNullable(true); - map.Unique(true); - map.Generated(PropertyGeneration.Insert); - map.Access(Accessor.NoSetter); - }); - Property(x => x.Printed, map => map.NotNullable(true)); - Property(x => x.Date, map => - { - map.NotNullable(true); - map.Generated(PropertyGeneration.Insert); - }); - ManyToOne(x => x.Voucher, map => - { - map.Column("VoucherID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - - ManyToOne(x => x.Table, map => - { - map.Column("TableID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - - ManyToOne(x => x.User, map => - { - map.Column("UserID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - - Bag(x => x.Inventories, colmap => - { - colmap.Key(x => x.Column("KotID")); - colmap.Inverse(true); - colmap.OrderBy(x => x.SortOrder); - }, map => { map.OneToMany(); }); - } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/MachineLocation.cs b/Tanshu.Accounts.Contracts/Data Contracts/MachineLocation.cs new file mode 100644 index 0000000..67d72a4 --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/MachineLocation.cs @@ -0,0 +1,11 @@ +using System; + +namespace Tanshu.Accounts.Entities +{ + public class MachineLocation + { + public Guid MachineLocationID { get; set; } + public string Machine { get; set; } + public string Location { get; set; } + } +} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/MachineLocationBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/MachineLocationBO.cs deleted file mode 100644 index 0f29b32..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/MachineLocationBO.cs +++ /dev/null @@ -1,25 +0,0 @@ -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; -using System; - -namespace Tanshu.Accounts.Entities -{ - public class MachineLocation - { - public virtual Guid MachineLocationID { get; set; } - public virtual string Machine { get; set; } - public virtual string Location { get; set; } - } - public class MachineLocationMap : ClassMapping - { - public MachineLocationMap() - { - Table("MachineLocations"); - Schema("dbo"); - Lazy(true); - Id(x => x.MachineLocationID, map => map.Generator(Generators.GuidComb)); - Property(x => x.Machine, map => { map.Unique(true); map.NotNullable(true); }); - Property(x => x.Location, map => map.NotNullable(true)); - } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/Modifier.cs b/Tanshu.Accounts.Contracts/Data Contracts/Modifier.cs new file mode 100644 index 0000000..172ed5c --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/Modifier.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +namespace Tanshu.Accounts.Entities +{ + public class Modifier + { + public Guid ModifierID { get; set; } + public string Name { get; set; } + public bool ShowInBill { get; set; } + public decimal Price { get; set; } + + public List ProductGroupModifiers { get; set; } + public List InventoryModifiers { get; set; } + } +} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ModifierBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/ModifierBO.cs deleted file mode 100644 index 8dd20e2..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/ModifierBO.cs +++ /dev/null @@ -1,38 +0,0 @@ -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; -using System; -using System.Collections.Generic; - -namespace Tanshu.Accounts.Entities -{ - public class Modifier - { - public Modifier() - { - ProductGroupModifiers = new List(); - InventoryModifiers = new List(); - } - public virtual Guid ModifierID { get; set; } - public virtual string Name { get; set; } - public virtual bool ShowInBill { get; set; } - public virtual decimal Price { get; set; } - - public virtual IList ProductGroupModifiers { get; set; } - public virtual IList InventoryModifiers { get; set; } - } - public class ModifierMap : ClassMapping - { - public ModifierMap() - { - Table("Modifiers"); - Schema("dbo"); - Lazy(true); - Id(x => x.ModifierID, m => m.Generator(Generators.GuidComb)); - Property(x => x.Name, map => { map.NotNullable(true); map.Unique(true); }); - Property(x => x.ShowInBill, map => { map.NotNullable(true); }); - Property(x => x.Price, map => { map.NotNullable(true); }); - Bag(x => x.InventoryModifiers, colmap => { colmap.Key(x => x.Column("ModifierID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - Bag(x => x.ProductGroupModifiers, colmap => { colmap.Key(x => x.Column("ModifierID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/Permission.cs b/Tanshu.Accounts.Contracts/Data Contracts/Permission.cs new file mode 100644 index 0000000..e3164ab --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/Permission.cs @@ -0,0 +1,10 @@ +using System; + +namespace Tanshu.Accounts.Entities +{ + public class Permission + { + public Guid PermissionID { get; set; } + public string Name { get; set; } + } +} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/PrintLocation.cs b/Tanshu.Accounts.Contracts/Data Contracts/PrintLocation.cs new file mode 100644 index 0000000..d54ac6a --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/PrintLocation.cs @@ -0,0 +1,45 @@ +using System; + +namespace Tanshu.Accounts.Entities +{ + public class PrintLocation + { + public Guid PrintLocationID { get; set; } + public ProductGroup ProductGroup { get; set; } + public string Location { get; set; } + public string Printer { get; set; } + public int Copies { get; set; } + public string CutCode { get; set; } + + public override int GetHashCode() + { + return Location.GetHashCode() ^ Printer.GetHashCode() ^ Copies.GetHashCode() ^ CutCode.GetHashCode(); + } + + public static bool operator ==(PrintLocation a, PrintLocation b) + { + if (object.ReferenceEquals(null, a)) + return object.ReferenceEquals(null, b); + + if (!(a is PrintLocation)) + return false; + if (!(b is PrintLocation)) + return false; + + return a.Location == b.Location && a.Printer == b.Printer && a.Copies == b.Copies && a.CutCode == b.CutCode; + } + + public static bool operator !=(PrintLocation a, PrintLocation b) + { + return !(a == b); + } + + public override bool Equals(Object obj) + { + if (obj is PrintLocation) + return (this == (PrintLocation)obj); + else + return false; + } + } +} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/PrintLocationBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/PrintLocationBO.cs deleted file mode 100644 index 9026ec5..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/PrintLocationBO.cs +++ /dev/null @@ -1,67 +0,0 @@ -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; -using System; - -namespace Tanshu.Accounts.Entities -{ - public class PrintLocation - { - public virtual Guid PrintLocationID { get; set; } - public virtual ProductGroup ProductGroup { get; set; } - public virtual string Location { get; set; } - public virtual string Printer { get; set; } - public virtual int Copies { get; set; } - public virtual string CutCode { get; set; } - - public override int GetHashCode() - { - return Location.GetHashCode() ^ Printer.GetHashCode() ^ Copies.GetHashCode() ^ CutCode.GetHashCode(); - } - - public static bool operator ==(PrintLocation a, PrintLocation b) - { - if (object.ReferenceEquals(null, a)) - return object.ReferenceEquals(null, b); - - if (!(a is PrintLocation)) - return false; - if (!(b is PrintLocation)) - return false; - - return a.Location == b.Location && a.Printer == b.Printer && a.Copies == b.Copies && a.CutCode == b.CutCode; - } - - public static bool operator !=(PrintLocation a, PrintLocation b) - { - return !(a == b); - } - - public override bool Equals(System.Object obj) - { - if (obj is PrintLocation) - return (this == (PrintLocation)obj); - else - return false; - } - } - public class PrintLocationMap : ClassMapping - { - public PrintLocationMap() - { - Table("PrintLocations"); - Schema("dbo"); - Lazy(true); - Id(x => x.PrintLocationID, map => map.Generator(Generators.GuidComb)); - Property(x => x.Location); - Property(x => x.Printer); - Property(x => x.Copies); - Property(x => x.CutCode); - ManyToOne(x => x.ProductGroup, map => - { - map.Column("ProductGroupID"); - map.Cascade(Cascade.None); - }); - - } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/Product.cs b/Tanshu.Accounts.Contracts/Data Contracts/Product.cs new file mode 100644 index 0000000..ae5db02 --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/Product.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; + +namespace Tanshu.Accounts.Entities +{ + public class Product + { + public Guid ProductID { get; set; } + public string Name { get; set; } + public string Units { get; set; } + public ProductGroup ProductGroup { get; set; } + public Tax Vat { get; set; } + public Tax ServiceTax { get; set; } + public decimal ServiceCharge { get; set; } + public bool IsScTaxable { get; set; } + public decimal Price { get; set; } + public bool HasHappyHour { get; set; } + public bool IsActive { get; set; } + public bool IsNotAvailable { get; set; } + public int SortOrder { get; set; } + public decimal Quantity { get; set; } + public List Inventories { get; set; } + + public virtual string FullName + { + get + { + return Units == string.Empty ? Name : string.Format("{0} ({1})", Name, Units); + } + set { } + } + } +} \ No newline at end of file diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ProductBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/ProductBO.cs deleted file mode 100644 index 057cbfd..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/ProductBO.cs +++ /dev/null @@ -1,66 +0,0 @@ -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; -using System; -using System.Collections.Generic; - -namespace Tanshu.Accounts.Entities -{ - public class Product - { - public virtual Guid ProductID { get; set; } - public virtual string Name { get; set; } - public virtual string Units { get; set; } - public virtual ProductGroup ProductGroup { get; set; } - public virtual Tax Vat { get; set; } - public virtual Tax ServiceTax { get; set; } - public virtual decimal ServiceCharge { get; set; } - public virtual bool IsScTaxable { get; set; } - public virtual decimal Price { get; set; } - public virtual bool HasHappyHour { get; set; } - public virtual bool IsActive { get; set; } - public virtual bool IsNotAvailable { get; set; } - public virtual int SortOrder { get; set; } - public virtual decimal Quantity { get; set; } - public virtual IList Inventories { get; set; } - - public virtual string FullName - { - get - { - return Units == string.Empty ? Name : string.Format("{0} ({1})", Name, Units); - } - set { } - } - } - public class ProductMap : ClassMapping - { - - public ProductMap() - { - Table("Products"); - Schema("dbo"); - Lazy(true); - Id(x => x.ProductID, map => map.Generator(Generators.GuidComb)); - Property(x => x.Name, map => { map.NotNullable(true); map.UniqueKey("UQ_NameUnits"); }); - Property(x => x.Units, map => { map.NotNullable(true); map.UniqueKey("UQ_NameUnits"); }); - Property(x => x.ServiceCharge, map => map.NotNullable(true)); - Property(x => x.IsScTaxable, map => map.NotNullable(true)); - Property(x => x.Price, map => map.NotNullable(true)); - Property(x => x.HasHappyHour, map => map.NotNullable(true)); - Property(x => x.IsActive, map => map.NotNullable(true)); - Property(x => x.IsNotAvailable, map => map.NotNullable(true)); - Property(x => x.SortOrder, map => map.NotNullable(true)); - Property(x => x.Quantity, map => map.NotNullable(true)); - Property(x => x.FullName, map => - { - map.Formula("CASE WHEN Units = '' THEN Name ELSE Name + ' (' + Units + ')' END"); - }); - - ManyToOne(x => x.ProductGroup, map => { map.Column("ProductGroupID"); map.Cascade(Cascade.None); }); - ManyToOne(x => x.ServiceTax, map => { map.Column("ServiceTaxID"); map.Cascade(Cascade.None); }); - ManyToOne(x => x.Vat, map => { map.Column("VatID"); map.Cascade(Cascade.None); }); - Bag(x => x.Inventories, colmap => { colmap.Key(x => x.Column("ProductID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - } - } - -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ProductGroup.cs b/Tanshu.Accounts.Contracts/Data Contracts/ProductGroup.cs new file mode 100644 index 0000000..c3e31ab --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/ProductGroup.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +namespace Tanshu.Accounts.Entities +{ + public class ProductGroup + { + public ProductGroup() + { + Products = new List(); + } + + public virtual Guid ProductGroupID { get; set; } + + public string Name { get; set; } + public decimal DiscountLimit { get; set; } + public bool IsModifierCompulsory { get; set; } + public bool IsActive { get; set; } + public int SortOrder { get; set; } + public string GroupType { get; set; } + public List Products { get; set; } + public List PrintLocations { get; set; } + public List ProductGroupModifiers { get; set; } + } +} \ No newline at end of file diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupBO.cs deleted file mode 100644 index 9c5150d..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupBO.cs +++ /dev/null @@ -1,47 +0,0 @@ -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; -using System; -using System.Collections.Generic; - -namespace Tanshu.Accounts.Entities -{ - public class ProductGroup - { - public ProductGroup() - { - Products = new List(); - } - - public virtual Guid ProductGroupID { get; set; } - - public virtual string Name { get; set; } - public virtual decimal DiscountLimit { get; set; } - public virtual bool IsModifierCompulsory { get; set; } - public virtual bool IsActive { get; set; } - public virtual int SortOrder { get; set; } - public virtual string GroupType { get; set; } - public virtual IList Products { get; set; } - public virtual IList PrintLocations { get; set; } - public virtual IList ProductGroupModifiers { get; set; } - } - public class ProductGroupMap : ClassMapping - { - - public ProductGroupMap() - { - Table("ProductGroups"); - Schema("dbo"); - Lazy(true); - Id(x => x.ProductGroupID, map => map.Generator(Generators.GuidComb)); - Property(x => x.Name, map => { map.NotNullable(true); map.Unique(true); }); - Property(x => x.IsActive, map => map.NotNullable(true)); - Property(x => x.SortOrder, map => map.NotNullable(true)); - Property(x => x.DiscountLimit, map => map.NotNullable(true)); - Property(x => x.IsModifierCompulsory, map => map.NotNullable(true)); - Property(x => x.GroupType, map => map.NotNullable(true)); - Bag(x => x.PrintLocations, colmap => { colmap.Key(x => x.Column("ProductGroupID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - Bag(x => x.ProductGroupModifiers, colmap => { colmap.Key(x => x.Column("ProductGroupID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - Bag(x => x.Products, colmap => { colmap.Key(x => x.Column("ProductGroupID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - } - } -} \ No newline at end of file diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupModifier.cs b/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupModifier.cs new file mode 100644 index 0000000..631e6de --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupModifier.cs @@ -0,0 +1,12 @@ +using System; + +namespace Tanshu.Accounts.Entities +{ + public class ProductGroupModifier + { + public Guid ProductGroupModifierID { get; set; } + public ProductGroup ProductGroup { get; set; } + public Modifier Modifier { get; set; } + public bool ShowAutomatically { get; set; } + } +} \ No newline at end of file diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupModifierBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupModifierBO.cs deleted file mode 100644 index f13cc13..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupModifierBO.cs +++ /dev/null @@ -1,34 +0,0 @@ -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; -using System; - -namespace Tanshu.Accounts.Entities -{ - public class ProductGroupModifier - { - public virtual Guid ProductGroupModifierID { get; set; } - public virtual ProductGroup ProductGroup { get; set; } - public virtual Modifier Modifier { get; set; } - public virtual bool ShowAutomatically { get; set; } - } - public class ProductGroupModifierMap : ClassMapping - { - - public ProductGroupModifierMap() - { - Table("ProductGroupModifiers"); - Schema("dbo"); - Lazy(true); - Id(x => x.ProductGroupModifierID, map => map.Generator(Generators.GuidComb)); - Property(x => x.ShowAutomatically, map => map.NotNullable(true)); - ManyToOne(x => x.ProductGroup, map => - { - map.Column("ProductGroupID"); - map.Cascade(Cascade.None); - }); - - ManyToOne(x => x.Modifier, map => { map.Column("ModifierID"); map.Cascade(Cascade.None); }); - - } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/Reprint.cs b/Tanshu.Accounts.Contracts/Data Contracts/Reprint.cs new file mode 100644 index 0000000..da4703e --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/Reprint.cs @@ -0,0 +1,12 @@ +using System; + +namespace Tanshu.Accounts.Entities +{ + public class Reprint + { + public Guid ReprintID { get; set; } + public User User { get; set; } + public DateTime Date { private set; get; } + public Voucher Voucher { get; set; } + } +} \ No newline at end of file diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ReprintBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/ReprintBO.cs deleted file mode 100644 index 3c23ace..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/ReprintBO.cs +++ /dev/null @@ -1,48 +0,0 @@ -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; -using System; -using Tanshu.Accounts.Entities.Auth; - -namespace Tanshu.Accounts.Entities -{ - public class Reprint - { - public virtual Guid ReprintID { get; set; } - public virtual User User { get; set; } - protected DateTime _date; - public virtual DateTime Date { get { return _date; } } - public virtual Voucher Voucher { get; set; } - } - public class ReprintMap : ClassMapping - { - - public ReprintMap() - { - Table("Reprints"); - Schema("dbo"); - Lazy(true); - SqlInsert(@"exec ReprintInsert ?,?,?"); - Id(x => x.ReprintID, map => map.Generator(Generators.GuidComb)); - Property(x => x.Date, map => - { - map.NotNullable(true); - map.Generated(PropertyGeneration.Insert); - map.Access(Accessor.NoSetter); - }); - ManyToOne(x => x.User, map => - { - map.Column("UserID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - - ManyToOne(x => x.Voucher, map => - { - map.Column("VoucherID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - - } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/Role.cs b/Tanshu.Accounts.Contracts/Data Contracts/Role.cs new file mode 100644 index 0000000..8b353e4 --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/Role.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +namespace Tanshu.Accounts.Entities +{ + public class Role + { + public Guid RoleID { get; set; } + public string Name { get; set; } + public List Permissions { get; set; } + public Role() + { + Permissions = new List(); + } + } +} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/Setting.cs b/Tanshu.Accounts.Contracts/Data Contracts/Setting.cs new file mode 100644 index 0000000..62daa37 --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/Setting.cs @@ -0,0 +1,11 @@ +using System; + +namespace Tanshu.Accounts.Entities +{ + public class Setting + { + public Guid SettingID { get; set; } + public string Name { get; set; } + public dynamic Details { get; set; } + } +} \ No newline at end of file diff --git a/Tanshu.Accounts.Contracts/Data Contracts/SettingBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/SettingBO.cs deleted file mode 100644 index 30c59c4..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/SettingBO.cs +++ /dev/null @@ -1,26 +0,0 @@ -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; -using System; - -namespace Tanshu.Accounts.Entities -{ - public class Setting - { - public virtual Guid SettingID { get; set; } - public virtual string Name { get; set; } - public virtual string Details { get; set; } - } - public class SettingMap : ClassMapping - { - - public SettingMap() - { - Table("Settings"); - Schema("dbo"); - Lazy(false); - Id(x => x.SettingID, map => map.Generator(Generators.GuidComb)); - Property(x => x.Name, map => { map.NotNullable(true); map.Unique(true); }); - Property(x => x.Details, map => map.NotNullable(true)); - } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/Tax.cs b/Tanshu.Accounts.Contracts/Data Contracts/Tax.cs new file mode 100644 index 0000000..6ba845f --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/Tax.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; + +namespace Tanshu.Accounts.Entities +{ + public class Tax + { + public Guid TaxID { get; set; } + public string Name { get; set; } + public decimal Rate { get; set; } + public List ServiceTaxProducts { get; set; } + public List VatProducts { get; set; } + } +} \ No newline at end of file diff --git a/Tanshu.Accounts.Contracts/Data Contracts/TaxBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/TaxBO.cs deleted file mode 100644 index 25fdf5d..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/TaxBO.cs +++ /dev/null @@ -1,31 +0,0 @@ -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; -using System; -using System.Collections.Generic; - -namespace Tanshu.Accounts.Entities -{ - public class Tax - { - public virtual Guid TaxID { get; set; } - public virtual string Name { get; set; } - public virtual decimal Rate { get; set; } - public virtual IList ServiceTaxProducts { get; set; } - public virtual IList VatProducts { get; set; } - } - public class TaxMap : ClassMapping - { - - public TaxMap() - { - Table("Taxes"); - Schema("dbo"); - Lazy(true); - Id(x => x.TaxID, map => map.Generator(Generators.GuidComb)); - Property(x => x.Name, map => { map.NotNullable(true); map.Unique(true); }); - Property(x => x.Rate, map => map.NotNullable(true)); - Bag(x => x.ServiceTaxProducts, colmap => { colmap.Key(x => x.Column("ServiceTaxID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - Bag(x => x.VatProducts, colmap => { colmap.Key(x => x.Column("VatID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/User.cs b/Tanshu.Accounts.Contracts/Data Contracts/User.cs new file mode 100644 index 0000000..f92fe12 --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/User.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; + +namespace Tanshu.Accounts.Entities +{ + public class User + { + public Guid UserID { get; set; } + public string Name { get; set; } + public string MsrString { get; set; } + public string Password { get; set; } + public bool LockedOut { get; set; } + + public List Roles { get; set; } + public List Permissions { get; set; } + public User() + { + Roles = new List(); + Permissions = new List(); + } + } +} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/Voucher.cs b/Tanshu.Accounts.Contracts/Data Contracts/Voucher.cs new file mode 100644 index 0000000..b3cb262 --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/Voucher.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; + +namespace Tanshu.Accounts.Entities +{ + public class Voucher + { + public Voucher() + { + Kots = new List(); + Settlements = new List(); + } + + public Voucher(User user, Customer customer) + : this() + { + this.User = user; + VoucherType = VoucherType.Regular; + Customer = customer; + } + + public Voucher(User user, Customer customer, FoodTable table, bool printed, bool isVoid, string narration) + : this(user, customer) + { + Table = table; + Printed = printed; + Void = isVoid; + Narration = narration; + VoucherType = VoucherType.Regular; + } + + public Guid VoucherID { get; set; } + + public DateTime Date { private set; get; } + public int Pax { get; set; } + public User User { get; set; } + public DateTime CreationDate { private set; get; } + public DateTime LastEditDate { private set; get; } + public int? BillID { private set; get; } + public FoodTable Table { get; set; } + public Customer Customer { get; set; } + public List Settlements { get; set; } + public string Narration { get; set; } + public bool Void { get; set; } + public string VoidReason { get; set; } + public bool Printed { get; set; } + public VoucherType VoucherType { get; set; } + public int KotID { private set; get; } + public List Kots { get; set; } + public List Reprints { get; set; } + public string FullBillID + { + get + { + if (BillID.HasValue) + { + switch (VoucherType) + { + case VoucherType.NoCharge: + return "NC-" + BillID.Value.ToString(); + case VoucherType.Staff: + return "ST-" + BillID.Value.ToString(); + case VoucherType.TakeAway: + case VoucherType.Regular: + default: + return (BillID.Value / 10000).ToString() + "-" + (BillID.Value % 10000).ToString(); + } + } + else + { + return "K-" + KotID.ToString(); + } + } + } + } +} \ No newline at end of file diff --git a/Tanshu.Accounts.Contracts/Data Contracts/VoucherBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/VoucherBO.cs deleted file mode 100644 index 1c3857c..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/VoucherBO.cs +++ /dev/null @@ -1,161 +0,0 @@ -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; -using System; -using System.Collections.Generic; -using Tanshu.Accounts.Entities.Auth; - -namespace Tanshu.Accounts.Entities -{ - public class Voucher - { - public Voucher() - { - Kots = new List(); - Settlements = new List(); - } - - public Voucher(User user, Customer customer) - : this() - { - this.User = user; - VoucherType = VoucherType.Regular; - Customer = customer; - } - - public Voucher(User user, Customer customer, FoodTable table, bool printed, bool isVoid, string narration) - : this(user, customer) - { - Table = table; - Printed = printed; - Void = isVoid; - Narration = narration; - VoucherType = VoucherType.Regular; - } - - public virtual Guid VoucherID { get; set; } - - protected DateTime _date; - public virtual DateTime Date { get { return _date; } } - - public virtual int Pax { get; set; } - public virtual User User { get; set; } - protected DateTime _creationDate; - public virtual DateTime CreationDate { get { return _creationDate; } } - protected DateTime _lastEditDate; - public virtual DateTime LastEditDate { get { return _lastEditDate; } } - protected int? _billID; - public virtual int? BillID { get { return _billID; } } - public virtual FoodTable Table { get; set; } - public virtual Customer Customer { get; set; } - public virtual IList Settlements { get; set; } - public virtual string Narration { get; set; } - public virtual bool Void { get; set; } - public virtual string VoidReason { get; set; } - public virtual bool Printed { get; set; } - public virtual VoucherType VoucherType { get; set; } - protected int _kotID; - public virtual int KotID { get { return _kotID; } } - public virtual IList Kots { get; set; } - public virtual IList Reprints { get; set; } - public virtual string FullBillID - { - get - { - if (BillID.HasValue) - { - switch (VoucherType) - { - case VoucherType.NoCharge: - return "NC-" + BillID.Value.ToString(); - case VoucherType.Staff: - return "ST-" + BillID.Value.ToString(); - case VoucherType.TakeAway: - case VoucherType.Regular: - default: - return (BillID.Value / 10000).ToString() + "-" + (BillID.Value % 10000).ToString(); - } - } - else - { - return "K-" + KotID.ToString(); - } - } - } - } - - public class VoucherMap : ClassMapping - { - public VoucherMap() - { - Table("Vouchers"); - Schema("dbo"); - Lazy(true); - SqlInsert(@"exec VoucherInsert ?,?,?,?,?,?,?,?,?,?"); - SqlUpdate(@"exec VoucherUpdate ?,?,?,?,?,?,?,?,?,?"); - Id(x => x.VoucherID, map => map.Generator(Generators.GuidComb)); - Property(x => x.Date, map => - { - map.NotNullable(true); - map.Generated(PropertyGeneration.Always); - map.Access(Accessor.NoSetter); - }); - Property(x => x.Pax); - Property(x => x.VoucherType, map => - { - map.NotNullable(true); - map.UniqueKey("UQ_BillID_VoucherType"); - }); - Property(x => x.Narration); - Property(x => x.CreationDate, map => - { - map.NotNullable(true); - map.Generated(PropertyGeneration.Insert); - map.Access(Accessor.NoSetter); - }); - Property(x => x.LastEditDate, map => - { - map.NotNullable(true); - map.Generated(PropertyGeneration.Always); - map.Access(Accessor.NoSetter); - }); - Property(x => x.BillID, map => - { - map.Generated(PropertyGeneration.Always); - map.Access(Accessor.NoSetter); - map.UniqueKey("UQ_BillID_VoucherType"); - }); - Property(x => x.Void, map => map.NotNullable(true)); - Property(x => x.VoidReason); - Property(x => x.Printed, map => map.NotNullable(true)); - Property(x => x.KotID, map => - { - map.NotNullable(true); - map.Generated(PropertyGeneration.Insert); - map.Access(Accessor.NoSetter); - }); - ManyToOne(x => x.User, map => - { - map.Column("UserID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - ManyToOne(x => x.Table, map => - { - map.Column("TableID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - - ManyToOne(x => x.Customer, map => - { - map.Column("CustomerID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - - Bag(x => x.Kots, colmap => { colmap.Key(x => x.Column("VoucherID")); colmap.Inverse(true); colmap.OrderBy(o => o.Date); }, map => { map.OneToMany(); }); - Bag(x => x.Reprints, colmap => { colmap.Key(x => x.Column("VoucherID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - Bag(x => x.Settlements, colmap => { colmap.Key(x => x.Column("VoucherID")); colmap.Inverse(true); }, map => { map.OneToMany(); }); - } - } -} \ No newline at end of file diff --git a/Tanshu.Accounts.Contracts/Data Contracts/VoucherSettlement.cs b/Tanshu.Accounts.Contracts/Data Contracts/VoucherSettlement.cs new file mode 100644 index 0000000..e9950dd --- /dev/null +++ b/Tanshu.Accounts.Contracts/Data Contracts/VoucherSettlement.cs @@ -0,0 +1,12 @@ +using System; + +namespace Tanshu.Accounts.Entities +{ + public class VoucherSettlement + { + public Guid VoucherSettlementID { get; set; } + public Voucher Voucher { get; set; } + public SettleOption Settled { get; set; } + public decimal Amount { get; set; } + } +} \ No newline at end of file diff --git a/Tanshu.Accounts.Contracts/Data Contracts/VoucherSettlementBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/VoucherSettlementBO.cs deleted file mode 100644 index c0db348..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/VoucherSettlementBO.cs +++ /dev/null @@ -1,34 +0,0 @@ -using NHibernate.Mapping.ByCode; -using NHibernate.Mapping.ByCode.Conformist; -using System; - -namespace Tanshu.Accounts.Entities -{ - public class VoucherSettlement - { - public virtual Guid VoucherSettlementID { get; set; } - public virtual Voucher Voucher { get; set; } - public virtual SettleOption Settled { get; set; } - public virtual decimal Amount { get; set; } - } - public class VoucherSettlementMap : ClassMapping - { - - public VoucherSettlementMap() - { - Table("VoucherSettlements"); - Schema("dbo"); - Lazy(true); - Id(x => x.VoucherSettlementID, map => map.Generator(Generators.GuidComb)); - Property(x => x.Settled, map => map.NotNullable(true)); - Property(x => x.Amount, map => map.NotNullable(true)); - ManyToOne(x => x.Voucher, map => - { - map.Column("VoucherID"); - map.NotNullable(true); - map.Cascade(Cascade.None); - }); - - } - } -} \ No newline at end of file diff --git a/Tanshu.Accounts.Contracts/Tanshu.Accounts.Contracts.csproj b/Tanshu.Accounts.Contracts/Tanshu.Accounts.Contracts.csproj index 3be35db..44ecf74 100644 --- a/Tanshu.Accounts.Contracts/Tanshu.Accounts.Contracts.csproj +++ b/Tanshu.Accounts.Contracts/Tanshu.Accounts.Contracts.csproj @@ -10,7 +10,7 @@ Properties Tanshu.Accounts.Contracts Tanshu.Accounts.Contracts - v3.5 + v4.5.2 512 @@ -19,6 +19,22 @@ 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true true @@ -28,6 +44,7 @@ DEBUG;TRACE prompt 4 + false pdbonly @@ -36,16 +53,9 @@ TRACE prompt 4 + false - - False - ..\Include\NHibernate\Iesi.Collections.dll - - - False - ..\Include\NHibernate\NHibernate.dll - 3.5 @@ -64,48 +74,49 @@ - - False - ..\Include\Tanshu.Common.dll - - - + + + Code - - - - + + - - - - + + + - - - - - - - - - + + + + + + + + + - - + + + + + False + .NET Framework 3.5 SP1 + true + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Tanshu.Accounts.PointOfSale/User Management/ChangePassword.cs b/Tanshu.Accounts.PointOfSale/User Management/ChangePassword.cs index 0e13b4c..f4c0d06 100644 --- a/Tanshu.Accounts.PointOfSale/User Management/ChangePassword.cs +++ b/Tanshu.Accounts.PointOfSale/User Management/ChangePassword.cs @@ -1,10 +1,8 @@ using System; using System.Drawing; using System.Windows.Forms; -using Tanshu.Accounts.Repository; using Tanshu.Accounts.Contracts; -using Tanshu.Accounts.Helpers; -using Tanshu.Accounts.Entities.Auth; +using Tanshu.Accounts.Repository; using Tanshu.Common.KeyboardControl; namespace Tanshu.Accounts.PointOfSale @@ -51,9 +49,11 @@ namespace Tanshu.Accounts.PointOfSale MessageBox.Show("New password not matched to confirm password", "Password not matched"); else { - if (ChangeUserPassword()) + var changed = UserBI.ChangePassword(Session.User.Name, txtPassword.Text.Trim(), txtnewPassword.Text.Trim()); + if (changed) { - this.Close(); + MessageBox.Show("Password changed", "Confirm"); + this.Close(); } else MessageBox.Show("old Password not matched for user", "Wrong Password"); @@ -62,40 +62,22 @@ namespace Tanshu.Accounts.PointOfSale } } - private bool ChangeUserPassword() - { - using (var bi = new UserBI()) - { - var user = bi.ValidateUser(Session.User.Name, txtPassword.Text.Trim()); - if (user == null) - return false; - bi.ChangePassword(user, txtnewPassword.Text.Trim()); - bi.SaveChanges(); - MessageBox.Show("Password changed", "Confirm"); - return true; - } - } private void btnMsr_Click(object sender, EventArgs e) { - using (var bi = new UserBI()) + var user = UserBI.ValidateUser(Session.User.Name, txtPassword.Text.Trim()); + if (user == null) + return; + using (var frm = new MsrLoginForm(true)) { - var user = bi.ValidateUser(Session.User.Name, txtPassword.Text.Trim()); - if (user == null) + frm.ShowDialog(); + var msrString = frm.User().MsrString; + if (MessageBox.Show("Update Msr Card", "Update", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != + DialogResult.Yes) return; - using (var frm = new MsrLoginForm(true)) - { - frm.ShowDialog(); - var msrString = frm.User().MsrString; - if (MessageBox.Show("Update Msr Card", "Update", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != - DialogResult.Yes) - return; - user.MsrString = msrString; - bi.Update(user); - bi.SaveChanges(); - MessageBox.Show("Msr Card Updated"); - this.Close(); - } + UserBI.ChangeMsr(user.Name, txtPassword.Text.Trim(), msrString); + MessageBox.Show("Msr Card Updated"); + this.Close(); } } } diff --git a/Tanshu.Accounts.PointOfSale/User Management/RolesForm.Designer.cs b/Tanshu.Accounts.PointOfSale/User Management/RolesForm.Designer.cs new file mode 100644 index 0000000..2b77d63 --- /dev/null +++ b/Tanshu.Accounts.PointOfSale/User Management/RolesForm.Designer.cs @@ -0,0 +1,127 @@ +namespace Tanshu.Accounts.PointOfSale +{ + partial class RolesForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.cmbRole = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); + this.clbPermissions = new System.Windows.Forms.CheckedListBox(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnOk = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // cmbRole + // + this.cmbRole.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.cmbRole.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cmbRole.FormattingEnabled = true; + this.cmbRole.Location = new System.Drawing.Point(109, 15); + this.cmbRole.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cmbRole.Name = "cmbRole"; + this.cmbRole.Size = new System.Drawing.Size(499, 24); + this.cmbRole.TabIndex = 2; + this.cmbRole.SelectedIndexChanged += new System.EventHandler(this.cmbGroup_SelectedIndexChanged); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 15); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(78, 17); + this.label1.TabIndex = 4; + this.label1.Text = "Role Name"; + // + // clbPermissions + // + this.clbPermissions.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.clbPermissions.FormattingEnabled = true; + this.clbPermissions.Location = new System.Drawing.Point(16, 48); + this.clbPermissions.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.clbPermissions.Name = "clbPermissions"; + this.clbPermissions.Size = new System.Drawing.Size(592, 225); + this.clbPermissions.TabIndex = 21; + this.clbPermissions.Format += new System.Windows.Forms.ListControlConvertEventHandler(this.clbRoles_Format); + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.Location = new System.Drawing.Point(509, 290); + this.btnCancel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(100, 92); + this.btnCancel.TabIndex = 23; + this.btnCancel.Text = "&Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // btnOk + // + this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnOk.Location = new System.Drawing.Point(401, 290); + this.btnOk.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnOk.Name = "btnOk"; + this.btnOk.Size = new System.Drawing.Size(100, 92); + this.btnOk.TabIndex = 22; + this.btnOk.Text = "&Ok"; + this.btnOk.UseVisualStyleBackColor = true; + this.btnOk.Click += new System.EventHandler(this.btnOk_Click); + // + // RolesForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(625, 398); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOk); + this.Controls.Add(this.clbPermissions); + this.Controls.Add(this.label1); + this.Controls.Add(this.cmbRole); + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.MaximizeBox = false; + this.Name = "RolesForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Assign Permission Groups"; + this.Load += new System.EventHandler(this.RolesForm_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ComboBox cmbRole; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.CheckedListBox clbPermissions; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnOk; + } +} \ No newline at end of file diff --git a/Tanshu.Accounts.PointOfSale/User Management/RolesForm.cs b/Tanshu.Accounts.PointOfSale/User Management/RolesForm.cs new file mode 100644 index 0000000..a937421 --- /dev/null +++ b/Tanshu.Accounts.PointOfSale/User Management/RolesForm.cs @@ -0,0 +1,72 @@ +using System; +using System.Linq; +using System.Windows.Forms; +using Tanshu.Accounts.Entities; +using Tanshu.Accounts.Repository; + +namespace Tanshu.Accounts.PointOfSale +{ + public partial class RolesForm : Form + { + public RolesForm() + { + InitializeComponent(); + } + + private void RolesForm_Load(object sender, EventArgs e) + { + FillRoles(); + } + + private void FillRoles() + { + cmbRole.DisplayMember = "Name"; + cmbRole.ValueMember = "RoleID"; + cmbRole.DataSource = RoleBI.List(); + } + + private void cmbGroup_SelectedIndexChanged(object sender, EventArgs e) + { + if (cmbRole.SelectedValue == null) + GetPermissions(null); + else + GetPermissions((Role)cmbRole.SelectedItem); + } + + private void GetPermissions(Role role) + { + var permissions = RoleBI.Permissions(); + clbPermissions.DataSource = permissions; + if (role != null) + { + for (int i = 0; i < clbPermissions.Items.Count; i++) + { + var item = (Permission)clbPermissions.Items[i]; + clbPermissions.SetItemChecked(i, role.Permissions.Any(x => x.PermissionID == item.PermissionID)); + } + } + } + + private void btnCancel_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void btnOk_Click(object sender, EventArgs e) + { + if (cmbRole.SelectedValue != null) + Save((Role)cmbRole.SelectedItem); + } + private void Save(Role role) + { + role.Permissions = clbPermissions.CheckedItems.OfType().ToList(); + RoleBI.Update(role); + MessageBox.Show("Update / Save Successful"); + } + + private void clbRoles_Format(object sender, ListControlConvertEventArgs e) + { + e.Value = ((Permission)e.ListItem).Name; + } + } +} diff --git a/Tanshu.Accounts.PointOfSale/User Management/AssignGroupRoles.resx b/Tanshu.Accounts.PointOfSale/User Management/RolesForm.resx similarity index 97% rename from Tanshu.Accounts.PointOfSale/User Management/AssignGroupRoles.resx rename to Tanshu.Accounts.PointOfSale/User Management/RolesForm.resx index 19dc0dd..d58980a 100644 --- a/Tanshu.Accounts.PointOfSale/User Management/AssignGroupRoles.resx +++ b/Tanshu.Accounts.PointOfSale/User Management/RolesForm.resx @@ -112,9 +112,9 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file diff --git a/Tanshu.Accounts.PointOfSale/User Management/UserForm.Designer.cs b/Tanshu.Accounts.PointOfSale/User Management/UserForm.Designer.cs index 7995f88..61ff11a 100644 --- a/Tanshu.Accounts.PointOfSale/User Management/UserForm.Designer.cs +++ b/Tanshu.Accounts.PointOfSale/User Management/UserForm.Designer.cs @@ -38,56 +38,63 @@ this.btnSave = new System.Windows.Forms.Button(); this.txtRetype = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); + this.clbRoles = new System.Windows.Forms.CheckedListBox(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 12); + this.label1.Location = new System.Drawing.Point(16, 15); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(60, 13); + this.label1.Size = new System.Drawing.Size(79, 17); this.label1.TabIndex = 7; this.label1.Text = "User Name"; // // txtUsername // - this.txtUsername.Location = new System.Drawing.Point(78, 12); + this.txtUsername.Location = new System.Drawing.Point(104, 15); + this.txtUsername.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.txtUsername.Name = "txtUsername"; - this.txtUsername.Size = new System.Drawing.Size(188, 20); + this.txtUsername.Size = new System.Drawing.Size(249, 22); this.txtUsername.TabIndex = 0; // // txtPassword // - this.txtPassword.Location = new System.Drawing.Point(78, 38); + this.txtPassword.Location = new System.Drawing.Point(104, 47); + this.txtPassword.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.txtPassword.Name = "txtPassword"; - this.txtPassword.Size = new System.Drawing.Size(188, 20); + this.txtPassword.Size = new System.Drawing.Size(249, 22); this.txtPassword.TabIndex = 1; this.txtPassword.UseSystemPasswordChar = true; // // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(19, 38); + this.label2.Location = new System.Drawing.Point(25, 47); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(53, 13); + this.label2.Size = new System.Drawing.Size(69, 17); this.label2.TabIndex = 8; this.label2.Text = "Password"; // // chkLocked // this.chkLocked.AutoSize = true; - this.chkLocked.Location = new System.Drawing.Point(78, 90); + this.chkLocked.Location = new System.Drawing.Point(104, 111); + this.chkLocked.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.chkLocked.Name = "chkLocked"; - this.chkLocked.Size = new System.Drawing.Size(82, 17); + this.chkLocked.Size = new System.Drawing.Size(103, 21); this.chkLocked.TabIndex = 3; this.chkLocked.Text = "Locked Out"; this.chkLocked.UseVisualStyleBackColor = true; // // btnDelete // - this.btnDelete.Location = new System.Drawing.Point(96, 113); + this.btnDelete.Location = new System.Drawing.Point(125, 457); + this.btnDelete.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.btnDelete.Name = "btnDelete"; - this.btnDelete.Size = new System.Drawing.Size(78, 23); + this.btnDelete.Size = new System.Drawing.Size(104, 28); this.btnDelete.TabIndex = 5; this.btnDelete.Text = "&Delete"; this.btnDelete.UseVisualStyleBackColor = true; @@ -95,9 +102,10 @@ // // btnCancel // - this.btnCancel.Location = new System.Drawing.Point(180, 113); + this.btnCancel.Location = new System.Drawing.Point(274, 457); + this.btnCancel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(85, 23); + this.btnCancel.Size = new System.Drawing.Size(113, 28); this.btnCancel.TabIndex = 6; this.btnCancel.Text = "&Cancel"; this.btnCancel.UseVisualStyleBackColor = true; @@ -105,9 +113,10 @@ // // btnSave // - this.btnSave.Location = new System.Drawing.Point(12, 113); + this.btnSave.Location = new System.Drawing.Point(13, 457); + this.btnSave.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.btnSave.Name = "btnSave"; - this.btnSave.Size = new System.Drawing.Size(78, 23); + this.btnSave.Size = new System.Drawing.Size(104, 28); this.btnSave.TabIndex = 4; this.btnSave.Text = "&Save"; this.btnSave.UseVisualStyleBackColor = true; @@ -115,26 +124,39 @@ // // txtRetype // - this.txtRetype.Location = new System.Drawing.Point(78, 65); + this.txtRetype.Location = new System.Drawing.Point(104, 80); + this.txtRetype.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.txtRetype.Name = "txtRetype"; - this.txtRetype.Size = new System.Drawing.Size(188, 20); + this.txtRetype.Size = new System.Drawing.Size(249, 22); this.txtRetype.TabIndex = 2; this.txtRetype.UseSystemPasswordChar = true; // // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(31, 65); + this.label3.Location = new System.Drawing.Point(41, 80); + this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(41, 13); + this.label3.Size = new System.Drawing.Size(53, 17); this.label3.TabIndex = 9; this.label3.Text = "Retype"; // + // clbRoles + // + this.clbRoles.FormattingEnabled = true; + this.clbRoles.Location = new System.Drawing.Point(13, 140); + this.clbRoles.Margin = new System.Windows.Forms.Padding(4); + this.clbRoles.Name = "clbRoles"; + this.clbRoles.Size = new System.Drawing.Size(374, 293); + this.clbRoles.TabIndex = 23; + this.clbRoles.Format += new System.Windows.Forms.ListControlConvertEventHandler(this.clbRoles_Format); + // // UserForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(300, 148); + this.ClientSize = new System.Drawing.Size(400, 498); + this.Controls.Add(this.clbRoles); this.Controls.Add(this.txtRetype); this.Controls.Add(this.label3); this.Controls.Add(this.btnSave); @@ -145,6 +167,7 @@ this.Controls.Add(this.label2); this.Controls.Add(this.txtUsername); this.Controls.Add(this.label1); + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.MaximizeBox = false; this.Name = "UserForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; @@ -167,5 +190,6 @@ private System.Windows.Forms.Button btnSave; private System.Windows.Forms.TextBox txtRetype; private System.Windows.Forms.Label label3; + private System.Windows.Forms.CheckedListBox clbRoles; } } \ No newline at end of file diff --git a/Tanshu.Accounts.PointOfSale/User Management/UserForm.cs b/Tanshu.Accounts.PointOfSale/User Management/UserForm.cs index 5fb0261..bb1ffd4 100644 --- a/Tanshu.Accounts.PointOfSale/User Management/UserForm.cs +++ b/Tanshu.Accounts.PointOfSale/User Management/UserForm.cs @@ -1,7 +1,8 @@ using System; +using System.Linq; using System.Windows.Forms; +using Tanshu.Accounts.Entities; using Tanshu.Accounts.Repository; -using Tanshu.Accounts.Entities.Auth; namespace Tanshu.Accounts.PointOfSale { @@ -12,8 +13,7 @@ namespace Tanshu.Accounts.PointOfSale { InitializeComponent(); if (userID.HasValue) - using (var bi = new UserBI()) - _user = bi.Get(x => x.UserID == userID.Value); + _user = UserBI.Get(userID.Value); } private void btnCancel_Click(object sender, EventArgs e) @@ -23,49 +23,50 @@ namespace Tanshu.Accounts.PointOfSale private void btnDelete_Click(object sender, EventArgs e) { - using (var bi = new UserBI()) - { - bi.Delete(x => x.UserID == _user.UserID); - bi.SaveChanges(); - } + UserBI.Delete(_user.UserID); btnCancel_Click(sender, e); } private void UserForm_Load(object sender, EventArgs e) { + var roles = RoleBI.List(); + clbRoles.DataSource = roles; if (_user == null) return; txtUsername.Text = _user.Name; txtPassword.Text = _user.Password; txtRetype.Text = _user.Password; chkLocked.Checked = _user.LockedOut; + + for (int i = 0; i < clbRoles.Items.Count; i++) + { + var item = (Role)clbRoles.Items[i]; + clbRoles.SetItemChecked(i, _user.Roles.Any(x => x.RoleID == item.RoleID)); + } } private void Save() { - using (var bi = new UserBI()) - { - if (_user == null) - _user = new User(); - else - _user = bi.Get(x => x.UserID == _user.UserID); + if (_user == null) + _user = new User(); + else + _user = UserBI.Get(_user.UserID); - _user.Name = txtUsername.Text.Trim(); - if (_user.Password != txtPassword.Text.Trim()) - _user.Password = Common.Md5.Hash(txtPassword.Text.Trim(), "v2"); - _user.LockedOut = (chkLocked.Checked == true ? true : false); + _user.Name = txtUsername.Text.Trim(); + if (_user.Password != txtPassword.Text.Trim()) + _user.Password = txtPassword.Text.Trim(); + _user.LockedOut = (chkLocked.Checked == true ? true : false); + _user.Roles = clbRoles.CheckedItems.OfType().ToList(); - if (_user.UserID == Guid.Empty) - bi.Insert(_user); - else - bi.Update(_user); - bi.SaveChanges(); - } + if (_user.UserID == Guid.Empty) + UserBI.Insert(_user); + else + UserBI.Update(_user); } private void btnSave_Click(object sender, EventArgs e) { - if (txtUsername.Text.Trim() == "") + if (string.IsNullOrEmpty(txtUsername.Text.Trim())) { MessageBox.Show("Username cannot be blank."); txtUsername.Focus(); @@ -75,7 +76,7 @@ namespace Tanshu.Accounts.PointOfSale MessageBox.Show("Passwords do not match."); txtPassword.Focus(); } - else if (string.IsNullOrEmpty(txtPassword.Text.Trim())) + else if (_user == null && string.IsNullOrEmpty(txtPassword.Text.Trim())) { MessageBox.Show("Password cannot be empty."); txtPassword.Focus(); @@ -83,8 +84,13 @@ namespace Tanshu.Accounts.PointOfSale else { Save(); - btnCancel_Click(sender, e); + this.Close(); } } + + private void clbRoles_Format(object sender, ListControlConvertEventArgs e) + { + e.Value = ((Role)e.ListItem).Name; + } } } diff --git a/Tanshu.Accounts.PointOfSale/User Management/UserForm.resx b/Tanshu.Accounts.PointOfSale/User Management/UserForm.resx index 19dc0dd..d58980a 100644 --- a/Tanshu.Accounts.PointOfSale/User Management/UserForm.resx +++ b/Tanshu.Accounts.PointOfSale/User Management/UserForm.resx @@ -112,9 +112,9 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file diff --git a/Tanshu.Accounts.PointOfSale/User Management/UserListForm.Designer.cs b/Tanshu.Accounts.PointOfSale/User Management/UserListForm.Designer.cs index 71b1c66..17ba3ec 100644 --- a/Tanshu.Accounts.PointOfSale/User Management/UserListForm.Designer.cs +++ b/Tanshu.Accounts.PointOfSale/User Management/UserListForm.Designer.cs @@ -108,7 +108,7 @@ // // bsList // - this.bsList.DataSource = typeof(Tanshu.Accounts.Entities.Auth.User); + this.bsList.DataSource = typeof(Tanshu.Accounts.Entities.User); // // nameDataGridViewTextBoxColumn // diff --git a/Tanshu.Accounts.PointOfSale/User Management/UserListForm.cs b/Tanshu.Accounts.PointOfSale/User Management/UserListForm.cs index 5693568..43cdfb0 100644 --- a/Tanshu.Accounts.PointOfSale/User Management/UserListForm.cs +++ b/Tanshu.Accounts.PointOfSale/User Management/UserListForm.cs @@ -1,10 +1,9 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using Tanshu.Accounts.Entities; using Tanshu.Accounts.Repository; -using System.Collections.Generic; -using Tanshu.Accounts.Entities.Auth; namespace Tanshu.Accounts.PointOfSale { @@ -20,8 +19,7 @@ namespace Tanshu.Accounts.PointOfSale { using (var frm = new UserForm(null)) frm.ShowDialog(); - using (var bi = new UserBI()) - _list = bi.List(); + _list = UserBI.List(); bsList.DataSource = _list; } @@ -31,8 +29,7 @@ namespace Tanshu.Accounts.PointOfSale } private void ShowGrid() { - using (var bi = new UserBI()) - _list = bi.List(); + _list = UserBI.List(); bsList.DataSource = _list; } @@ -41,8 +38,7 @@ namespace Tanshu.Accounts.PointOfSale var id = ((User)bsList.Current).UserID; using (var frm = new UserForm(id)) frm.ShowDialog(); - using (var bi = new UserBI()) - _list = bi.List(); + _list = UserBI.List(); bsList.DataSource = _list; } @@ -68,7 +64,7 @@ namespace Tanshu.Accounts.PointOfSale if (e.ColumnIndex == dgvUsers.Columns["UserGroups"].Index) { - e.Value = string.Join(", ", data.UserGroups.Select(x => x.Group.Name).ToArray()); + e.Value = string.Join(", ", data.Roles.Select(x => x.Name).ToArray()); } var tax = e.Value as Tax; diff --git a/Tanshu.Accounts.PointOfSale/packages.config b/Tanshu.Accounts.PointOfSale/packages.config new file mode 100644 index 0000000..49c3860 --- /dev/null +++ b/Tanshu.Accounts.PointOfSale/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Tanshu.Accounts.Print/PlatformPrinter.cs b/Tanshu.Accounts.Print/PlatformPrinter.cs index 5194348..2bdf8b0 100644 --- a/Tanshu.Accounts.Print/PlatformPrinter.cs +++ b/Tanshu.Accounts.Print/PlatformPrinter.cs @@ -5,4 +5,4 @@ { internal abstract bool Print(string documentName, string printingText); } -} +} \ No newline at end of file diff --git a/Tanshu.Accounts.Print/PrinterTcpIp.cs b/Tanshu.Accounts.Print/PrinterTcpIp.cs new file mode 100644 index 0000000..5f79257 --- /dev/null +++ b/Tanshu.Accounts.Print/PrinterTcpIp.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tanshu.Accounts.Print +{ + internal static class PrinterTcpIp + { + internal static bool Print(string printerName, string documentName, string printingText) + { + // Printer IP Address and communication port + string ipAddress = printerName.Split(':')[0]; + int port = int.Parse(printerName.Split(':')[1]); + + try + { + // Open connection + System.Net.Sockets.TcpClient client = new System.Net.Sockets.TcpClient(ipAddress, port); + + // Write ZPL String to connection + System.IO.StreamWriter writer = new System.IO.StreamWriter(client.GetStream()); + writer.Write(printingText); + writer.Flush(); + + // Close Connection + writer.Close(); + client.Close(); + } + catch + { + return false; + } + return true; + } + + + } +} diff --git a/Tanshu.Accounts.Print/Tanshu.Accounts.Print.csproj b/Tanshu.Accounts.Print/Tanshu.Accounts.Print.csproj index 69e548e..1f17468 100644 --- a/Tanshu.Accounts.Print/Tanshu.Accounts.Print.csproj +++ b/Tanshu.Accounts.Print/Tanshu.Accounts.Print.csproj @@ -10,13 +10,29 @@ Properties Tanshu.Accounts.Print Tanshu.Accounts.Print - v3.5 + v4.5.2 512 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true true @@ -26,6 +42,7 @@ DEBUG;TRACE prompt 4 + false pdbonly @@ -34,16 +51,10 @@ TRACE prompt 4 + false - - False - ..\Include\NHibernate\Iesi.Collections.dll - - - False - ..\Include\NHibernate\NHibernate.dll - + @@ -63,9 +74,8 @@ - - + @@ -85,6 +95,13 @@ Tanshu.Accounts.Repository + + + False + .NET Framework 3.5 SP1 + true + +