public FoundFMessage(FMessage message, int page, FSection section, FSubsection subsection, FTopic topic) { FMessage = message; FSection = section; FSubsection = subsection; FTopic = topic; Page = page; }
public ActionResult NewFSubsection(string sName, int sectionId) { if ((sName != "") && (sName.Length < 51)) { FSubsection subsection = new FSubsection(); subsection.FSectionId = sectionId; subsection.Name = sName; subsection.Closed = 0; subsection.LastFMsgDate = DateTime.Now; subsection.FTopicId = 0; subsection.UserId = 0; subsection.NumFMsgs = 0; subsection.NumFTopics = 0; subsection.OrderNum = 0; context.AddFSubsection(subsection, sectionId); } ViewData["Role"] = GetCurrentUserRole(); ViewData["FSectionId"] = sectionId; return RedirectToAction("FSubsections", new { sectionId = sectionId}); }
public void AddFSubsection(FSubsection subsection, int sectionId) { GetFSectionById(sectionId).NumFSubsections++; FSubsections.Add(subsection); SaveChanges(); }
public FoundFTopic(FTopic topic, int page, FSection section, FSubsection subsection) { FTopic = topic; Page = page; FSection = section; FSubsection = subsection; }
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)); } } }
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); //Добавление подходящих сообщений } }
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)); } }