Example #1
0
 public static AttritionModel FromDomainModel(Attrition attrition)
 {
     return new AttritionModel {
         Id = attrition.Id,
         Name = attrition.Name,
         Description = attrition.Description,
         Designation = attrition.Designation
     };
 }
Example #2
0
 public void UpdateAttrition(Attrition attrition)
 {
     var oldAttrition = GetAttrition(attrition.Id);
     oldAttrition.Name = attrition.Name;
     oldAttrition.Description = attrition.Description;
     oldAttrition.Designation = attrition.Designation;
     var head = _attritionHeaders.Fetch().Single(x => x.Id == attrition.AttritionHead.Id);
     oldAttrition.AttritionHead = head;
     attritionRepo.SaveChanges();
     _attritionHeaders.SaveChanges();
 }
Example #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Attritions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToAttritions(Attrition attrition)
 {
     base.AddObject("Attritions", attrition);
 }
Example #4
0
 public void UpdateAttrition(Attrition attrition)
 {
     var oldAttrition = GetAttrition(attrition.Id);
     oldAttrition.Name = attrition.Name;
     oldAttrition.Description = attrition.Description;
     oldAttrition.Designation = attrition.Designation;
     attritionRepo.SaveChanges();
 }
Example #5
0
 /// <summary>
 /// Create a new Attrition object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="objectInfo">Initial value of the ObjectInfo property.</param>
 /// <param name="designation">Initial value of the Designation property.</param>
 public static Attrition CreateAttrition(global::System.Int32 id, global::System.String name, ObjectInfo objectInfo, global::System.String designation)
 {
     Attrition attrition = new Attrition();
     attrition.Id = id;
     attrition.Name = name;
     attrition.ObjectInfo = StructuralObject.VerifyComplexObjectIsNotNull(objectInfo, "ObjectInfo");
     attrition.Designation = designation;
     return attrition;
 }