public void Update(PropertyFeatureView model, int CoreSystemUserId) { try { using (JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext()) { DataAccess.PropertyFeature table = db.PropertyFeatures.FirstOrDefault(x => x.PropertyFeatureId == model.PropertyFeatureId); LoadEditLogDetails(table.PropertyFeatureId, CoreSystemUserId); JazMax.BusinessLogic.ChangeLog.ChangeLogService.LogChange(table.FeatureName, model.FeatureName, "Feature Name"); if (table != null) { table.IsFeatureActive = true; table.FeatureName = model.FeatureName; db.SaveChanges(); } } } catch (Exception e) { JazMax.BusinessLogic.AuditLog.ErrorLog.LogError(e, 0); } }
public void Create(PropertyFeatureView model) { try { using (JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext()) { DataAccess.PropertyFeature table = new DataAccess.PropertyFeature() { IsFeatureActive = true, FeatureName = model.FeatureName }; db.PropertyFeatures.Add(table); db.SaveChanges(); } } catch (Exception e) { JazMax.BusinessLogic.AuditLog.ErrorLog.LogError(e, 0); } }
public void Activation(bool isAction, int PropertyFeatureId, int UserId) { try { using (JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext()) { DataAccess.PropertyFeature table = db.PropertyFeatures.FirstOrDefault(x => x.PropertyFeatureId == PropertyFeatureId); LoadEditLogDetails(table.PropertyFeatureId, UserId); if (table != null) { if (isAction) { JazMax.BusinessLogic.ChangeLog.ChangeLogService.LogChange( JazMax.BusinessLogic.ChangeLog.ChangeLogService.GetBoolString(table.IsFeatureActive), JazMax.BusinessLogic.ChangeLog.ChangeLogService.GetBoolString(true), "Active Status"); table.IsFeatureActive = true; } else { JazMax.BusinessLogic.ChangeLog.ChangeLogService.LogChange( JazMax.BusinessLogic.ChangeLog.ChangeLogService.GetBoolString(table.IsFeatureActive), JazMax.BusinessLogic.ChangeLog.ChangeLogService.GetBoolString(false), "Active Status"); table.IsFeatureActive = false; } } db.SaveChanges(); } } catch (Exception e) { JazMax.BusinessLogic.AuditLog.ErrorLog.LogError(e, 0); } }