public override string ToString() { var properties = new Dictionary <string, string> { { "Report_Type", Report_Type.ToString() }, { "FileGlobs", StringifyList(FileGlobs) } }; return(StringifyValues(GetType().ToString(), properties)); }
public override bool Equals(object obj) { var other = obj as ReportNode; if (other == null) { return(false); } return(Report_Type.Equals(other.Report_Type) && ListsAreEqual(FileGlobs, other.FileGlobs)); }
public static void DeleteReportType(int reporttypeID) { using (ctaDBEntities entities = new ctaDBEntities()) { Report_Type st = entities.Report_Type.Where(s => s.Id == reporttypeID).FirstOrDefault(); if (st != null) { entities.Report_Type.Remove(st); entities.SaveChanges(); } if (!(entities.Database.Connection.State == ConnectionState.Closed)) { entities.Database.Connection.Close(); } } }
public static void UpdateReportType(ReportTypeModel reportTypeModel) { using (ctaDBEntities entities = new ctaDBEntities()) { Report_Type st = entities.Report_Type.Where(s => s.Id == reportTypeModel.Id).FirstOrDefault(); if (st != null) { st.name = reportTypeModel.name; st.active = reportTypeModel.active; entities.SaveChanges(); } if (!(entities.Database.Connection.State == ConnectionState.Closed)) { entities.Database.Connection.Close(); } } }
public static void CreateReportType(ref ReportTypeModel reportTypeModel) { using (ctaDBEntities entities = new ctaDBEntities()) { Report_Type st = new Report_Type() { name = reportTypeModel.name, active = reportTypeModel.active }; entities.Report_Type.Add(st); entities.SaveChanges(); reportTypeModel.Id = st.Id; if (!(entities.Database.Connection.State == ConnectionState.Closed)) { entities.Database.Connection.Close(); } } }