Skip to content

Commit

Permalink
0.52.0
Browse files Browse the repository at this point in the history
This closes #53, closes #54, closes #55, closes #56 and closes #57
  • Loading branch information
coni2k committed May 21, 2016
1 parent 50d0a66 commit 5c498fe
Show file tree
Hide file tree
Showing 100 changed files with 1,308 additions and 1,949 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ _Chutzpah.*

# Others
~$*
Thumbs.db
51 changes: 1 addition & 50 deletions BusinessObjects/Models/ElementCell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,6 @@ public UserElementCell UserElementCell

#region - Methods -

public ElementCell ClearValue()
{
return ClearValue(null);
}

public ElementCell ClearValue(User user)
{
FixedValueValidation(user);

var fixedValue = ElementField.UseFixedValue.GetValueOrDefault(true);
if (fixedValue)
ClearFixedValues();
else
RemoveUserCell(user);

return this;
}

public ElementCell SetValue(string value)
{
SetValueHelper(ElementFieldDataType.String, null);
Expand Down Expand Up @@ -171,51 +153,20 @@ void ClearFixedValues()

UserElementCell AddUserCell()
{
// Validations.ArgumentNullOrDefault(user, "user");

//if (UserElementCellSet.Any(item => item.User == user))
if (UserElementCell != null)
throw new Exception("An element cell can't have more than one user element cell for the same user.");

var userCell = new UserElementCell(this);

if (userCell.User != null)
userCell.User.UserElementCellSet.Add(userCell);
//user.UserElementCellSet.Add(userCell);
UserElementCellSet.Add(userCell);
return userCell;
}

ElementCell RemoveUserCell(User user)
{
Validations.ArgumentNullOrDefault(user, "user");

var userCell = UserElementCellSet.SingleOrDefault(item => item.User == user);
if (userCell != null)
{
user.UserElementCellSet.Remove(userCell);
UserElementCellSet.Remove(userCell);
}
return this;
}

UserElementCell GetUserCell()
{
// Validations.ArgumentNullOrDefault(user, "user");

// var userCell = UserElementCellSet.SingleOrDefault(item => item.User == user);
var userCell = UserElementCell;
if (userCell == null)
userCell = AddUserCell();

return userCell;
}

UserElementCell GetUserCell(User user)
UserElementCell GetUserCell()
{
Validations.ArgumentNullOrDefault(user, "user");

// var userCell = UserElementCellSet.SingleOrDefault(item => item.User == user);
var userCell = UserElementCell;
if (userCell == null)
userCell = AddUserCell();
Expand Down
2 changes: 0 additions & 2 deletions BusinessObjects/Models/ElementItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ namespace forCrowd.WealthEconomy.BusinessObjects
// [ODataControllerAuthorization("Administrator")]
public class ElementItem : BaseEntity
{
string _name;

[Obsolete("Parameterless constructors used by OData & EF. Make them private when possible.")]
public ElementItem()
{
Expand Down
1 change: 1 addition & 0 deletions BusinessObjects/Models/ResourcePool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public ResourcePool(User user, string name, string key)
[Index("UX_ResourcePool_UserId_Key", 1, IsUnique = true)]
public int UserId { get; set; }

[Required]
[StringLength(250)]
[Index("UX_ResourcePool_UserId_Key", 2, IsUnique = true)]
public string Key
Expand Down
32 changes: 0 additions & 32 deletions BusinessObjects/Models/UserElementCell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,42 +98,10 @@ public DateTime? DateTimeValue
}
}

//public decimal Rating { get; set; }

public virtual User User { get; set; }

public virtual ElementCell ElementCell { get; set; }

//public decimal Value
//{
// get
// {
// var fieldType = (ElementFieldDataType)ElementCell.ElementField.DataType;

// switch (fieldType)
// {
// case ElementFieldDataType.Boolean:
// return Convert.ToDecimal(BooleanValue.GetValueOrDefault());
// case ElementFieldDataType.Integer:
// return Convert.ToDecimal(IntegerValue.GetValueOrDefault());
// case ElementFieldDataType.Decimal:
// // TODO This calculation is the same as Decimal type? Are we using the types in a wrong way?
// case ElementFieldDataType.ResourcePool:
// case ElementFieldDataType.Multiplier:
// return DecimalValue.GetValueOrDefault();
// case ElementFieldDataType.DateTime:
// // TODO Check GetValueOrDefault() method for this type
// return Convert.ToDecimal(DateTimeValue.GetValueOrDefault());
// case ElementFieldDataType.String:
// case ElementFieldDataType.Element:
// // TODO At least for now
// throw new InvalidOperationException("Value property is not available for this field type");
// default:
// throw new ArgumentOutOfRangeException();
// }
// }
//}

#region - Methods -

// TODO Validations for SetValue() methods?
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
### Changelog

**0.52.0**

* Send an exception to server in 404 case
https://github.com/forCrowd/WealthEconomy/issues/53
* Post correct binding models to server
https://github.com/forCrowd/WealthEconomy/issues/54
* Use breeze's z-validate directive for entity validation errors
https://github.com/forCrowd/WealthEconomy/issues/55
* OData controller error - No HTTP resource was found that matches the request URI
https://github.com/forCrowd/WealthEconomy/issues/56
* Create validate model filter
https://github.com/forCrowd/WealthEconomy/issues/58
* Improve OData validation
https://github.com/forCrowd/WealthEconomy/issues/59
* angular dependencies alphabetical order
* Todo.md cleanup

**0.51.2**

* ResourcePoolListController.js - $location is not defined
https://github.com/forCrowd/WealthEconomy/issues/57

**0.51.1**

* OData controller error - No HTTP resource was found that matches the request URI
https://github.com/forCrowd/WealthEconomy/issues/56
* Fixes for initial setup
* -ExecutionPolicy Unrestricted was added for WebApiWarmup.ps1 call in post build
* WebApi targets path fix
* Sketch.pptx file

**0.51.0**

* Add username to account
Expand Down
20 changes: 10 additions & 10 deletions DataObjects/DataObjects.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@
<Compile Include="Generated\UserRoleRepository.cs">
<DependentUpon>Repository.tt</DependentUpon>
</Compile>
<Compile Include="Migrations\201603162043163_Initial.cs" />
<Compile Include="Migrations\201603162043163_Initial.Designer.cs">
<DependentUpon>201603162043163_Initial.cs</DependentUpon>
<Compile Include="Migrations\201603261149374_Initial.cs" />
<Compile Include="Migrations\201603261149374_Initial.Designer.cs">
<DependentUpon>201603261149374_Initial.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201603162043304_Initial_Manual.cs" />
<Compile Include="Migrations\201603162043304_Initial_Manual.Designer.cs">
<DependentUpon>201603162043304_Initial_Manual.cs</DependentUpon>
<Compile Include="Migrations\201603261149481_Initial_Manual.cs" />
<Compile Include="Migrations\201603261149481_Initial_Manual.Designer.cs">
<DependentUpon>201603261149481_Initial_Manual.cs</DependentUpon>
</Compile>
<Compile Include="ResourcePoolRepository.cs" />
<Compile Include="RoleStore.cs" />
Expand Down Expand Up @@ -162,11 +162,11 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Migrations\201603162043163_Initial.resx">
<DependentUpon>201603162043163_Initial.cs</DependentUpon>
<EmbeddedResource Include="Migrations\201603261149374_Initial.resx">
<DependentUpon>201603261149374_Initial.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201603162043304_Initial_Manual.resx">
<DependentUpon>201603162043304_Initial_Manual.cs</DependentUpon>
<EmbeddedResource Include="Migrations\201603261149481_Initial_Manual.resx">
<DependentUpon>201603261149481_Initial_Manual.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
Loading

0 comments on commit 5c498fe

Please sign in to comment.