Пример #1
0
        public Timeline updateTimeLineToSQL(Timeline timeline)
        {
            try
            {
                PurpleBadgeEntities db = new PurpleBadgeEntities();

                var result = db.Timelines.Find(timeline);
                if (result == null)
                {
                    return(null);
                }
                if (result != null)
                {
                    result.exitTime = DateTime.Today;
                }

                db.SaveChanges();
                return(timeline);
            }

            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Пример #2
0
        public Business addBusinessToSQL(Business business)
        {
            try
            {
                PurpleBadgeEntities db = new PurpleBadgeEntities();

                db.Businesses.Add(business);
                db.SaveChanges();
                return(business);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
 public BusinessUser addBusinessuserToSQL(BusinessUser businessUser)
 {
     try
     {
         PurpleBadgeEntities db = new PurpleBadgeEntities();
         
             db.BusinessUsers.Add(businessUser);
             db.SaveChanges();
             return businessUser;
         
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Пример #4
0
        public Timeline addTimeLineToSQL(Timeline timeline)
        {
            try
            {
                PurpleBadgeEntities db = new PurpleBadgeEntities();

                db.Timelines.Add(timeline);
                db.SaveChanges();
                return(timeline);
            }

            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        public Customer addCusstomerToSQL(Customer customer)
        {
            try
            {
                PurpleBadgeEntities db = new PurpleBadgeEntities();

                db.Customers.Add(customer);
                db.SaveChanges();
                return(customer);
            }

            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }