public void DoObsoleteStore(FranchiseStore store, string userId)
 {
     store.IsObsolete  = true;
     store.UserIdUpd   = userId;
     store.DatetimeUpd = DateTime.Now;
     DbEntities.SaveChanges();
 }
        public void Add(StoreUpModel model)
        {
            var franchiseStore = new FranchiseStore
            {
                AddressId                = model.AddressId,
                FranchiseId              = model.FranchiseId,
                Name                     = model.Name,
                UserIdIns                = model.UserInsUpId,
                DatetimeIns              = DateTime.Today,
                IsObsolete               = false,
                WsAddress                = model.WsAddress,
                ManageUserId             = model.ManUserId,
                StoreEmail               = model.StoreEmail,
                HasSendEmailWhenNewOrder = model.HasSendEmailWhenNewOrder
            };

            DbEntities.FranchiseStore.Add(franchiseStore);
            DbEntities.SaveChanges();
        }