Beispiel #1
0
        public override string ToString()
        {
            var properties = new Dictionary <string, string>
            {
                { "Report_Type", Report_Type.ToString() },
                { "FileGlobs", StringifyList(FileGlobs) }
            };

            return(StringifyValues(GetType().ToString(), properties));
        }
Beispiel #2
0
        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));
        }
Beispiel #3
0
        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();
                }
            }
        }
Beispiel #4
0
        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();
                }
            }
        }
Beispiel #5
0
        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();
                }
            }
        }