public static void DeleteProfileAddress(int id) { using (var db = new Data.DrinkzAppBDDataContext()) { var dbAddress = db.Addresses.Where(c => c.FK_PROFILE == id).FirstOrDefault(); db.Addresses.DeleteOnSubmit(dbAddress); db.SubmitChanges(); } }
public static void UpdateAddress(Dto.Address address) { using (var db = new Data.DrinkzAppBDDataContext()) { var dbAddress = db.Addresses.Where(c=> c.FK_PROFILE == address.FK_PROFILE).FirstOrDefault(); dbAddress.STATE = address.STATE; dbAddress.ZIP_CODE = address.ZIP_CODE; dbAddress.STREET = address.STREET; db.SubmitChanges(); } }
public static void UpdateProfile(Dto.Profile Profile) { using (var db = new Data.DrinkzAppBDDataContext()) { var dbProfile = db.Profiles.Where(c => c.PK_PROFILE == Profile.PK_PROFILE).FirstOrDefault(); dbProfile.OS_ID = Profile.OS_ID; dbProfile.NAME = Profile.NAME; dbProfile.URL_IMAGE = Profile.URL_IMAGE; dbProfile.DEVICE_ID = Profile.DEVICE_ID; dbProfile.FACEBOOK_ID = Profile.FACEBOOK_ID; db.SubmitChanges(); } }
public static void CreateNewAddress(Dto.Address address) { using (var db = new Data.DrinkzAppBDDataContext()) { var dbAddress = new Data.Address() { FK_PROFILE = address.FK_PROFILE, STATE = address.STATE, STREET = address.STREET, ZIP_CODE = address.ZIP_CODE, }; db.Addresses.InsertOnSubmit(dbAddress); db.SubmitChanges(); } }