Click here to Skip to main content
15,888,068 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
there is two users type in my project
one is user and other is admin
in admin there is several designations and departments

and i try to upload documents for users and admin in separate manger...for user i sucessfully done
but i admin

so there is a admin abc whose designation type is supervsior and their department is computer science

now i want when admin upload any document then his/her designation and department type also save in table...

when user create theri account
then it see like this this is users table when user signup then his/her record save in table

SQL
UserID UserName Password UserTypeID DepID FullName  DocID Email   DesigID
51  Noreen  Fatima        2         NULL    NULL    NULL    noa@gil.com             4
52  Admin   Document      1          2     NULL    NULL    NULL    NULL        
53  Sundus Khan Khan      1          2    NULL     NULL    Sund@hotmail.com      1
54  Hira    Mansoor       1          2   NULL     NULL    hirr@gmail.com        2
55  Sana    Khan          1          2   NULL     NULL    san@gmail.com         3
56  sundus  sundus        1         2   NULL      NULL    Sunn@hotmail.com          1




and this document table upload documents are save in this table


SQL
DocIDDocNameUploadedDateUploadfileDocTypeID DepID ApproveID UploadedByUserIDViewedID    UserTypeID
51    Mang    2014-02-04 17:11:09.090 Presentation1.pptx  1   2   3   Noreen  51  NULL    NULL
52    dasdasdasd  2014-02-05 10:37:35.493 Presentation1.pptx  1   1   3   Admin   52  0   NULL
53    cv manaual  2014-02-05 11:49:43.050 CV.docx 1   2   3   Noreen  51  0   NULL
54    dsfsdfsdf   2014-02-05 20:05:42.340 eco 2.docx  1   2   3   Noreen  51  0   NULL
55      sadasdasd   2014-02-06 00:01:55.940 okara.docx  1   1   3   Admin   52  1   NULL
56    sdasdasd    2014-02-06 00:35:47.383 CV.docx 1   2   1   noreen  51  1   NULL
57    dsf 2014-02-06 01:59:50.683 dotnetcodes.docx    1   2   3   Sundus Khan 53  1   2



and this sp for upload document for userss
SQL
ALTER procedure [dbo].[fileupload]
@DocDesciption nvarchar(50),
@DocName nvarchar(50),
@Uploadfile nvarchar(50),
@DocTypeID int,
@DepID int,
@UploadedBy nvarchar(50),
@UserID int
as
insert into DocumentInfo(DocDesciption,DocName,UploadedDate,Uploadfile,DocTypeID,DepID,UploadedBy,ApproveID,UserID,ViewedID )
values(@DocDesciption,@DocName,GETDATE(),@Uploadfile,@DocTypeID,@DepID,@UploadedBy,3,@UserID,'1' )



then how i create sp of fileupload for admins

any help please?
Posted
Updated 5-Feb-14 10:55am
v2
Comments
ZurdoDev 5-Feb-14 21:15pm    
What's your question?
Diya Ayesa 6-Feb-14 0:11am    
my question is how i create sp for admins?
ZurdoDev 6-Feb-14 7:07am    
Why is it hard? Where are you stuck?
Diya Ayesa 6-Feb-14 18:55pm    
in sp... beacuse user sp is differnet and users choose department and upload documents in any departments whereas suppose admin desigantion is finance then when he upload document then i want to set value in sp for finance beacuse admin not choose departments beacuse his desgiantion is finance and he will not able to upload document to other departments e.g computer science ,hr etc
ZurdoDev 6-Feb-14 20:59pm    
So pass in the userid and handle it accordingly. I still don't see where you are stuck.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900