Beispiel #1
0
        public ActionResult DeleteTopic(long id, FormCollection collection)
        {
            try
            {
                TopicFactory DeleteTopic = new TopicFactory();
                TopicEntity  Topic       = new TopicEntity();
                Topic = DeleteTopic.GetTopicById(id);

                DataLayer.tblTopic NewTopic = new DataLayer.tblTopic();
                NewTopic.TopicId     = id;
                NewTopic.ChannelId   = Topic.ChannelId;
                NewTopic.TopicName   = Topic.TopicName;
                NewTopic.CreatedDate = Topic.CreatedDate;
                NewTopic.CreatedBy   = Topic.CreatedBy;
                NewTopic.UpdatedDate = DateTime.Now;
                NewTopic.UpdatedBy   = null;
                NewTopic.IsActive    = false; // IsActive will be false in delete record

                DeleteTopic.SaveTopic(NewTopic);

                return(RedirectToAction("Topic"));
            }
            catch
            {
                return(View());
            }
        }
Beispiel #2
0
        // GET: Topic/Delete/5
        public ActionResult DeleteTopic(long id)
        {
            TopicFactory EditTopic = new TopicFactory();
            TopicEntity  topic     = new TopicEntity();

            topic = EditTopic.GetTopicById(id);
            return(View(topic));
        }
Beispiel #3
0
 // GET: Topic/Edit/5
 public ActionResult EditTopic(long id)
 {
     try
     {
         TopicFactory EditTopic = new TopicFactory();
         TopicEntity  topic     = new TopicEntity();
         topic = EditTopic.GetTopicById(id);
         return(View(topic));
     }
     catch
     {
         return(View());
     }
     finally {
         GetChannel();
     }
 }