Link to home
Start Free TrialLog in
Avatar of vinhthuy_nguyen
vinhthuy_nguyen

asked on

Online-newspaper idea.

Hi,
I'm building kind of a  online-newspaper project,but now I'm stuck in the Admin part, I will describe it like this :
There are 2 tables in SQL Server that I store all the news ,I call it 1 and 2,
1 store all the news : Pending and also the Published, and 2 store only the Published.

There's 1 acc for the admin and many for the reporters
+ The reporter write a news on the site, a database store it with the status : Pending -> store in the table 1.
+The Admin can write a news also.
+ The Admin comes to the site everyday, check if there's some Pending news, read them, edit, and change the status to Published -> save changes in table 1 and create a new record in table 2.
+The Admin want to edit a news with the status "Published" , he change it in table 2, and when he save , also that news in table 1 also will be save.
+The Admin want to delete a news with the status "Published", he delete it in table 2, and also that news in table 1 will be delete.

I don't know if it's enough for all the case happen.
And now it's hard for me to show all of them in 1 aspx page.
With the page Admin_news.aspx , I have to do tasks :  create new Pending/Published news, edit Pending/Published news, change Pending/Published news status, delete Pending/Published news .
I put a radio button on the page for the Admin can change the status : Pending and Published.
All I need is an idea, how to do it in the right way.
And if you have any experiences in this kind of project, pls advise any idea to make it improve .
Very appriciate with all comments. Nice day
Thanks
ASKER CERTIFIED SOLUTION
Avatar of rugu_16
rugu_16

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vinhthuy_nguyen
vinhthuy_nguyen

ASKER

Thanks guys,
Rugu, Tusharashah, this is not a very big project at the moment, but I think there'll be quite many readers so it must have great performance. And that I think I should split it to 2 tables, table 2 is use for admin insert news and the readers read, and 1 for the reporters and admin.  
(1) Yes, I think fast data edit is a nice idea. I already have it in my datagrid editing.
(2) I don't like frame much.
(3) Acctually I have a table comments for all the news, but still not use it, :-) , and always very glad to hear more from you.

And the below problem too, I think it easy to solve but acctually I'm almost lost now after 3 unsleep days. :-(
I mean here is the specified page in the project that I use for news editing , I called Admin_news.aspx. In this page I have to do all the tasks above. Let's me make the page things more clear :
I have these in this page :
- A User Control use for a Navigation
- some textboxs for data fields
- a dropdownbox for choosing the zone for this news.
- 2 radio buttons for select the status

And now, all the case I think out here is and also with the query string to do the task :
- Add a new news - save it Pending/Published    ->Admin_news?do=new&zone=abc
- Edit a Pending news - save it Pending             ->Admin_news?do=edit&zone=abc&id=123
- Edit a Pending news - save it Published             ''
- Edit a Published news - save it Pending             ''
- Edit a Published news - save it Published           ''
- Delete a Pending news
- Delete a Published news
I'm ok with the new one.
But i'm stuck in how to know when the user change the status Pending/Published, how to regconize and save it correctly.
Do I need a public variable that store the the status when the first Page_Load for editing news , and I just compare it with the radio button value after editing ?
If so, pls help me to declare it .
And hope you help me with more idea.
Nice day.
Do you have a Save button, after they Change Status from Pending --> Published?

Whenever they Hit save the data should be copied in your DataBase server, so that it can be reflected at every places where your website is being accessed. And you'll have current and accurate status in every page of your website without storing it in any temp variable.

(in anycase you if you prefere to store it in temp variable then you can save status in Session["Status"] variable and retrieve it anywhere)

-tushar

Yes, I have Save button, may be I don't make thing clear enough,
Let me go out for coffe and come back to you guys later.
Nice day.
Hi guys, can you give some more ideas ? Acctually I just want to ask you the right way that all the programmer do, I don't have any experience in this project.
Hello vinthuy_nguyen,

Can you be more specific?

-tushar
OK, hope the code make things clear .
With the table A and table B as above.
Sub Save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Save.Click
            If Request.QueryString("do") = "new" Then
                   If status="Pending" Then
                           'Insert new record to table A with status "Pending"

                   Else
                          'Insert new record to table A with status "Published"
                          'Insert new record to table B
                   End If
           Else
                   If status="Pending" Then
                          'check the origin status
                          If the origin status is Pending
                                     'Update record in table A
                          Else (the origin status is Published)
                                     'Delete the record in table B
                                     'Update the record in table A
                   Else
                         'check the origin status
                          If the origin status is Pending
                                     'Update record in table A
                                     'Insert record in table B
                          Else (the origin status is Published)
                                     'Update the record in table A
                                     'Update the record in table B


           End If

        End Sub
I need here is a way to check and store the origin status.Did it clear ? Pls ask if it not clear, I'm bad at explanation.

Another thing, can you advise me some more specific features for my project ? Do they call it a CMS ?
Thanks for all the advices.
Thanks for advices, buddies.