Ejemplo n.º 1
0
 public FoundFMessage(FMessage message, int page, FSection section, FSubsection subsection, FTopic topic)
 {
     FMessage = message;
     FSection = section;
     FSubsection = subsection;
     FTopic = topic;
     Page = page;
 }
Ejemplo n.º 2
0
        public ActionResult NewFSection(string sName)
        {
            if ((sName != "") && (sName.Length < 51))
            {
                FSection section = new FSection();
                section.Name = sName;
                section.Closed = 0;
                section.NumFMsgs = 0;
                section.NumFSubsections = 0;
                section.NumFTopics = 0;
                section.OrderNum = 1;

                context.AddFSection(section);
                foreach (FSection fsection in context.GetAllFSections())
                {
                    fsection.OrderNum++;
                }
                context.SaveChanges();
            }
            return RedirectToAction("FSections");
        }
Ejemplo n.º 3
0
 public void AddFSection(FSection section)
 {
     FSections.Add(section);
     SaveChanges();
 }
Ejemplo n.º 4
0
 public FoundFTopic(FTopic topic, int page, FSection section, FSubsection subsection)
 {
     FTopic = topic;
     Page = page;
     FSection = section;
     FSubsection = subsection;
 }
Ejemplo n.º 5
0
        public void FindFMessages(FTopic topic, FSubsection subsection, FSection section)
        {
            List<FMessage> FMessages = context.GetFMessagesByFTopicId(topic.Id);
            for (int MsgNum = 0; MsgNum < FMessages.Count; MsgNum++)
            {
                FMessage message = FMessages[MsgNum];
                if (HasAnswer(message.Text))
                {
                    double a = (double)(FoundFMessages.Count + 1) / (double)MsgsPerPage;
                    int Page = (int)Math.Ceiling(a);

                    FoundFMessages.Add(new FoundFMessage(message, Page, section, subsection, topic));
                }
            }
        }
Ejemplo n.º 6
0
        public void CheckFTopics(FSection section, FSubsection subsection)
        {
            List<FTopic> FTopics = context.GetFTopicsByFSubsectionId(subsection.Id);
            for (int TpcNum = 0; TpcNum < FTopics.Count; TpcNum++)
            {
                FTopic topic = FTopics[TpcNum];

                CheckFTopic(topic, TpcNum, section, subsection); //Проверка темы и добавление в случае совпадения
                FindFMessages(topic, subsection, section); //Добавление подходящих сообщений
            }
        }
Ejemplo n.º 7
0
        public void CheckFTopic(FTopic topic, int TpcNum, FSection section, FSubsection subsection)
        {
            if (HasAnswer(topic.Name))
            {
                double a = (double)(FoundFMessages.Count + 1) / (double)TpcsPerPage;
                int Page = (int)Math.Ceiling(a);

                FoundFTopics.Add(new FoundFTopic(topic, Page, section, subsection));
            }
        }
Ejemplo n.º 8
0
 public void CheckFSubsections(FSection section)
 {
     List<FSubsection> FSubsections = context.GetFSubsectionsByFSectionId(section.Id);
     foreach (FSubsection subsection in FSubsections)
     {
         CheckFTopics(section, subsection);
     }
 }