Exemple #1
0
        public static void Insert(SendMethod sendMethod)
        {
            using (var db = OnlineStoreDbContext.Entity)
            {
                db.SendMethods.Add(sendMethod);

                db.SaveChanges();
            }
        }
Exemple #2
0
        public static void Update(SendMethod sendMethod)
        {
            using (var db = OnlineStoreDbContext.Entity)
            {
                var orgSendMethod = db.SendMethods.Where(item => item.ID == sendMethod.ID).Single();

                orgSendMethod.Title       = sendMethod.Title;
                orgSendMethod.Filename    = sendMethod.Filename;
                orgSendMethod.Description = sendMethod.Description;
                orgSendMethod.Price       = sendMethod.Price;
                orgSendMethod.IsActive    = sendMethod.IsActive;
                orgSendMethod.LastUpdate  = sendMethod.LastUpdate;

                db.SaveChanges();
            }
        }