Пример #1
0
        //Get the content of an element from the web interface
        //Returns elementID, and its content
        public ContentQuery getInterfaceElement(String element)
        {
            try
            {
                using (conferenceadminContext context = new conferenceadminContext())
                {
                    ContentQuery webInterface = new ContentQuery();
                    //Select element and save its content
                    webInterface = context.interfaceinformations.Where(inter => inter.attribute == element).Select(inter => new ContentQuery
                    {
                        interfaceID = (int)inter.interfaceID,
                        content = inter.content

                    }).FirstOrDefault();

                    if (webInterface.content == null)
                    {
                        webInterface.content = "";
                    }

                    return webInterface;
                }
            }
            catch (Exception ex)
            {
                Console.Write("WebManager.get" + element + " error " + ex);
                return null;
            }
        }
Пример #2
0
        //Get the deadlines of an specified submission
        public ContentQuery getDeadlineElement(String element)
        {
            try
            {
                using (conferenceadminContext context = new conferenceadminContext())
                {
                    ContentQuery webInterface = new ContentQuery();

                    //Get element and save its content (date)
                    webInterface = context.submissiontypes.Where(inter => inter.name == element).Select(inter => new ContentQuery
                    {
                        content = inter.deadline

                    }).FirstOrDefault();

                    if (webInterface.content == null)
                    {
                        webInterface.content = "";
                    }

                    return webInterface;
                }
            }
            catch (Exception ex)
            {
                Console.Write("WebManager.get" + element + " error " + ex);
                return null;
            }
        }