public static Dal.SubscriptionsTypes PostSubOne(ClassSubscriptionsTypes sub)
        {
            Dal.SubscriptionsTypes s = new Dal.SubscriptionsTypes()
            {
                name        = sub.name,
                duration    = sub.duration,
                lessons_num = sub.lessons_num,
                price       = sub.price
            };

            return(s);
        }
        public static ClassSubscriptionsTypes GetDtoSubOne(Dal.SubscriptionsTypes sub)
        {
            ClassSubscriptionsTypes s = new ClassSubscriptionsTypes()
            {
                name        = sub.name,
                duration    = sub.duration,
                lessons_num = sub.lessons_num,
                price       = sub.price
            };

            return(s);
        }
Example #3
0
 public static void PostSubscription(SubscriptionsTypes s)
 {
     try
     {
         using (GymDBEntities g = new GymDBEntities())
         {
             g.SubscriptionsTypes.Add(s);
             g.SaveChanges();
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }