Exemplo n.º 1
0
 public FAMILIES CreateFamily(FamiliesViewModel family)
 {
     return(new FAMILIES
     {
         FAMILY_ID = family.FamilyId,
         NAME = family.Name
     });
 }
Exemplo n.º 2
0
 public int AddFamily(FamiliesViewModel family)
 {
     try
     {
         var fam = ModelFactory.CreateFamily(family);
         db.FAMILIES.Add(fam);
         SaveAll();
         return(fam.FAMILY_ID);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
         throw;
     }
 }
Exemplo n.º 3
0
 public bool UpdateFamily(FamiliesViewModel family)
 {
     db.Entry(GetFamilyById(family.FamilyId)).CurrentValues.SetValues(ModelFactory.CreateFamily(family));
     return(SaveAll());
 }