Beispiel #1
0
        public ProgramQuery getProgramDocument()
        {
            try
            {
                ProgramQuery programInfo = new ProgramQuery();

                using (conferenceadminContext context = new conferenceadminContext())
                {

                    var program = (from s in context.interfacedocuments
                                   where s.attibuteName == "agendaPDF"
                                   select s).FirstOrDefault();

                    if (program != null)
                    {
                        programInfo.program = program.content;
                    }
                }

                return programInfo;
            }
            catch (Exception ex)
            {
                Console.Write("WebManager.getProgramDocument error " + ex);
                return null;
            }
        }
Beispiel #2
0
        //Update conference program documents
        public bool saveProgram(ProgramQuery programInfo)
        {
            try
            {
                using (conferenceadminContext context = new conferenceadminContext())
                {
                    //Get element (occurs for each element)
                    var program = (from s in context.interfacedocuments
                                   where s.attibuteName == "agendaPDF"
                                   select s).FirstOrDefault();
                    //Save content
                    if (program != null && programInfo.program != null && programInfo.program != "")
                        program.content = programInfo.program;

                    var abstracts = (from s in context.interfacedocuments
                                     where s.attibuteName == "abstractPdf"
                                     select s).FirstOrDefault();

                    if (abstracts != null && programInfo.abstracts != null && programInfo.abstracts != "")
                        abstracts.content = programInfo.abstracts;

                    context.SaveChanges();
                    return true;
                }
            }
            catch (Exception ex)
            {
                Console.Write("WebManger.saveProgram error " + ex);
                return false;
            }
        }