From: <all...@us...> - 2010-03-16 17:28:59
|
Revision: 37 http://cronoscontrol.svn.sourceforge.net/cronoscontrol/?rev=37&view=rev Author: allancascante Date: 2010-03-16 17:28:50 +0000 (Tue, 16 Mar 2010) Log Message: ----------- Ticket #8: Added support for to create tickets and list, missing the edit and details functioanlity. Some mods where made to the bussiness and DAL to support the save functionality required. Modified Paths: -------------- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Business.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Companies.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/IBusiness.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Projects.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Tasks.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/TimeCategories.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Users.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Util/ErrorHandling/ExceptionBusinessError.cs source/trunk/CronosControl/CronosControlBusinessClassLibrary/CronosControlBusinessClassLibrary.csproj source/trunk/CronosControl/CronosControlClassLibrary/CronosControlModel.Designer.cs source/trunk/CronosControl/CronosControlClassLibrary/CronosControlModel.edmx source/trunk/CronosControl/CronosControlClassLibrary/app.config source/trunk/CronosControl/CronosControlWeb/CronosControlWeb.csproj source/trunk/CronosControl/CronosControlWeb/Web.config Added Paths: ----------- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Util/Helpers/ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Util/Helpers/EntityHelperUtil.cs source/trunk/CronosControl/CronosControlWeb/Controllers/TimeCategoryController.cs source/trunk/CronosControl/CronosControlWeb/Views/TimeCategory/ source/trunk/CronosControl/CronosControlWeb/Views/TimeCategory/TimeCategoryCreate.aspx source/trunk/CronosControl/CronosControlWeb/Views/TimeCategory/TimeCategoryList.aspx Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Business.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Business.cs 2010-02-19 23:36:14 UTC (rev 36) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Business.cs 2010-03-16 17:28:50 UTC (rev 37) @@ -6,17 +6,27 @@ using CronosControl.Business.Util.ErrorHandling; using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling; using System.Data.Objects.DataClasses; +using CronosControl.Business.Util.Helpers; namespace CronosControl.Business { - public abstract class Business<T> : IBusiness<T> where T : IEntityWithKey + public abstract class Business<T> : IBusiness<T> where T : EntityObject { private CronosControlEntities cronosControlEntities; - public CronosControlEntities CronosControlEntities + public CronosControlEntities CronosControlEntitiesContext { - get { return cronosControlEntities; } - set { cronosControlEntities = value; } + get { + if (cronosControlEntities != null) + { + return cronosControlEntities; + } + else + { + return cronosControlEntities = new CronosControlEntities(); + } + + } } #region IBusiness<User> Members @@ -25,22 +35,14 @@ { List<IBusinessError> errors = new List<IBusinessError>(); try - { - cronosControlEntities = new CronosControlEntities(); + { Object savedEntity = null; - - if (entity.EntityKey != null && cronosControlEntities.TryGetObjectByKey(entity.EntityKey, out savedEntity)) + using (CronosControlEntitiesContext) { - CronosControlEntities.Attach(entity); - CronosControlEntities.SaveChanges(); + EntityHelperUtil.AddObjectOrAttach(CronosControlEntitiesContext, entity.GetType().Name, entity); + CronosControlEntitiesContext.SaveChanges(); return errors; } - else - { - cronosControlEntities.AddObject(entity.GetType().Name, entity); - CronosControlEntities.SaveChanges(); - return errors; - } } catch (Exception ex) { @@ -52,30 +54,35 @@ public virtual T Get(T entity) { - cronosControlEntities = new CronosControlEntities(); - Object savedEntity = null; - if (entity.EntityKey != null && cronosControlEntities.TryGetObjectByKey(entity.EntityKey, out savedEntity)) + using (CronosControlEntitiesContext) { - return (T)savedEntity; + Object savedEntity = null; + if (entity.EntityKey != null && cronosControlEntities.TryGetObjectByKey(entity.EntityKey, out savedEntity)) + { + CronosControlEntitiesContext.Detach(savedEntity); + return (T)savedEntity; + } + else + { + return entity; + } } - else - { - return entity; - } } public virtual bool Find(T entity) { - cronosControlEntities = new CronosControlEntities(); - Object savedEntity = null; - if (entity.EntityKey != null && cronosControlEntities.TryGetObjectByKey(entity.EntityKey, out savedEntity)) + using (CronosControlEntitiesContext) { - return true; + Object savedEntity = null; + if (entity.EntityKey != null && CronosControlEntitiesContext.TryGetObjectByKey(entity.EntityKey, out savedEntity)) + { + return true; + } + else + { + return false; + } } - else - { - return false; - } } public abstract List<T> List(); Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Companies.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Companies.cs 2010-02-19 23:36:14 UTC (rev 36) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Companies.cs 2010-03-16 17:28:50 UTC (rev 37) @@ -3,6 +3,7 @@ using System.Linq; using System.Text; using CronosControl.Model; +using System.Data; namespace CronosControl.Business { @@ -11,6 +12,19 @@ /// </summary> public class Companies : Business<Company>, ICompanies { + /// <summary> + /// Sets the entity id for a given company with the id company attribute from the entity. All entites should be calling this method when invoking get on new entities having only the id set. + /// </summary> + /// <param name="company">the company to set the entity to</param> + public void setEntityKey(Company company) + { + // Create the key that represents the order. + EntityKey key = new EntityKey("CronosControlEntities.Company", "IdCompany", company.IdCompany); + + // Create an order that we can attach. + company.EntityKey = key; + } + #region Business<Company> abstract methods public override List<Company> List() { Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/IBusiness.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/IBusiness.cs 2010-02-19 23:36:14 UTC (rev 36) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/IBusiness.cs 2010-03-16 17:28:50 UTC (rev 37) @@ -9,9 +9,13 @@ { public interface IBusiness<T> { - CronosControlEntities CronosControlEntities { get; set; } /// <summary> + /// The context used for all objects. + /// </summary> + CronosControlEntities CronosControlEntitiesContext {get;} + + /// <summary> /// Saves or updates the given entity, if it was saved before it will be updated if is a new instance it will saved as a new entry /// </summary> /// <param name="entity">The entity to save</param> @@ -22,6 +26,7 @@ /// Get an entity for the given entity, the provided entity only needs to provide the key value for the entity to get. /// </summary> /// <param name="entity">The entity with the key value set to get</param> + /// <param name="cronosControlEntities">the context to get from</param> /// <returns>The entity found null otherwise</returns> T Get(T entity); Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Projects.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Projects.cs 2010-02-19 23:36:14 UTC (rev 36) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Projects.cs 2010-03-16 17:28:50 UTC (rev 37) @@ -12,19 +12,23 @@ /// </summary> public class Projects : Business<Project>, IProjects { - CronosControlEntities cronosControlEntities; - #region Bussiness Abstract Methods public override List<Project> List() { - cronosControlEntities = new CronosControlEntities(); - return cronosControlEntities.Project.ToList(); + using (CronosControlEntities cronosControlEntities = new CronosControlEntities()) + { + return cronosControlEntities.Project.ToList(); + } } public override List<Project> List(int page, int elements) { - throw new NotImplementedException(); + using (CronosControlEntities cronosControlEntities = new CronosControlEntities()) + { + return cronosControlEntities.Project.Skip(elements * (page - 1)).Take(elements).ToList(); + } } + #endregion } } Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Tasks.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Tasks.cs 2010-02-19 23:36:14 UTC (rev 36) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Tasks.cs 2010-03-16 17:28:50 UTC (rev 37) @@ -12,15 +12,87 @@ public class Tasks : Business<Task>, ITasks { #region Business<Task> + /// <summary> + /// Get the list of all task in the system. + /// </summary> + /// <returns>A list with all taks</returns> public override List<Task> List() { - throw new NotImplementedException(); + using (CronosControlEntities cronosControlEntities = new CronosControlEntities()) + { + return cronosControlEntities.Task.ToList(); + } } + /// <summary> + /// Get a sub set of all tasks on the system. + /// </summary> + /// <param name="page">The page to get</param> + /// <param name="elements">The number of elements by page</param> + /// <returns>The page for the given parameters</returns> public override List<Task> List(int page, int elements) { - throw new NotImplementedException(); + using (CronosControlEntities cronosControlEntities = new CronosControlEntities()) + { + return cronosControlEntities.Task.Skip(elements * (page - 1)).Take(elements).ToList(); + } } + + /// <summary> + /// Get the list of all User's Tasks on the system for a given user + /// </summary> + /// <param name="user">The user to search the tasks for</param> + /// <returns>The list of tasks for the user</returns> + public List<Task> UserTasks(User user) + { + using (CronosControlEntities cronosControlEntities = new CronosControlEntities()) + { + return (from u in cronosControlEntities.TaskUser + where u.User == user + select u.Task).ToList<Task>(); + } + } + + /// <summary> + /// Gets a sub list of User's Tasks on the system for the given user + /// </summary> + /// <param name="user">The user to search the tasks for</param> + /// <param name="page">The page to get</param> + /// <param name="elements">The number of elements by page</param> + /// <returns>The list of tasks on the given range for the user</returns> + public List<Task> UserTasks(User user, int page, int elements) + { + using (CronosControlEntities cronosControlEntities = new CronosControlEntities()) + { + return (from u in cronosControlEntities.TaskUser + where u.User == user + select u.Task).Skip(elements * (page - 1)).Take(elements).ToList<Task>(); + } + } + + /// <summary> + /// Get the a sub list of User's Tasks on the system for a given date range + /// </summary> + /// <param name="user">The user to search the tasks for</param> + /// <param name="startDate">The start date in the range</param> + /// <param name="endDate">The end date in the range</param> + /// <param name="page">The page number to get</param> + /// <param name="elements">The elements t</param> + /// <returns></returns> + public List<Task> UserTasks(User user, DateTime startDate, DateTime endDate, int page, int elements) + { + if (startDate == null || endDate == null || startDate.CompareTo(endDate) > 0) + { + throw new ArgumentException("The provided start and end dates are not correct."); + } + using (CronosControlEntities cronosControlEntities = new CronosControlEntities()) + { + return (from u in cronosControlEntities.TaskUser + where u.User == user && u.StartDate >= startDate && u.EndDate <= endDate + select u.Task).Skip(elements * (page - 1)).Take(elements).ToList<Task>(); + } + } + #endregion } } Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/TimeCategories.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/TimeCategories.cs 2010-02-19 23:36:14 UTC (rev 36) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/TimeCategories.cs 2010-03-16 17:28:50 UTC (rev 37) @@ -3,6 +3,9 @@ using System.Linq; using System.Text; using CronosControl.Model; +using CronosControl.Business.Util.ErrorHandling; +using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling; +using CronosControl.Business.Util.Helpers; namespace CronosControl.Business { @@ -11,15 +14,24 @@ /// </summary> public class TimeCategories : Business<TimeCategory>, ITimeCategories { + #region Business<TimeCategory> abstract methods + + public override List<IBusinessError> Save(TimeCategory entity) + { + entity.CreatedAt = DateTime.Now; + return base.Save(entity); + } + public override List<TimeCategory> List() { - throw new NotImplementedException(); + return CronosControlEntitiesContext.TimeCategory.ToList(); } public override List<TimeCategory> List(int page, int elements) { - throw new NotImplementedException(); + + return CronosControlEntitiesContext.TimeCategory.Skip(elements * (page - 1)).Take(elements).ToList(); } #endregion } Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Users.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Users.cs 2010-02-19 23:36:14 UTC (rev 36) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Users.cs 2010-03-16 17:28:50 UTC (rev 37) @@ -13,16 +13,19 @@ { public override List<IBusinessError> Save(User entity) { - if (this.Find(entity)) + using(CronosControlEntitiesContext) { - entity.UpdatedAt = DateTime.Now; + if (this.Find(entity)) + { + entity.UpdatedAt = DateTime.Now; + } + else + { + entity.CreatedAt = DateTime.Now; + entity.Enabled = true; + } + return base.Save(entity); } - else - { - entity.CreatedAt = DateTime.Now; - entity.Enabled = true; - } - return base.Save(entity); } #region Business<User> abstract methods Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Util/ErrorHandling/ExceptionBusinessError.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Util/ErrorHandling/ExceptionBusinessError.cs 2010-02-19 23:36:14 UTC (rev 36) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Util/ErrorHandling/ExceptionBusinessError.cs 2010-03-16 17:28:50 UTC (rev 37) @@ -14,5 +14,10 @@ { this.ex = ex; } + + public override String ToString() + { + return ex.Message; + } } } Added: source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Util/Helpers/EntityHelperUtil.cs =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Util/Helpers/EntityHelperUtil.cs (rev 0) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/Business/Util/Helpers/EntityHelperUtil.cs 2010-03-16 17:28:50 UTC (rev 37) @@ -0,0 +1,232 @@ +using System; +using System.ComponentModel; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Data; +using System.Data.Objects; +using System.Data.Objects.DataClasses; +using System.Text; +using System.Reflection; + +namespace CronosControl.Business.Util.Helpers +{ + + /// <summary> + /// Attach helper for entity framework + /// </summary> + public static class EntityHelperUtil + { + /// <summary> + /// Adds or attaches an entity object to the context + /// </summary> + public static void AddObjectOrAttach(ObjectContext context, string entitySetName, EntityObject entity) + { + if (entity.EntityKey == null) + { + AddObject(context, entitySetName, entity); + } + else + { + Attach(context, entity); + } + } + + /// <summary> + /// Adds an entity object to the context + /// </summary> + public static void AddObject(ObjectContext context, string entitySetName, IEntityWithRelationships entity) + { + // remove all relations + List<RelationsShipMapping> map = new List<RelationsShipMapping>(); + RemoveRelationships(map, entity, -1); + + // add the entity + context.AddObject(entitySetName, entity); + + // recreate all relationships + AddRelationships(context, map); + } + + /// <summary> + /// Attaches an entity object to the context + /// </summary> + public static void Attach(ObjectContext context, EntityObject entity) + { + // remove all relations + List<RelationsShipMapping> map = new List<RelationsShipMapping>(); + RemoveRelationships(map, entity, -1); + + // attach the entity + context.Attach(entity); + + // recreate all relationships + AddRelationships(context, map); + } + + /// <summary> + /// Attaches all related entity object and recreates all relationships + /// </summary> + static void AddRelationships(ObjectContext context, List<RelationsShipMapping> map) + { + int layer = -1; + + // loop through all layers + do + { + layer++; + + // return all entity object from a specific layer + IEnumerable<RelationsShipMapping> rs = from r in map + where r.Layer == layer + select r; + + // check if there are no further related entity objects + if (rs.Count<RelationsShipMapping>() == 0) + break; + + // move through the remembered mappings of the current layer + foreach (RelationsShipMapping mapping in rs) + { + // check if we need to attach the related entity object + IEntityWithKey entityWithKey = mapping.TargetEntity as IEntityWithKey; + if (entityWithKey != null && entityWithKey.EntityKey != null) + context.Attach(entityWithKey); + + // check if it´s a EntityCollection or EntityReference relationship + if (!mapping.IsReference) + { + // add the related collection entity object + MethodInfo mi = typeof(RelationshipManager).GetMethod("GetRelatedCollection").MakeGenericMethod(mapping.TargetEntity.GetType()); + object col = mi.Invoke( + mapping.Entity.RelationshipManager, + new object[]{ mapping.RelationshipName, mapping.TargetRole }); + MethodInfo miAdd = col.GetType().GetMethod("Add"); + miAdd.Invoke(col, new object[] { mapping.TargetEntity }); + } + else + { + // set the related reference entity object + MethodInfo mi = typeof(RelationshipManager).GetMethod("GetRelatedReference").MakeGenericMethod(mapping.TargetEntity.GetType()); + + EntityReference er = (EntityReference)mi.Invoke( + mapping.Entity.RelationshipManager, + new object[]{ mapping.RelationshipName, mapping.TargetRole }); + er.GetType().GetProperty("Value").SetValue(er, mapping.TargetEntity, null); + } + } + } + while (true); + } + + + + /// <summary> + /// Removes all related entity objects + /// </summary> + static void RemoveRelationships(List<RelationsShipMapping> map, IEntityWithRelationships entity, int layer) + { + // the layer represents the stack in the relationships + // for example: the related entities to main entity object is layer 0, + // and the related entites to the related entites is layer 1, etc... + layer++; + // get a collection of all related conceptual entities. + IEnumerable<IRelatedEnd> en = entity.RelationshipManager.GetAllRelatedEnds(); + + foreach (IRelatedEnd end in en) + { + // check if the relation is an EntityCollection + IEnumerable col = end as IEnumerable; + if (col != null) + { + string colRelationshipName = (string)col.GetType().GetProperty("RelationshipName").GetValue(col, null); + string colSourceRoleName = (string)col.GetType().GetProperty("SourceRoleName").GetValue(col, null); + string colTargetRoleName = (string)col.GetType().GetProperty("TargetRoleName").GetValue(col, null); + + IEnumerator enu = col.GetEnumerator(); + + List<IEntityWithRelationships> mem = new List<IEntityWithRelationships>(); + while (enu.MoveNext()) + { + IEntityWithRelationships item = (IEntityWithRelationships)enu.Current; + + // check if the relationship is already added the map + int alreadyExists = (from c in map + where c.RelationshipName == colRelationshipName && c.TargetRole == colSourceRoleName + select c).Count(); + if (alreadyExists > 0) + continue; + + // remember the relationships and add it to the map + RelationsShipMapping mapping = new RelationsShipMapping(); + mapping.Layer = layer; + mapping.RelationshipName = colRelationshipName; + mapping.TargetRole = colTargetRoleName; + mapping.Entity = entity; + mapping.TargetEntity = item; + mapping.IsReference = false; + + map.Add(mapping); + + mem.Add(item); + + RemoveRelationships(map, item, layer); + } + + // remove the entity collection relationships + foreach(IEntityWithRelationships item in mem) + { + end.Remove(item); + } + } + + // check if the relation is an EntityReference + EntityReference er = end as EntityReference; + if (er != null) + { + System.Reflection.PropertyInfo pValue = er.GetType().GetProperty("Value"); + IEntityWithRelationships value = (IEntityWithRelationships)pValue.GetValue(er, null); + if (value == null) + continue; + + if (er != null) + { + // check if the reference is already added the map + int alreadyExists = (from c in map + where c.RelationshipName == er.RelationshipName && c.TargetRole == er.SourceRoleName + select c).Count(); + + if (alreadyExists > 0) + continue; + // remember the relationships and add it to the map + RelationsShipMapping mapping = new RelationsShipMapping(); + mapping.Layer = layer; + mapping.RelationshipName = er.RelationshipName; + mapping.TargetRole = er.TargetRoleName; + mapping.Entity = entity; + mapping.TargetEntity = value; + mapping.IsReference = true; + map.Add(mapping); + + // remove the entity reference relationships + pValue.SetValue(er, null, null); + RemoveRelationships(map, value, layer); + } + } + } + } + + /// <summary> + /// Used to remember relationships in the entity object + /// </summary> + class RelationsShipMapping + { + public int Layer; + public string RelationshipName; + public string TargetRole; + public IEntityWithRelationships Entity; + public IEntityWithRelationships TargetEntity; + public bool IsReference; + } + } +} Modified: source/trunk/CronosControl/CronosControlBusinessClassLibrary/CronosControlBusinessClassLibrary.csproj =================================================================== --- source/trunk/CronosControl/CronosControlBusinessClassLibrary/CronosControlBusinessClassLibrary.csproj 2010-02-19 23:36:14 UTC (rev 36) +++ source/trunk/CronosControl/CronosControlBusinessClassLibrary/CronosControlBusinessClassLibrary.csproj 2010-03-16 17:28:50 UTC (rev 37) @@ -76,6 +76,7 @@ <Compile Include="Business\Users.cs" /> <Compile Include="Business\Util\ErrorHandling\ExceptionBusinessError.cs" /> <Compile Include="Business\Util\ErrorHandling\IBusinessError.cs" /> + <Compile Include="Business\Util\Helpers\EntityHelperUtil.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> Modified: source/trunk/CronosControl/CronosControlClassLibrary/CronosControlModel.Designer.cs =================================================================== --- source/trunk/CronosControl/CronosControlClassLibrary/CronosControlModel.Designer.cs 2010-02-19 23:36:14 UTC (rev 36) +++ source/trunk/CronosControl/CronosControlClassLibrary/CronosControlModel.Designer.cs 2010-03-16 17:28:50 UTC (rev 37) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 +// Runtime Version:2.0.50727.3603 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -37,9 +37,12 @@ [assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("CronosControl.Model", "FK_UserProjectRole_User", "User", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(CronosControl.Model.User), "UserProjectRole", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(CronosControl.Model.UserProjectRole))] [assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("CronosControl.Model", "FK_UserSession_User", "User", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(CronosControl.Model.User), "UserSession", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(CronosControl.Model.UserSession))] [assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("CronosControl.Model", "FK_IdUserProjectRoleDocument_UserProjectRole", "UserProjectRole", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(CronosControl.Model.UserProjectRole), "UserProjectRoleDocument", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(CronosControl.Model.UserProjectRoleDocument))] +[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("CronosControl.Model", "FK_TaskUser_Task", "Task", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(CronosControl.Model.Task), "TaskUser", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(CronosControl.Model.TaskUser))] +[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("CronosControl.Model", "FK_TaskUser_TimeCategory", "TimeCategory", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(CronosControl.Model.TimeCategory), "TaskUser", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(CronosControl.Model.TaskUser))] +[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("CronosControl.Model", "FK_TaskUser_User", "User", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(CronosControl.Model.User), "TaskUser", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(CronosControl.Model.TaskUser))] // Original file name: -// Generation date: 2/15/2010 5:38:48 PM +// Generation date: 3/16/2010 11:21:21 AM namespace CronosControl.Model { @@ -374,6 +377,21 @@ } private global::System.Data.Objects.ObjectQuery<UserSession> _UserSession; /// <summary> + /// There are no comments for TaskUser in the schema. + /// </summary> + public global::System.Data.Objects.ObjectQuery<TaskUser> TaskUser + { + get + { + if ((this._TaskUser == null)) + { + this._TaskUser = base.CreateQuery<TaskUser>("[TaskUser]"); + } + return this._TaskUser; + } + } + private global::System.Data.Objects.ObjectQuery<TaskUser> _TaskUser; + /// <summary> /// There are no comments for Calendar in the schema. /// </summary> public void AddToCalendar(Calendar calendar) @@ -513,6 +531,13 @@ { base.AddObject("UserSession", userSession); } + /// <summary> + /// There are no comments for TaskUser in the schema. + /// </summary> + public void AddToTaskUser(TaskUser taskUser) + { + base.AddObject("TaskUser", taskUser); + } } /// <summary> /// There are no comments for CronosControl.Model.Calendar in the schema. @@ -3074,6 +3099,27 @@ } } } + /// <summary> + /// There are no comments for TaskUser in the schema. + /// </summary> + [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("CronosControl.Model", "FK_TaskUser_Task", "TaskUser")] + [global::System.Xml.Serialization.XmlIgnoreAttribute()] + [global::System.Xml.Serialization.SoapIgnoreAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Data.Objects.DataClasses.EntityCollection<TaskUser> TaskUser + { + get + { + return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<TaskUser>("CronosControl.Model.FK_TaskUser_Task", "TaskUser"); + } + set + { + if ((value != null)) + { + ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<TaskUser>("CronosControl.Model.FK_TaskUser_Task", "TaskUser", value); + } + } + } } /// <summary> /// There are no comments for CronosControl.Model.TimeCategory in the schema. @@ -3344,6 +3390,27 @@ } } } + /// <summary> + /// There are no comments for TaskUser in the schema. + /// </summary> + [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("CronosControl.Model", "FK_TaskUser_TimeCategory", "TaskUser")] + [global::System.Xml.Serialization.XmlIgnoreAttribute()] + [global::System.Xml.Serialization.SoapIgnoreAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Data.Objects.DataClasses.EntityCollection<TaskUser> TaskUser + { + get + { + return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<TaskUser>("CronosControl.Model.FK_TaskUser_TimeCategory", "TaskUser"); + } + set + { + if ((value != null)) + { + ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<TaskUser>("CronosControl.Model.FK_TaskUser_TimeCategory", "TaskUser", value); + } + } + } } /// <summary> /// There are no comments for CronosControl.Model.TimeSheet in the schema. @@ -4688,6 +4755,27 @@ } } } + /// <summary> + /// There are no comments for TaskUser in the schema. + /// </summary> + [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("CronosControl.Model", "FK_TaskUser_User", "TaskUser")] + [global::System.Xml.Serialization.XmlIgnoreAttribute()] + [global::System.Xml.Serialization.SoapIgnoreAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Data.Objects.DataClasses.EntityCollection<TaskUser> TaskUser + { + get + { + return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<TaskUser>("CronosControl.Model.FK_TaskUser_User", "TaskUser"); + } + set + { + if ((value != null)) + { + ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<TaskUser>("CronosControl.Model.FK_TaskUser_User", "TaskUser", value); + } + } + } } /// <summary> /// There are no comments for CronosControl.Model.UserProjectRole in the schema. @@ -5193,4 +5281,231 @@ } } } + /// <summary> + /// There are no comments for CronosControl.Model.TaskUser in the schema. + /// </summary> + /// <KeyProperties> + /// IdTaskUser + /// </KeyProperties> + [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="CronosControl.Model", Name="TaskUser")] + [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)] + [global::System.Serializable()] + public partial class TaskUser : global::System.Data.Objects.DataClasses.EntityObject + { + /// <summary> + /// Create a new TaskUser object. + /// </summary> + /// <param name="idTaskUser">Initial value of IdTaskUser.</param> + /// <param name="assigment">Initial value of Assigment.</param> + public static TaskUser CreateTaskUser(int idTaskUser, short assigment) + { + TaskUser taskUser = new TaskUser(); + taskUser.IdTaskUser = idTaskUser; + taskUser.Assigment = assigment; + return taskUser; + } + /// <summary> + /// There are no comments for Property IdTaskUser in the schema. + /// </summary> + [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int IdTaskUser + { + get + { + return this._IdTaskUser; + } + set + { + this.OnIdTaskUserChanging(value); + this.ReportPropertyChanging("IdTaskUser"); + this._IdTaskUser = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value); + this.ReportPropertyChanged("IdTaskUser"); + this.OnIdTaskUserChanged(); + } + } + private int _IdTaskUser; + partial void OnIdTaskUserChanging(int value); + partial void OnIdTaskUserChanged(); + /// <summary> + /// There are no comments for Property Assigment in the schema. + /// </summary> + [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable=false)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public short Assigment + { + get + { + return this._Assigment; + } + set + { + this.OnAssigmentChanging(value); + this.ReportPropertyChanging("Assigment"); + this._Assigment = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value); + this.ReportPropertyChanged("Assigment"); + this.OnAssigmentChanged(); + } + } + private short _Assigment; + partial void OnAssigmentChanging(short value); + partial void OnAssigmentChanged(); + /// <summary> + /// There are no comments for Property StartDate in the schema. + /// </summary> + [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Nullable<global::System.DateTime> StartDate + { + get + { + return this._StartDate; + } + set + { + this.OnStartDateChanging(value); + this.ReportPropertyChanging("StartDate"); + this._StartDate = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value); + this.ReportPropertyChanged("StartDate"); + this.OnStartDateChanged(); + } + } + private global::System.Nullable<global::System.DateTime> _StartDate; + partial void OnStartDateChanging(global::System.Nullable<global::System.DateTime> value); + partial void OnStartDateChanged(); + /// <summary> + /// There are no comments for Property EndDate in the schema. + /// </summary> + [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Nullable<global::System.DateTime> EndDate + { + get + { + return this._EndDate; + } + set + { + this.OnEndDateChanging(value); + this.ReportPropertyChanging("EndDate"); + this._EndDate = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value); + this.ReportPropertyChanged("EndDate"); + this.OnEndDateChanged(); + } + } + private global::System.Nullable<global::System.DateTime> _EndDate; + partial void OnEndDateChanging(global::System.Nullable<global::System.DateTime> value); + partial void OnEndDateChanged(); + /// <summary> + /// There are no comments for Task in the schema. + /// </summary> + [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("CronosControl.Model", "FK_TaskUser_Task", "Task")] + [global::System.Xml.Serialization.XmlIgnoreAttribute()] + [global::System.Xml.Serialization.SoapIgnoreAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Task Task + { + get + { + return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Task>("CronosControl.Model.FK_TaskUser_Task", "Task").Value; + } + set + { + ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Task>("CronosControl.Model.FK_TaskUser_Task", "Task").Value = value; + } + } + /// <summary> + /// There are no comments for Task in the schema. + /// </summary> + [global::System.ComponentModel.BrowsableAttribute(false)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Data.Objects.DataClasses.EntityReference<Task> TaskReference + { + get + { + return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Task>("CronosControl.Model.FK_TaskUser_Task", "Task"); + } + set + { + if ((value != null)) + { + ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Task>("CronosControl.Model.FK_TaskUser_Task", "Task", value); + } + } + } + /// <summary> + /// There are no comments for TimeCategory in the schema. + /// </summary> + [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("CronosControl.Model", "FK_TaskUser_TimeCategory", "TimeCategory")] + [global::System.Xml.Serialization.XmlIgnoreAttribute()] + [global::System.Xml.Serialization.SoapIgnoreAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public TimeCategory TimeCategory + { + get + { + return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<TimeCategory>("CronosControl.Model.FK_TaskUser_TimeCategory", "TimeCategory").Value; + } + set + { + ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<TimeCategory>("CronosControl.Model.FK_TaskUser_TimeCategory", "TimeCategory").Value = value; + } + } + /// <summary> + /// There are no comments for TimeCategory in the schema. + /// </summary> + [global::System.ComponentModel.BrowsableAttribute(false)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Data.Objects.DataClasses.EntityReference<TimeCategory> TimeCategoryReference + { + get + { + return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<TimeCategory>("CronosControl.Model.FK_TaskUser_TimeCategory", "TimeCategory"); + } + set + { + if ((value != null)) + { + ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<TimeCategory>("CronosControl.Model.FK_TaskUser_TimeCategory", "TimeCategory", value); + } + } + } + /// <summary> + /// There are no comments for User in the schema. + /// </summary> + [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("CronosControl.Model", "FK_TaskUser_User", "User")] + [global::System.Xml.Serialization.XmlIgnoreAttribute()] + [global::System.Xml.Serialization.SoapIgnoreAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public User User + { + get + { + return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<User>("CronosControl.Model.FK_TaskUser_User", "User").Value; + } + set + { + ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<User>("CronosControl.Model.FK_TaskUser_User", "User").Value = value; + } + } + /// <summary> + /// There are no comments for User in the schema. + /// </summary> + [global::System.ComponentModel.BrowsableAttribute(false)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Data.Objects.DataClasses.EntityReference<User> UserReference + { + get + { + return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<User>("CronosControl.Model.FK_TaskUser_User", "User"); + } + set + { + if ((value != null)) + { + ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<User>("CronosControl.Model.FK_TaskUser_User", "User", value); + } + } + } + } } Modified: source/trunk/CronosControl/CronosControlClassLibrary/CronosControlModel.edmx =================================================================== --- source/trunk/CronosControl/CronosControlClassLibrary/CronosControlModel.edmx 2010-02-19 23:36:14 UTC (rev 36) +++ source/trunk/CronosControl/CronosControlClassLibrary/CronosControlModel.edmx 2010-03-16 17:28:50 UTC (rev 37) @@ -4,7 +4,7 @@ <edmx:Runtime> <!-- SSDL content --> <edmx:StorageModels> - <Schema Namespace="CronosControl.Model.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2005" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2006/04/edm/ssdl"> + <Schema Namespace="CronosControl.Model.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2008" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2006/04/edm/ssdl"> <EntityContainer Name="CronosControlModelStoreContainer"> <EntitySet Name="Calendar" EntityType="CronosControl.Model.Store.Calendar" store:Type="Tables" Schema="dbo" /> <EntitySet Name="Client" EntityType="CronosControl.Model.Store.Client" store:Type="Tables" Schema="dbo" /> @@ -17,6 +17,7 @@ <EntitySet Name="ProjectDocument" EntityType="CronosControl.Model.Store.ProjectDocument" store:Type="Tables" Schema="dbo" /> <EntitySet Name="Role" EntityType="CronosControl.Model.Store.Role" store:Type="Tables" Schema="dbo" /> <EntitySet Name="Task" EntityType="CronosControl.Model.Store.Task" store:Type="Tables" Schema="dbo" /> + <EntitySet Name="TaskUser" EntityType="CronosControl.Model.Store.TaskUser" store:Type="Tables" Schema="dbo" /> <EntitySet Name="TimeCategory" EntityType="CronosControl.Model.Store.TimeCategory" store:Type="Tables" Schema="dbo" /> <EntitySet Name="TimeSheet" EntityType="CronosControl.Model.Store.TimeSheet" store:Type="Tables" Schema="dbo" /> <EntitySet Name="TimeSheetCostCenter" EntityType="CronosControl.Model.Store.TimeSheetCostCenter" store:Type="Tables" Schema="dbo" /> @@ -85,6 +86,18 @@ <End Role="Project" EntitySet="Project" /> <End Role="Task" EntitySet="Task" /> </AssociationSet> + <AssociationSet Name="FK_TaskUser_Task" Association="CronosControl.Model.Store.FK_TaskUser_Task"> + <End Role="Task" EntitySet="Task" /> + <End Role="TaskUser" EntitySet="TaskUser" /> + </AssociationSet> + <AssociationSet Name="FK_TaskUser_TimeCategory" Association="CronosControl.Model.Store.FK_TaskUser_TimeCategory"> + <End Role="TimeCategory" EntitySet="TimeCategory" /> + <End Role="TaskUser" EntitySet="TaskUser" /> + </AssociationSet> + <AssociationSet Name="FK_TaskUser_User" Association="CronosControl.Model.Store.FK_TaskUser_User"> + <End Role="User" EntitySet="User" /> + <End Role="TaskUser" EntitySet="TaskUser" /> + </AssociationSet> <AssociationSet Name="FK_TimeCategory_Company" Association="CronosControl.Model.Store.FK_TimeCategory_Company"> <End Role="Company" EntitySet="Company" /> <End Role="TimeCategory" EntitySet="TimeCategory" /> @@ -277,6 +290,18 @@ <Property Name="CreatedAt" Type="datetime" /> <Property Name="UpdatedAt" Type="datetime" /> </EntityType> + <EntityType Name="TaskUser"> + <Key> + <PropertyRef Name="IdTaskUser" /> + </Key> + <Property Name="IdTaskUser" Type="int" Nullable="false" StoreGeneratedPattern="Identity" /> + <Property Name="IdTask" Type="int" Nullable="false" /> + <Property Name="IdUser" Type="int" Nullable="false" /> + <Property Name="Assigment" Type="smallint" Nullable="false" /> + <Property Name="StartDate" Type="date" /> + <Property Name="EndDate" Type="date" /> + <Property Name="IdTimeCategory" Type="int" /> + </EntityType> <EntityType Name="TimeCategory"> <Key> <PropertyRef Name="IdTimeCategory" /> @@ -373,7 +398,7 @@ <Property Name="Price" Type="smallint" /> </EntityType> <!--Errors Found During Generation: - warning 6002: The table/view 'G:\MARIO\DEVELOPER-SVN\CRONOS CONTROL\SOURCE\TRUNK\CRONOSCONTROL\CRONOSCONTROLWEB\APP_DATA\CRONOSCONTROL.MDF.dbo.UserSession' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view. + warning 6002: The table/view '40C78158E1169A71FA85F9BB1B227439_ DOCUMENTS\CRONOSCONTROL\SOURCE\TRUNK\CRONOSCONTROL\CRONOSCONTROLWEB\APP_DATA\CRONOSCONTROL.MDF.dbo.UserSession' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view. --> <EntityType Name="UserSession"> <Key> @@ -563,6 +588,42 @@ </Dependent> </ReferentialConstraint> </Association> + <Association Name="FK_TaskUser_Task"> + <End Role="Task" Type="CronosControl.Model.Store.Task" Multiplicity="1" /> + <End Role="TaskUser" Type="CronosControl.Model.Store.TaskUser" Multiplicity="*" /> + <ReferentialConstraint> + <Principal Role="Task"> + <PropertyRef Name="IdTask" /> + </Principal> + <Dependent Role="TaskUser"> + <PropertyRef Name="IdTask" /> + </Dependent> + </ReferentialConstraint> + </Association> + <Association Name="FK_TaskUser_TimeCategory"> + <End Role="TimeCategory" Type="CronosControl.Model.Store.TimeCategory" Multiplicity="0..1" /> + <End Role="TaskUser" Type="CronosControl.Model.Store.TaskUser" Multiplicity="*" /> + <ReferentialConstraint> + <Principal Role="TimeCategory"> + <PropertyRef Name="IdTimeCategory" /> + </Principal> + <Dependent Role="TaskUser"> + <PropertyRef Name="IdTimeCategory" /> + </Dependent> + </ReferentialConstraint> + </Association> + <Association Name="FK_TaskUser_User"> + <End Role="User" Type="CronosControl.Model.Store.User" Multiplicity="1" /> + <End Role="TaskUser" Type="CronosControl.Model.Store.TaskUser" Multiplicity="*" /> + <ReferentialConstraint> + <Principal Role="User"> + <PropertyRef Name="IdUser" /> + </Principal> + <Dependent Role="TaskUser"> + <PropertyRef Name="IdUser" /> + </Dependent> + </ReferentialConstraint> + </Association> <Association Name="FK_TimeCategory_Company"> <End Role="Company" Type="CronosControl.Model.Store.Company" Multiplicity="1" /> <End Role="TimeCategory" Type="CronosControl.Model.Store.TimeCategory" Multiplicity="*" /> @@ -772,8 +833,7 @@ </Dependent> </ReferentialConstraint> </Association>--> - </Schema> - </edmx:StorageModels> + </Schema></edmx:StorageModels> <!-- CSDL content --> <edmx:ConceptualModels> <Schema Namespace="CronosControl.Model" Alias="Self" xmlns="http://schemas.microsoft.com/ado/2006/04/edm"> @@ -910,7 +970,16 @@ <End Role="UserProjectRole" EntitySet="UserProjectRole" /> <End Role="UserProjectRoleDocument" EntitySet="UserProjectRoleDocument" /> </AssociationSet> - </EntityContainer> + <EntitySet Name="TaskUser" EntityType="CronosControl.Model.TaskUser" /> + <AssociationSet Name="FK_TaskUser_Task" Association="CronosControl.Model.FK_TaskUser_Task"> + <End Role="Task" EntitySet="Task" /> + <End Role="TaskUser" EntitySet="TaskUser" /></AssociationSet> + <AssociationSet Name="FK_TaskUser_TimeCategory" Association="CronosControl.Model.FK_TaskUser_TimeCategory"> + <End Role="TimeCategory" EntitySet="TimeCategory" /> + <End Role="TaskUser" EntitySet="TaskUser" /></AssociationSet> + <AssociationSet Name="FK_TaskUser_User" Association="CronosControl.Model.FK_TaskUser_User"> + <End Role="User" EntitySet="User" /> + <End Role="TaskUser" EntitySet="TaskUser" /></AssociationSet></EntityContainer> <EntityType Name="Calendar"> <Key> <PropertyRef Name="IdCalendar" /> @@ -1058,7 +1127,7 @@ <Property Name="UpdatedAt" Type="DateTime" /> <NavigationProperty Name="Project" Relationship="CronosControl.Model.FK_Tasks_Project" FromRole="Task" ToRole="Project" /> <NavigationProperty Name="TimeSheetHour" Relationship="CronosControl.Model.FK_TimeSheetHour_Tasks" FromRole="Task" ToRole="TimeSheetHour" /> - </EntityType> + <NavigationProperty Name="TaskUser" Relationship="CronosControl.Model.FK_TaskUser_Task" FromRole="Task" ToRole="TaskUser" /></EntityType> <EntityType Name="TimeCategory"> <Key> <PropertyRef Name="IdTimeCategory" /> @@ -1073,7 +1142,7 @@ <NavigationProperty Name="Company" Relationship="CronosControl.Model.FK_TimeCategory_Company" FromRole="TimeCategory" ToRole="Company" /> <NavigationProperty Name="TimeSheetHour" Relationship="CronosControl.Model.FK_TimeSheetHour_TimeCategory" FromRole="TimeCategory" ToRole="TimeSheetHour" /> <NavigationProperty Name="TimeSheetHourTimeCategory" Relationship="CronosControl.Model.FK_TimeSheetHourTimeCategory_TimeCategory" FromRole="TimeCategory" ToRole="TimeSheetHourTimeCategory" /> - </EntityType> + <NavigationProperty Name="TaskUser" Relationship="CronosControl.Model.FK_TaskUser_TimeCategory" FromRole="TimeCategory" ToRole="TaskUser" /></EntityType> <EntityType Name="TimeSheet"> <Key> <PropertyRef Name="IdTimeSheet" /> @@ -1146,7 +1215,7 @@ <NavigationProperty Name="TimeSheetHour" Relationship="CronosControl.Model.FK_TimeSheetHour_User" FromRole="User" ToRole="TimeSheetHour" /> <NavigationProperty Name="UserProjectRole" Relationship="CronosControl.Model.FK_UserProjectRole_User" FromRole="User" ToRole="UserProjectRole" /> <NavigationProperty Name="UserSession" Relationship="CronosControl.Model.FK_UserSession_User" FromRole="User" ToRole="UserSession" /> - </EntityType> + <NavigationProperty Name="TaskUser" Relationship="CronosControl.Model.FK_TaskUser_User" FromRole="User" ToRole="TaskUser" /></EntityType> <EntityType Name="UserProjectRole"> <Key> <PropertyRef Name="IdUserProjectRole" /> @@ -1350,7 +1419,25 @@ <End Role="UserProjectRole" Type="CronosControl.Model.UserProjectRole" Multiplicity="1" /> <End Role="UserProjectRoleDocument" Type="CronosControl.Model.UserProjectRoleDocument" Multiplicity="*" /> </Association> - </Schema> + <EntityType Name="TaskUser"> + <Key> + <PropertyRef Name="IdTaskUser" /></Key> + <Property Name="IdTaskUser" Type="Int32" Nullable="false" /> + <Property Name="Assigment" Type="Int16" Nullable="false" /> + <Property Name="StartDate" Type="DateTime" Nullable="true" /> + <Property... [truncated message content] |