コード例 #1
0
ファイル: FSearch.cs プロジェクト: Drumofrain/netservices
 public FoundFMessage(FMessage message, int page, FSection section, FSubsection subsection, FTopic topic)
 {
     FMessage = message;
     FSection = section;
     FSubsection = subsection;
     FTopic = topic;
     Page = page;
 }
コード例 #2
0
        public ActionResult NewFTopic(string tName, int subsectionId, int sectionId)
        {
            if ((tName != "") && (tName.Length < 51) && (((context.GetFSubsectionById(subsectionId).Closed == 0) && (context.GetFSectionById(sectionId).Closed == 0))  || (GetCurrentUserRole() == 2)  ))
            {
                FTopic topic = new FTopic();
                topic.FSubsectionId = subsectionId;
                topic.Name = tName;
                topic.Closed = 0;
                topic.Fix = 0;
                topic.LastFMsgDate = DateTime.Now;
                topic.UserId = 0;
                topic.NumFMsgs = 0;
                topic.NumViews = 0;

                context.AddFTopic(topic, subsectionId, sectionId);
                context.SaveChanges();
            }

            return RedirectToAction("FTopics", new { subsectionId = subsectionId, sectionId = sectionId });
        }
コード例 #3
0
ファイル: FSContext.cs プロジェクト: Drumofrain/netservices
 public void AddFTopic(FTopic topic, int subsectionId, int sectionId)
 {
     GetFSectionById(sectionId).NumFTopics++;
     GetFSubsectionById(subsectionId).NumFTopics++;
     FTopics.Add(topic);
     SaveChanges();
 }
コード例 #4
0
ファイル: FSearch.cs プロジェクト: Drumofrain/netservices
 public FoundFTopic(FTopic topic, int page, FSection section, FSubsection subsection)
 {
     FTopic = topic;
     Page = page;
     FSection = section;
     FSubsection = subsection;
 }
コード例 #5
0
ファイル: FSearch.cs プロジェクト: Drumofrain/netservices
        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));
                }
            }
        }
コード例 #6
0
ファイル: FSearch.cs プロジェクト: Drumofrain/netservices
        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));
            }
        }