public void HotelPhotoCategoryDelete(int PhotoCategoryId) { Htl_HotelPhotoCategories result = ent.Htl_HotelPhotoCategories.Where(x => x.PhotoCategoryId == PhotoCategoryId).FirstOrDefault(); ent.DeleteObject(result); ent.SaveChanges(); }
public void HotelPhotoCategoryEdit(HotelPhotoCategories model) { Htl_HotelPhotoCategories result = ent.Htl_HotelPhotoCategories.Where(x => x.PhotoCategoryId == model.PhotoCategoryId).FirstOrDefault(); result.PhotoCategoryId = model.PhotoCategoryId; result.CategoryName = model.CategoryName; result.Details = model.Details; result.HotelId = model.HotelId; result.isActive = model.isActive; result.UpdatedBy = App_Class.AppSession.LogUserID; result.UpdatedDate = DateTime.Now; ent.ApplyCurrentValues(result.EntityKey.EntitySetName, result); ent.SaveChanges(); }
public void HotelPhotoCategoryAdd(HotelPhotoCategories model) { Htl_HotelPhotoCategories obj = new Htl_HotelPhotoCategories { CategoryName = model.CategoryName, Details = model.Details, HotelId = model.HotelId, isActive = model.isActive, CreatedBy = App_Class.AppSession.LogUserID, CreatedDate = DateTime.Now, }; ent.AddToHtl_HotelPhotoCategories(obj); ent.SaveChanges(); }