Upload
kabir-rajput
View
219
Download
0
Embed Size (px)
Citation preview
7/29/2019 WCMS Report (2)
1/47
PROJECT REPORT
ON
WEB CONTENT MANAGEMENT SYSTEM
SUBMITTED AS A PART OF COURSE CURRICULUM FOR
DEGREE OF BECHELOR OF TECHNOLOGY
IN
INFORMATION TECHNOLOGY
UNDER THE GUIDENCE OF:- SUBMITTED
BY:-
Er. CHHOTU SHARMA KHUSHBU GOYAL
Roll No. 2209621
Date: September 20 2011 B.Tech 5TH SEM.
DEPARTMENT OF INFORMATION TECHNOLOGY
SWAMI DEVI DYAL INSTITUTE OF ENGINEERING & TECHNOLOGY
DISTT.- PANCHKULA (BARWALA)
7/29/2019 WCMS Report (2)
2/47
HARYANA- 134118
7/29/2019 WCMS Report (2)
3/47
ACKNOWLEDGEMENT
Apart from the efforts of me, the success of my project depends largely
on the encouragement and guidelines of many others. I take this
opportunity to express my gratitude to the people who have been
instrumental in the successful completion of this project.
I would like to show my greatest appreciation to my project in-charge,
Mrs. Shalini Sharma. I cant say thank you enough for the tremendous
support and help. I feel motivated and encouraged every time I attend
her meeting. Without her encouragement and guidance this project work
would not have materialized.
Im highly grateful to Mr. Chhotu Sharma, chief instructor at
CS-InfoTech, for his thorough guidance right from day 1 till the end of
training. He actually laid the ground for conceptual understanding of
technologies used in project.
7/29/2019 WCMS Report (2)
4/47
TABLE OF CONTENTS
S. NO. TOPIC PAGE NO.
I Training Certificates
II Acknowledgement
1. Introduction 1-11
(i) Statement about the problem-
Existing system
1
(ii) Objectives of Project 2
(iii) Working Environment 2-11
2. System Design 18
(i) Entity Relationship Model 19
(ii) Data Flow Diagram 19
(iii) Database Files 20
(iv) Relations in the Databases 21-24
3. Coding 29-42
4. Screen Shots
INTRODUCTION
7/29/2019 WCMS Report (2)
5/47
Project Title : WEB CONTENT
MANAGEMENT SYSTEM
Project Duration: 6 Weeks
Project category: Web Based Application
The project named WEB CONTENT MANAGEMENT SYSTEM isdeveloped using ASP.NET during the industrial training. This project
has been developed in partial fulfilment of Requirements for the degree
of BE. (IT), from Kurukshetra University (Kurukshetra)
A web content management system (WCMS) is a software system that
provides website authoring, collaboration, and administration toolsdesigned to allow users with little knowledge of web programming
languages ormark-up languages to create and manage website content
with relative ease. A robust WCMS provides the foundation for
collaboration, offering users the ability to manage documents and output
for multiple author editing and participation. It uses a database to store
page content, metadata, and other information assets that might be
needed by the system.
STATEMENT ABOUT PROBLEM
http://en.wikipedia.org/wiki/Websitehttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Markup_languagehttp://en.wikipedia.org/wiki/Databasehttp://en.wikipedia.org/wiki/Metadatahttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Markup_languagehttp://en.wikipedia.org/wiki/Databasehttp://en.wikipedia.org/wiki/Metadatahttp://en.wikipedia.org/wiki/Website7/29/2019 WCMS Report (2)
6/47
A WCMS allows non-technical users to make changes to a website with
little training. A WCMS typically requires a systems administrator
and/or a web developer to set up and add features, but it is primarily a
website maintenance tool for non-technical staff.
7/29/2019 WCMS Report (2)
7/47
OBJECTIVE
OF
PROJECT
7/29/2019 WCMS Report (2)
8/47
OBJECTIVES OF PROJECT
Whether you are using a WCMS to manage an Internet, Extranet or
Intranet - the business benefits that can be derived from such a solutiondo of course vary. The suggestions below are by no means an exhaustive
list of all the benefits and it would be worth reading the documentation
on personalization, collaboration and portals in combination with the
documentation on WCMS as increasingly business benefits can be
derived indirectly for these capabilities with the WCMS underpinning
them to provide a single solution.
The website is easy to use and understand by anyone
A WCMS enables information to be fresh, consistent & high quality.
Reduced customer (internal and external) dissatisfaction created by
having incorrect information.
Reduction in legal issues created by displaying incorrect information.
Increased value perception of the information provided.
There is a higher likelihood of a customer re-visiting the site.
Some search engines rank pages that change frequently higher insearch results.
A WCMS facilitates the re-use of content.
The re-use of content across multiple web sites or pages creates an
enhanced productivity value.
A WCMS enhances productivity and job satisfaction of the web team.
Webmasters can focus on technology and areas such as redesign and
functionality.
A more appropriate use of the web team results in lowered productioncosts.
Enables a quick response to changes on competitors web sites.
There is no specific web browser that you must have or install before
using
http://www.contentmanager.eu.com/personalisation.htmhttp://www.contentmanager.eu.com/collaboration.htmhttp://www.contentmanager.eu.com/portal.htmhttp://www.contentmanager.eu.com/personalisation.htmhttp://www.contentmanager.eu.com/collaboration.htmhttp://www.contentmanager.eu.com/portal.htm7/29/2019 WCMS Report (2)
9/47
PLATFORMDISCRIPTION
7/29/2019 WCMS Report (2)
10/47
WORKING ENVIRO NMENT
Understanding .Net Frame Work
DEFINITION:
The .Net framework can be defined as a language neutral platform designed to
provide a number of rich and powerful application development tools and
technologies. It has an extensive class library that provides wide-ranging support
for data access. .Net framework has an independent code execution and
management environment called the Common Language Runtime (CLR) which
ensures that code is safe to run, and provides an abstract layer on top of theoperating system, which allows the elements of the .Net framework to run on many
operating systems and devices.
THE .NET VISION:
The basic idea behind the development of the .Net framework is that a
global broadband network will someday globally connect all devices and
the software will become a service provided over this network. The .Net
framework provides the foundation and the plumbing on which the
Microsoft .Net vision is built. The vision is about having a global
network and open standards like XML to make it easier for parties to
exchange data and work together. Now devices will use common
languages like XML over standardized or shared protocols such as
HTTP and these devices will be running a multitude of software on
7/29/2019 WCMS Report (2)
11/47
various operating systems. This is not limited to Microsoft but also to
other operating systems such as sun, IBM.
The .Net framework provides the tools and the technologies needed to
write applications that can seamlessly and easily communicate over the
Internet using open standards like XML and SOAP. It also aims at
solving the various problems that are faced by developers while working
on applications made using the windows DNA. It provides a solution to
problems such as registering of components and shutting down
applications in order to upgrade them.
7/29/2019 WCMS Report (2)
12/47
WHY FRONT END - ASP.NET 4.0
1: ASP.NET is integrated with the .NET Framework
The .NET Framework is divided into an almost painstaking
collection of functional parts, with a staggering total of more than
10,000 types (the .NET term for classes, structures, interfaces, and
other core programming ingredients). The massive collection of
functionality that the .NET Framework provides is organized in a
way that traditional Windows programmers will see as a happy
improvement. Each one of the thousands of classes in the .NET
Framework is grouped into a logical, hierarchical container called
a namespace.
Different namespaces provide different features. Taken together,
the .NET namespaces offer functionality for nearly every aspect of
distributed development from message queuing to security. This
massive toolkit is called the class library.
2: ASP.NET Is Compiled, Not Interpreted
One of the major reasons for performance degradation in classic
ASP pages is its use of interpreted script code. Every time an ASP
page is executed, a scripting host on the web server needs to
7/29/2019 WCMS Report (2)
13/47
interpret the script code and translate it to lower-level machine
code, line by line. ASP.NET applications are always compiledin
fact, its impossible to execute C# or Visual Basic code without it
being compiled first.
3: ASP.NET Is Multilanguage
IL is a stepping stone for every managed application. (A managedapplication is any application thats written for .NET and executes inside
the managed environment of the CLR.) In a sense, IL is the language of
.NET, and its the only language that the CLR recognizes.
4: ASP.NET Is Hosted by the Common Language Runtime
The most important aspect of the ASP.NET engine is that it runs
inside the runtime environment of the CLR.
5: ASP.NET Is Object-Oriented:
ASP provides a relatively feeble object model. It provides a small
set of objects; these objects are really just a thin layer over the
raw details of HTTP and HTML. On the other hand, ASP.NET is
truly object-oriented. Not only does your code have full access to
all objects in the .NET Framework, but you can also exploit all
7/29/2019 WCMS Report (2)
14/47
the conventions of an OOP (object-oriented programming)
environment. For example, you can create reusable classes,
standardize code with interfaces, extend existing classes with
inheritance, and bundle useful functionality in a distributable,
compiled component.
6: ASP.NET Is Multi device and Multi browser:
One of the greatest challenges web developers face is the wide
variety of browsers they need to support. Different browsers,
versions, and configurations differ in their support of HTML. Webdevelopers need to choose whether they should render their content
according to HTML 3.2, HTML 4.0, or something else entirely
such as XHTML 1.0 or even WML (Wireless Mark-up Language)
for mobile devices. This problem, fuelled by the various browser
companies, has plagued developers since the World Wide Web
Consortium (W3C) proposed the first version of HTML. Life gets
even more complicated if you want to use an HTML extensionsuch as JavaScript to create a more dynamic page or provide
validation.
7/29/2019 WCMS Report (2)
15/47
WHY BACK END SQL SERVER 2008
Back end a description
The back-end comprises the components that process the
output from the front-end. Back-end is hidden from the user.
A back-end database is a database that is accessed by users
indirectly through an external application rather than by
application programming stored within the database itself or by
low level manipulation of the data (e.g. through SQLcommands).
A back-end database stores data but does not include end-user
application elements such as stored queries, forms, macros or
reports.
7/29/2019 WCMS Report (2)
16/47
SQL SERVER 2008
Microsoft SQL-Server 2008 is scalable, high-performance database
management with built-in replication capabilities, Internet integration.
Open system architecture, and powerful graphic-based management
tools that are designed specifically for distributed client/server
computing. SQL-Server 2008 extends to performance and reliability by
providing server-based job scheduling to give visual control multiple
servers and remote operations.
SQL-Server 2008 was designed with Internet and intranets in minds.
When it is used with Web Assistant, it can populate web server with
SQL data through a variety of methods and provide high-performance
access to information on companys web site.
SQL-Server 2008 includes new features and components for both the
server and the client. The new features can be grouped into several
categories: SQL Enterprise Manager, Transact-SQL, and SQL-DMO
and SQL server wizards.
DATABASE DESIGN CONSIDERATIONS
Designing a database requires an understanding of both the business
functions you want to model and the database concepts and features
used to represent those business functions.
7/29/2019 WCMS Report (2)
17/47
7/29/2019 WCMS Report (2)
18/47
CLIENT/SERVER ARCHITECTURE OF SQL SERVER
Microsoft SQL Server is designed to work effectively in a
number of environments:
As a two-tier or multi-tier client/server database system
As a desktop database system
CLIENT/SERVER DATABASE SYSTEMS
Client/server systems are constructed so that the database can reside on
a central computer, known as a server, and be shared among several
users. Users access the server through a client or server application.
In a two-tier client/server system, users run an application on their local
computer, known as a client that connects over a network to the server
running SQL Server. The client application runs both business logic
and the code to display output to the user, and is also known as a thick
client. In a multi-tier client/server system, the client application logic is
run in two locations. The thin client runs on the users local computer
and is focused on displaying results to the user. The business logic is
located in server applications running on a server. Thin client requests
7/29/2019 WCMS Report (2)
19/47
functions from the server application that is a multithreaded application
capable of working with many concurrent users. The server application
opens connections to the database server and can run on the same
server as the database, or it can connect across the network to a
separate server operating as a database server.
This is a typical scenario for an Internet application. For example, a
server application can run on Microsoft Internet Information Services
(IIS) and service thousands of thin clients running on the Internet or an
intranet. The server application uses a pool of connections to
communicate with a copy of SQL Server. SQL Server can be installed
on the same computer as IIS, or it can be installed on a separate server
in the network.
7/29/2019 WCMS Report (2)
20/47
Feature and Utilities
Transparent Data Encryption
Enable encryption of an entire database, data files, or log files, without
the need for application changes. Benefits of this include: Search
encrypted data using both range and fuzzy searches, search secure data
from unauthorized users, and data encryption without any required
changes in existing applications
Extensible Key Management
SQL Server 2008 provides a comprehensive solution for encryption and
key management. SQL Server 2008 delivers an excellent solution to this
growing need by supporting third-party key management and HSM
products.
Auditing
Create and manage auditing via DDL, while simplifying compliance by
providing more comprehensive data auditing. This enables organizations
to answer common questions, such as, "What data was retrieved?"
Enhanced Database Mirroring
SQL Server 2008 builds on SQL Server 2005 by providing a more
reliable platform that has enhanced database mirroring, including
automatic page repair, improved performance, and enhanced
supportability.
7/29/2019 WCMS Report (2)
21/47
Automatic Recovery of Data Pages
SQL Server 2008 enables the principal and mirror machines to
transparently recover from 823/824 types of data page errors by
requesting a fresh copy of the suspect page from the mirroring partnertransparently to end users and applications.
Predictable Query Performance
Enable greater query performance stability and predictability by
providing functionality to lock down query plans, enabling organizations
to promote stable query plans across hardware server replacements,
server upgrades, and production deployments.
Data Compression
Enable data to be stored more effectively, and reduce the storage
requirements for your data. Data compression also provides significant
performance improvements for large I/O bound workloads, like data
warehousing.
7/29/2019 WCMS Report (2)
22/47
SOFTWARE
&
HARDWARE
REQUIREMENTS
7/29/2019 WCMS Report (2)
23/47
SOFTWARE AND HARDWARE REQUIREMENT
SPECIFICATIONS
This document shall provide the requirement specification for the
WEBCONTENT MANAGEMENT SYSTEM as per the scope
defined.
Users:
This site can be used by 2 types of users:
The users who is likely to find the information of their classmates
through the website.
1.2. The administrator of the system who will be responsible for
maintaining the database of various schools and colleges so that each
and every user should be benefitted and also maintaining guestbook
entries.
Assumptions:
The alerts will not be provided by the site, the user has to visit it to get
the information.
7/29/2019 WCMS Report (2)
24/47
Requirements:
Functional Requirements:
The portal will search for the details of the schools and colleges as per details
entered by user.
If the user is an admin, he has to login.
Admin can add, modify or delete records related to various institutions and
also updates guestbook entries.
The concept of Master Pages and Content Pages is used.
7/29/2019 WCMS Report (2)
25/47
SOFTWARE REQUIREMENTS
Visual studio 2010 can be installed on the following operating systems:
Windows Xp (x86) with service pack 3 - all editions except starter
edition
Windows Vista (x86 & x64) with service pack 2 - all editions
except starter edition
windows 7 (x86 & x64)
windows server 2003 (x86 & x64) with service pack 2
windows server 2003 r2 (x86 & x64)
windows server 2008 (x86 & x64) with service pack 2
windows server 2008 r2 (x64)
SUPPORTED ARCHITECTURES:
* 32-BIT (X86)
7/29/2019 WCMS Report (2)
26/47
* 64-BIT (X64)
HARDWARE REQUIREMENTS
computer that has a 1.6ghz or faster processor
1 GB (32 bit) or 2 GB (64 bit) ram (add 512 MB if running in a
virtual machine)
3GB of available hard disk space
5400 rpm hard disk drive
Direct X 9 capable video card running at 1024 x 768 or higher-
resolution display
DVD-ROM drive
7/29/2019 WCMS Report (2)
27/47
The various roles through which the data flows used in the project are:
1) Administrator
2) User
ENTITY RELATIONSHIP MODEL
As a database designer, one should use an Entity Relationship (ER)
diagram as a tool to build the logical database design of a system. An
ER diagram represents the following three elements:
Tables
User
Temp
Menu
7/29/2019 WCMS Report (2)
28/47
Entities: An entity is an object with a distinct set of properties that is
easily identified.
Attributes: An attribute is a property of an entity that differentiates it
from other entities and provides information about the entity.
Relationships: A relationship is a crucial part of the design of
database.
7/29/2019 WCMS Report (2)
29/47
Sr. No. Table Name Description
1. Tbusr Contain the username and
password
information for
registered users
2. Tbpag Contains a list of pages
created by the
Admin. Along
with title, met
keyword and
description
3. Tbmnu Contains a list of menus
created by the
Admin.
7/29/2019 WCMS Report (2)
30/47
TABLES USED IN THE PROJECT
RELATIONS IN THE DATABASE FOR
WEB CONTENT MANAGEMENT SYSTEM
The following are the relations we have designed to manage the
database. Here we have followed a convention of having the table
names with tb as a prefix, and the remaining name of the table
represent the description of the data inside that table.
RELATIONS IN THE DATABASE FOR WEB
CONTENT MANAGEMENT SYSTEM
7/29/2019 WCMS Report (2)
31/47
The following are the relations we have designed to manage the database. Here we
have followed a convention of having the table names with tb as a prefix, and
the remaining name of the table represent the description of the data inside that
table.
Tables
TbusrColumn Name Datatype Key Description
Usrcod int Primary key User code
Usrnam Varchar(50) Registration
User nameUsrpwd Varchar(50) Unique Email id
Usrfstnam Varchar(50) Password
Usrlstnam Varchar(50) Status U,A
usrtyp char(1)
Usrcrtdat datetime
Tbtmp
7/29/2019 WCMS Report (2)
32/47
Column Name Datatype Key Description
Mnucod Int Pk
mnunam Varchar(100)
Mnuusrcod Int
Mnuparmnucod IntMnudspord Int
Mnuusrtyp char(1)
TbpagColumn Name Datatype Key Description
Pagcod Int Pk
pagnam Varchar(50)Pagcon ntext(max)
Pagbrwtit varchar(200)
Pagmettit varchar(200)
Pagmetkey varchar(200)
Pagmetdsc varchar(200)
Pagmnucod int
Pagusrcod Int
Pagcrtdat Datetime
7/29/2019 WCMS Report (2)
33/47
CODING
7/29/2019 WCMS Report (2)
34/47
CODING
Application class code file
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Data;using System.Data.SqlClient;using System.Configuration;
namespace nswcmns{ publicinterfaceintusr
{
Int32 p_usrcod{
get; set;
}
String p_usrnam{
get; set;
} String p_usrpwd
{ get;
set;}
Char p_usrsts{
get; set;
} DateTime p_usrcrtdate
{ get; set;
} String p_usrfrstname
{
get; set;
} String p_usrlstname
{ get; set;
} String p_usrtyp
{
7/29/2019 WCMS Report (2)
35/47
get; set;
}}
publicclassclsusrprp : intusr{
privateInt32 uc; privateString un, up, ufn, uln, ut; privateDateTime ucd; privateChar us; publicint p_usrcod
{ get
{ return uc;
} set
{uc = value;
}}
publicString p_usrnam{
get{
return un;}
set{
un = value;}
}
publicString p_usrpwd
{ get
{ return up;
} set
{up = value;
}}
publicChar p_usrsts{
get
{ return us;
} set
{us = value;
}}
publicDateTime p_usrcrtdate{
7/29/2019 WCMS Report (2)
36/47
get{
return ucd;}
set{
ucd = value;}
} publicString p_usrfrstname
{ get
{ return ufn;
} set
{ufn = value;
}}
publicString p_usrlstname
{ get{
return uln;}
set{
uln = value;}
} publicString p_usrtyp
{ get
{
return ut;}
set{
ut = value;}
}}
publicabstractclassclscon{
protectedSqlConnection con = newSqlConnection(); public clscon()
{con.ConnectionString = ConfigurationManager.ConnectionStrings["cn"].ConnectionString;
}}
publicclassclsusr : clscon{
publicChar logincheck(String usrnam, String usrpwd){
if(con.State == ConnectionState.Closed){
con.Open();}
7/29/2019 WCMS Report (2)
37/47
SqlCommand cmd = newSqlCommand("logincheck", con);cmd.CommandType = CommandType.StoredProcedure;cmd.Parameters.Add("@usrnam", SqlDbType.VarChar, 50).Value = usrnam;cmd.Parameters.Add("@usrpwd", SqlDbType.VarChar, 50).Value = usrpwd;cmd.Parameters.Add("@usrtyp", SqlDbType.Char, 1).Direction =
ParameterDirection.Output;cmd.ExecuteNonQuery();
Char c = Convert.ToChar(cmd.Parameters["@usrtyp"].Value);cmd.Dispose();con.Close();
return c;}
publicvoid save_rec(clsusrprp p){
if(con.State == ConnectionState.Closed){
con.Open();}
SqlCommand cmd = newSqlCommand("insusr", con);cmd.CommandType = CommandType.StoredProcedure;
//cmd.Parameters.Add("@uc", SqlDbType.Int).Value = p.p_usrcod;
cmd.Parameters.Add("@un", SqlDbType.VarChar, 50).Value = p.p_usrnam;cmd.Parameters.Add("@up", SqlDbType.VarChar, 50).Value = p.p_usrpwd;cmd.Parameters.Add("@us", SqlDbType.Char, 10).Value = p.p_usrsts;cmd.Parameters.Add("@ucd", SqlDbType.DateTime).Value = p.p_usrcrtdate;cmd.Parameters.Add("@ufn", SqlDbType.VarChar, 50).Value = p.p_usrfrstname;cmd.Parameters.Add("@uln", SqlDbType.VarChar, 50).Value = p.p_usrlstname;cmd.Parameters.Add("@ut", SqlDbType.VarChar, 50).Value = p.p_usrtyp;cmd.ExecuteNonQuery();cmd.Dispose();con.Close();
}
publicvoid update_rec(clsusrprp p){
if(con.State == ConnectionState.Closed){
con.Open();}
SqlCommand cmd = newSqlCommand("updusr", con);cmd.CommandType = CommandType.StoredProcedure;cmd.Parameters.Add("@uc", SqlDbType.Int).Value = p.p_usrcod;cmd.Parameters.Add("@un", SqlDbType.VarChar, 50).Value = p.p_usrnam;cmd.Parameters.Add("@up", SqlDbType.VarChar, 50).Value = p.p_usrpwd;cmd.Parameters.Add("@us", SqlDbType.Char).Value = p.p_usrsts;cmd.Parameters.Add("@ucd", SqlDbType.DateTime).Value = p.p_usrcrtdate;cmd.Parameters.Add("@ufn", SqlDbType.VarChar, 50).Value = p.p_usrfrstname;cmd.Parameters.Add("@uln", SqlDbType.VarChar, 50).Value = p.p_usrlstname;
cmd.Parameters.Add("@ut", SqlDbType.VarChar, 50).Value = p.p_usrtyp;cmd.ExecuteNonQuery();cmd.Dispose();con.Close();
}
publicvoid delete_rec(clsusrprp p){
if(con.State == ConnectionState.Closed){
7/29/2019 WCMS Report (2)
38/47
con.Open();}
SqlCommand cmd = newSqlCommand("delusr", con);cmd.CommandType = CommandType.StoredProcedure;cmd.Parameters.Add("@uc", SqlDbType.Int).Value = p.p_usrcod;cmd.ExecuteNonQuery();cmd.Dispose();con.Close();
}
publicList dsp_rec(){
if(con.State == ConnectionState.Closed){
con.Open();}
SqlCommand cmd = newSqlCommand("dspusr", con);cmd.CommandType = CommandType.StoredProcedure;
SqlDataReader dr = cmd.ExecuteReader();
List Obj = newList(); while (dr.Read()){
clsusrprp k = newclsusrprp();k.p_usrcod = Convert.ToInt32(dr[0]);
//k.p_usrnam = Convert.ToInt32(dr[0]);k.p_usrnam = dr[1].ToString();k.p_usrpwd = dr[2].ToString();k.p_usrsts = Convert.ToChar(dr[3]);k.p_usrcrtdate = Convert.ToDateTime(dr[4]);k.p_usrfrstname = dr[5].ToString();k.p_usrlstname = dr[6].ToString();k.p_usrtyp = dr[7].ToString();Obj.Add(k);
}dr.Close();cmd.Dispose();con.Close();
return Obj;}
publicList find_rec(Int32 uc){
if(con.State == ConnectionState.Closed){
con.Open();}
SqlCommand cmd = newSqlCommand("fndusr", con);cmd.CommandType = CommandType.StoredProcedure;cmd.Parameters.Add("@uc", SqlDbType.Int).Value = uc;
SqlDataReader dr = cmd.ExecuteReader(); List obj = newList(); if(dr.HasRows)
{dr.Read();
clsusrprp k = newclsusrprp();k.p_usrcod = Convert.ToInt32(dr[0]);
7/29/2019 WCMS Report (2)
39/47
k.p_usrnam = dr[1].ToString();k.p_usrpwd = dr[2].ToString();k.p_usrsts = Convert.ToChar(dr[3]);k.p_usrcrtdate = Convert.ToDateTime(dr[4]);k.p_usrfrstname = dr[5].ToString();k.p_usrlstname = dr[6].ToString();k.p_usrtyp = dr[7].ToString();obj.Add(k);
}dr.Close();cmd.Dispose();con.Close();
return obj;}
} publicinterfaceintpag
{ Int32 p_pagcod
{ get;
set;} Int32 p_pagmnucod
{ get; set;
} String p_pagtitle
{ get; set;
} String p_pagcon
{
get; set;
} String p_pagmettkey
{ get; set;
} string p_pagmetdsc
{ get; set;
} DateTime p_pagcrtdat
{ get; set;
}}
publicclassclspagprp : intpag{
privateInt32 pd, pmc; privateString pt, pc, pmk, pmd;
7/29/2019 WCMS Report (2)
40/47
privateDateTime pcd; publicint p_pagcod
{ get
{ return pd;
} set
{pd = value;
}}
publicint p_pagmnucod{
get{
return pmc;}
set{
pmc = value;}}
publicstring p_pagtitle{
get{
return pt;}
set{
pt = value;
}}
publicstring p_pagcon{
get{
return pc;}
set{
pc = value;}
}
publicstring p_pagmettkey{
get{
return pmk;}
set{
pmk = value;
7/29/2019 WCMS Report (2)
41/47
}}
publicstring p_pagmetdsc{
get{
return pmd;}
set{
pmd = value;}
}
publicDateTime p_pagcrtdat{
get{
return pcd;}
set{pcd = value;
}}
}
publicclassclspag : clscon{
publicInt32 dsppagbymnu(Int32 mnucod){
SqlDataAdapter adp = newSqlDataAdapter("dsppagbymnu", con);adp.SelectCommand.CommandType = CommandType.StoredProcedure;
adp.SelectCommand.Parameters.Add("@mnucod", SqlDbType.Int).Value = mnucod; DataSet ds = newDataSet();
adp.Fill(ds); if(ds.Tables[0].Rows.Count == 0)
{ return -1;
} else returnConvert.ToInt32(ds.Tables[0].Rows[0][0]);
} publicvoid save_rec(clspagprp p)
{ if(con.State == ConnectionState.Closed)
{
con.Open();}
SqlCommand cmd = newSqlCommand("inspag", con);cmd.CommandType = CommandType.StoredProcedure;
//cmd.Parameters.Add("@pd", SqlDbType.Int).Value = p.p_pagcod;cmd.Parameters.Add("@pmc", SqlDbType.Int).Value = p.p_pagmnucod;cmd.Parameters.Add("@pt", SqlDbType.VarChar, 100).Value = p.p_pagtitle;cmd.Parameters.Add("@pc", SqlDbType.VarChar, 50).Value = p.p_pagcon;cmd.Parameters.Add("@pmk", SqlDbType.VarChar, 200).Value = p.p_pagmettkey;cmd.Parameters.Add("@pmd", SqlDbType.VarChar, 500).Value = p.p_pagmetdsc;
7/29/2019 WCMS Report (2)
42/47
cmd.Parameters.Add("@pcd", SqlDbType.DateTime).Value = p.p_pagcrtdat;cmd.ExecuteNonQuery();cmd.Dispose();con.Close();
} publicvoid update_rec(clspagprp p)
{ if(con.State == ConnectionState.Closed)
{con.Open();
} SqlCommand cmd = newSqlCommand("updpag", con);
cmd.CommandType = CommandType.StoredProcedure;cmd.Parameters.Add("@pd", SqlDbType.Int).Value = p.p_pagcod;cmd.Parameters.Add("@pmc", SqlDbType.Int).Value = p.p_pagmnucod;cmd.Parameters.Add("@pt", SqlDbType.VarChar, 100).Value = p.p_pagtitle;cmd.Parameters.Add("@pc", SqlDbType.VarChar, 50).Value = p.p_pagcon;cmd.Parameters.Add("@pmk", SqlDbType.VarChar, 200).Value = p.p_pagmettkey;cmd.Parameters.Add("@pmd", SqlDbType.VarChar, 500).Value = p.p_pagmetdsc;cmd.Parameters.Add("@pcd", SqlDbType.DateTime).Value = p.p_pagcrtdat;cmd.ExecuteNonQuery();
cmd.Dispose();con.Close();}
publicvoid delete_rec(clspagprp p){
if(con.State == ConnectionState.Closed){
con.Open();}
SqlCommand cmd = newSqlCommand("delpag", con);cmd.CommandType = CommandType.StoredProcedure;cmd.Parameters.Add("@pd", SqlDbType.Int).Value = p.p_pagcod;cmd.ExecuteNonQuery();cmd.Dispose();
con.Close();}
publicList Disp_rec(){
if(con.State == ConnectionState.Closed){
con.Open();}
SqlCommand cmd = newSqlCommand("disppag", con);cmd.CommandType = CommandType.StoredProcedure;
SqlDataReader dr = cmd.ExecuteReader(); List Obj = newList(); while (dr.Read())
{
clspagprp k = newclspagprp();k.p_pagcod = Convert.ToInt32(dr[0]);
//k.p-usrcod = Convert.ToInt32(dr[0]);k.p_pagmnucod = Convert.ToInt32(dr[1]);k.p_pagtitle = dr[2].ToString();k.p_pagcon = dr[3].ToString();k.p_pagmettkey = dr[4].ToString();k.p_pagmetdsc = dr[5].ToString();k.p_pagcrtdat = DateTime.Now;Obj.Add(k);
7/29/2019 WCMS Report (2)
43/47
}dr.Close();cmd.Dispose();con.Close();
return Obj;}
publicList fnd_rec(Int32 pd){
if(con.State == ConnectionState.Closed){
con.Open();}
SqlCommand cmd = newSqlCommand("findpag", con);cmd.CommandType = CommandType.StoredProcedure;cmd.Parameters.Add("@pd", SqlDbType.Int).Value = pd;
SqlDataReader dr = cmd.ExecuteReader(); List obj = newList(); if(dr.HasRows)
{dr.Read();
clspagprp k = newclspagprp();
k.p_pagcod = Convert.ToInt32(dr[0]);k.p_pagmnucod = Convert.ToInt32(dr[1]);k.p_pagtitle = dr[2].ToString();k.p_pagcon = dr[3].ToString();k.p_pagmettkey = dr[4].ToString();k.p_pagmetdsc = dr[5].ToString();k.p_pagcrtdat = DateTime.Now;obj.Add(k);
}dr.Close();cmd.Dispose();con.Close();
return obj;}
} publicinterfaceintmnu
{ Int32 p_mnucod
{ get; set;
} String p_mnunam
{ get; set;
} Int32 p_mnuparmnucode
{ get; set;
} Int32 p_mnudspord
{ get; set;
} String p_mnuusrtyp
7/29/2019 WCMS Report (2)
44/47
{ get; set;
}}
publicclassclsmnuprp : intmnu{
privateInt32 mc, mpmc, mdp; privateString mn, mut; publicint p_mnucod
{ get
{ return mc;
} set
{mc = value;
}}
publicstring p_mnunam{ get
{ return mn;
} set
{mn = value;
}}
publicint p_mnuparmnucode{
get{
return mpmc;}
set{
mpmc = value;}
}
publicint p_mnudspord{
get{
return mdp;}
set{
mdp = value;}
}
publicstring p_mnuusrtyp{
7/29/2019 WCMS Report (2)
45/47
get{
return mut;}
set{
mut = value;}
}}
publicclassclsmnu : clscon{
publicDataSet dspmanmnu(char usrtyp, Int32 parmnucod){
SqlDataAdapter adp = newSqlDataAdapter("dspmanmnu", con);adp.SelectCommand.CommandType = CommandType.StoredProcedure;adp.SelectCommand.Parameters.Add("@usrtyp", SqlDbType.Char, 1).Value = usrtyp;adp.SelectCommand.Parameters.Add("@parmnucod", SqlDbType.Int).Value =
parmnucod; DataSet ds = newDataSet();
adp.Fill(ds); return ds;}
publicvoid save_rec(clsmnuprp p){
if(con.State == ConnectionState.Closed){
con.Open();}
SqlCommand cmd = newSqlCommand("insmnu", con);cmd.CommandType = CommandType.StoredProcedure;
// cmd.Parameters.Add("@mc", SqlDbType.Int).Value = p.p_mnucod;cmd.Parameters.Add("@mn", SqlDbType.VarChar, 50).Value = p.p_mnunam;
// cmd.Parameters.Add("@mpc", SqlDbType.Int).Value = p.p_mnuparmnucode;
cmd.Parameters.Add("@mdp", SqlDbType.Int).Value = p.p_mnudspord;cmd.Parameters.Add("@mut", SqlDbType.VarChar, 50).Value = p.p_mnuusrtyp;cmd.Parameters.Add("@mpmc", SqlDbType.Int).Value = p.p_mnuparmnucode;cmd.ExecuteNonQuery();cmd.Dispose();con.Close();
} publicDataSet dspmnu1(Int32 parmnucode, Char usrtyp)
{ SqlDataAdapter adp = newSqlDataAdapter("dspmnu1", con);
adp.SelectCommand.CommandType = CommandType.StoredProcedure;adp.SelectCommand.Parameters.Add("@parmnucode", SqlDbType.Int).Value =
parmnucode;adp.SelectCommand.Parameters.Add("@usrtyp", SqlDbType.Char, 1).Value = usrtyp;
DataSet ds = newDataSet();adp.Fill(ds);
return ds;}
publicvoid update_rec(clsmnuprp p){
if(con.State == ConnectionState.Closed){
con.Open();
7/29/2019 WCMS Report (2)
46/47
} SqlCommand cmd = newSqlCommand("updmnu", con);
cmd.CommandType = CommandType.StoredProcedure;cmd.Parameters.Add("@mc", SqlDbType.Int).Value = p.p_mnucod;cmd.Parameters.Add("@mn", SqlDbType.VarChar, 50).Value = p.p_mnunam;cmd.Parameters.Add("@mpmc", SqlDbType.Int).Value = p.p_mnuparmnucode;cmd.Parameters.Add("@mdp", SqlDbType.Int).Value = p.p_mnudspord;cmd.Parameters.Add("@mut", SqlDbType.VarChar, 50).Value = p.p_mnuusrtyp;cmd.ExecuteNonQuery();cmd.Dispose();con.Close();
} publicvoid delete_rec(clsmnuprp p)
{ if(con.State == ConnectionState.Closed)
{con.Open();
} SqlCommand cmd = newSqlCommand("delmnu", con);
cmd.CommandType = CommandType.StoredProcedure;cmd.Parameters.Add("@mc", SqlDbType.Int).Value = p.p_mnucod;
cmd.ExecuteNonQuery();cmd.Dispose();con.Close();
} publicList Disp_rec()
{ if(con.State == ConnectionState.Closed)
{con.Open();
} SqlCommand cmd = newSqlCommand("dispmnu", con);
cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); List Obj = newList();
while (dr.Read()){
clsmnuprp k = newclsmnuprp();k.p_mnucod = Convert.ToInt32(dr[0]);
//k.p_mnucod = Convert.ToInt32(dr[0]);k.p_mnunam = dr[1].ToString();k.p_mnuparmnucode = Convert.ToInt32(dr[2]);k.p_mnudspord = Convert.ToInt32(dr[3]);k.p_mnuusrtyp = dr[4].ToString();Obj.Add(k);
}dr.Close();cmd.Dispose();con.Close();
return Obj;}
publicList find_rec(Int32 mc){
if(con.State == ConnectionState.Closed){
con.Open();}
SqlCommand cmd = newSqlCommand("findmnu", con);cmd.CommandType = CommandType.StoredProcedure;
7/29/2019 WCMS Report (2)
47/47
cmd.Parameters.Add("@mnu", SqlDbType.Int).Value = mc; SqlDataReader dr = cmd.ExecuteReader(); List obj = newList(); if(dr.HasRows)
{dr.Read();
clsmnuprp k = newclsmnuprp();k.p_mnucod = Convert.ToInt32(dr[0]);
//k.p_mnucod = Convert.ToInt32(dr[0]);k.p_mnunam = dr[1].ToString();k.p_mnuparmnucode = Convert.ToInt32(dr[2]);k.p_mnudspord = Convert.ToInt32(dr[3]);k.p_mnuusrtyp = dr[4].ToString();obj.Add(k);
}dr.Close();cmd.Dispose();con.Close();
return obj;}
}
}