E Tendering
E Tendering
E Tendering
THIRUVANANTHAPURAM.
Project on
E-TENDERING
Report submitted to the Mahatma Gandhi University in partial fulfillment of the Requirement for the award of the
E-Tendering
DECLARATION
I Rishad. A, undersigned here by declare that the project report Entitled E-TENDERING is a record of independent project work carried out by me under the supervision and guidance of Mr. Anoop. R. V. I also declare that this has not been previously submitted for the awards of any degree, diploma other similar title. Rishad. A.
Page 2
E-Tendering
ACKNOWLEDGEMENT
The satisfaction that accompanies the completion of a successful project work not be completed without mention of those who made it possible because success is the epitome of hard work, determination, concentration and most of all encouragement. Thus to express my gratitude, I heartily thank my benefactors. I would like to express my profuse gratitude to our Principal Mr. Shibu Ramanujan for providing all the necessary facilities to complete this project. I express my sincere gratitude to Mrs. Seema project internal guide, for encouraging me, and for her valuable suggestion to finish successfully. I express my gratitude to Mr. Anoop. R. V for his support and motivation during the course of the project. I also express my sincere gratitude to all my friends and benefactors who helped me throughout the course of this project. Above all I would like to thank god ambiguity for all his blessings to complete this project successfully.
RISHAD. A
Page 3
E-Tendering
ABSTRACT
Procurement, which takes up a large portion of an organisations cost and time, can yield quicker and, often easier, savings. To achieve these savings, companies must develop a systematic approach to purchasing, which involves aggressive management of product specifications and negotiations with suppliers. Existing processes and practices lack transparency and accountability and are vulnerable to some non-ethical interest of few persons. It is therefore apparent that successfully switching companys purchasing processes to an eprocurement system can substantially reduce their expenditure. Tendering is a significant part of the procurement cycle. E-Tendering is the purchasing of goods and services using the internet. It automates and integrates the buyer and supplier processes leveraging the internet. It automates the complete procurement process right from tender preparation to purchase order, invoicing and electronic payment. E-Tendering has the capability to drive transparency, deliver large cost reduction and process efficiency throughout the tendering process of any corporation. The objective of the project was to bring E -Tendering into action and invoke a fair and transparent environment for vendors.
Page 4
E-Tendering
COMPANY PROFILE
SANKALP EDUTEC SOFTWARE SOLUTIONS is a Total Solution Provider IT Company, located on Mullassery Towers, Punnen Road, Vanross Junction, and Trivandrum-695001. The company has collaborations and partners all over India for its various operations. One such operation is in Kerala. SANKALP EDUTEC SOFTWARE SOLUTIONS is into Products relating to the privacy and security of Windows, Document Management, ERP solutions to small and medium scale companies. The document management software is tailor made which include privacy, security, protection and performance solutions. SANKALP EDUTEC SOFTWARE SOLUTIONS have a strong technical team of qualified professional and a dedicated customer support team to cater to all the requirements of the customers. It has also diversified into Management and skill development programs using the latest Technological changes taking place in the Industry. The company has strong leadership with robust technology experience background in developing security and privacy solutions DMS. SANKALP EDUTEC SOFTWARE SOLUTIONS drives on the basic emphasis that simplicity, integrity and attitude in providing perfect solutions and total customer satisfaction. SANKALP EDUTEC SOFTWARE SOLUTIONS have assembled a dedicated, visionary management team and advisory board with tremendous entrepreneurial, information technology, marketing/sales, e-business, and software development experience. The Company has drawn executives and advisors from senior positions at major corporations with tremendous experience. Even since the establishment of SANKALP EDUTEC SOFTWARE SOLUTIONS it has contributed its professional expertise in web applications and automation and also provides services in software and hardware industry, hosting, domain, software development and implementation of projects for scientific and commercial applications in technologies like Asp.Net, VB.Net, C#.Net, Web services, Reporting services, Compact Device Programming, Java, J2EE, Struts, JSP, EJB. The companys vision is to provide technology
Page 5
E-Tendering
solutions and professional services, taking advantages of a global work force that can provide maximum value to our clients
CONTENTS
Sl. No I. 1. II. 1. 2. 3. 4. III. 1. 2. 3. 4. 5. IV. 1. 2. V. VI. VII. VIII. IX. Item Page No 7 7 8 8 10 10 11 13 14 15 15 21 22 27 28 29 41 89 91 107 108
Introduction About the project Requirement Analysis Feasibility Study Existing System Proposed System Function Description System design Input design Output design Database design Structured diagram Data flow diagram System Implementation Processing environment Software Descriptions System Coding System testing Screen Shots Conclusion References
Page 6
E-Tendering
INTRODUCTION
Using E-Tendering, the suppliers can i. ii. iii. iv. Receive notification of the relevant tenders Purchase tenders document Submit Bids Online Track the status of their bids
The tenders are published by the companies who are in demand of the goods. Using the E-Tendering System, the users of the participating companies will: i. ii. iii. iv. v. Raise indents as per the requirements Approve Indents online Create Tender Approve Tender and Publish Tender online
The users who registered as suppliers of this system will: i. ii. Receive tender notification Submit Tenders
The system will auto evaluate the bids of the suppliers and gude the user to select its apt supplier. The system can be developed using ASP.NET and MSSQL Server or any other web application developer
Page 7
E-Tendering
REQUIREMENT ANALYSIS
2.1. Introduction
A system is simply a set of components to accomplish an objective. System Analysis is an important activity that takes place when we attempt to build a new system or when modifying existing ones. Analysis comprises a detailed study of the various operations performed by a system and their relationships within and outside the system. It is the process of gathering and interpreting facts, diagnosing problems and improving the system using the information obtained. The objectives of Requirement Analysis include the following. Identifying the users need. Evaluating the system concept. Performing economic and technical analysis. Establishing cost and scheduled constraints.
System analysis is finding out what happens in the existing systems, deciding on what changes and new features are required and defining exactly what the proposed system must be. This process of system analysis is largely concerned with determining developing and agreeing to the users requirements. It provides prime opportunities to communicate well with the user and conceive a joint understanding of what a system should be doing, together with a view of the relative importance of the system facilities using interactive techniques.
Form a project team and appoint a project leader. Prepare a system flow chart. Enumerate potential candidate systems.
Page 8
E-Tendering
Describe and identify characteristics of candidate systems. Describe and evaluate performance and cost effectiveness of each candidate systems. Weight system performance and cost data. Select the best candidate system. Prepare and report final project directive and management.
What changes will be brought with the system? What new skills will be required? Do the existing staff members have these skills? If not, can they be trained due course of time?
Page 9
E-Tendering
Generally, project will not be rejected simply because of operational feasibility but such considerations are likely to critically affect the nature and scope of the eventual recommendations. This feasibility study is carried out by a small group of people who are familiar with information system techniques, who understand the parts of the business that are relevant to the project and are skilled in skilled analysis and design process.
More human error More strength and strain of manual labor needed. Repetition of the same procedures Low security Data redundancy Difficult to handle Difficult to update data Record keeping is very difficult
Page 10
E-Tendering
This system is developed in such a way that even a native user can also operate the system easily. The calculations are made very quickly and the records are directly saved into databases and the databases can be maintained for a longer period of time. Each record can be retrieved and can be verified for the future transactions. Also this system provides high level of security for data leaking as only admin people can access the database no changes can be made in it until it verifies the user login id and password. The benefits of e-tendering can be achieved without the need to integrate with other systems. An e-tendering system may be offered as part of a suite of e-procurement systems. In such situations there may be integration with the e-ordering functionality whereby a winning e-tender creates a purchase order in the order system. In addition, an e-tendering system may be integrated with back office financial systems where a winning bid automatically becomes a commitment on the system and creates an order entry. E-tendering solutions are usually offered as web solutions, which are either hosted on the buyers own servers (internet or intranet) or by third party service providers. E-tendering systems may also be provided as part of a suite of e-procurement solutions, bundled with e-ordering, contract management or e-auctioning systems, for example. The effort and cost involved in implementing an e-tendering solution is relatively low, especially in comparison to some complex e-ordering systems, mainly due to the low-tech nature of many systems and limited necessity for change management and training of either buyer or supplier. Many end users and suppliers regard e-tendering as a positive development eliminating many mundane tasks and speeding up the procurement cycle. The financial benefits of using e-tendering are based around process efficiencies rather than reduced purchase prices.
Page 11
E-Tendering
Page 12
E-Tendering
SYSTEM DESIGN
3.1. Introduction
System Design involves translating system requirements and conceptual design into technical specifications and general flow of processing. After the system requirements have been identified, information has been gathered to verify the problem and after evaluating the existing system, a new system is proposed. System Design is the process of planning of new system or to replace or complement an existing system. It must be thoroughly understood about the old system and determine how computers can be used to make its operations more effective. System design sits at technical the kernel of system development. Once system requirements have been analyzed and specified system design is the first of the technical activities-design, code generation, and test- that required building and verifying the software. System design is the most creative and challenging phases of the system life cycle. The term design describes the final system and the process by which it is to be developed. System design is the high level strategy for solving the problem and building a solution. System design includes decisions about the organization of the system into subsystems, the allocation of subsystems to hardware and software components and major conceptual and policy decision that forms the framework for detailed design. There are two levels of system design: Logical design. Physical design. In the logical design, the designer produces a specification of the major features of the system which meets the objectives. The delivered product of logical design includes current requirements of the following system components: Input design. Output design. Database design. Physical design takes this logical design blue print and produces the program software, files and a working system. Design specifications instruct programmers about what the system should do. The programmers in turn write the programs that accept input from users, process data, produce reports, and store data in files. Structured design is a data flow based methodology that partitions a program into a hierarchy of modules organized top-down manner with details at the bottom. Data flow diagrams are the central tool and the basis from which other components are
Page 13
E-Tendering
developed. The transformation of data from input to output, through processes may be described logically and independently of the physical components.
What data to input? What medium to use? How the data should be arranged or coded? The dialogue to guide users in providing input. Data items and transactions needing validation to detect errors. Methods for performing input validation and steps to follow when errors occur.
Inaccurate input data is the most common cause of error in processing data. Errors entered by the data entry operators can be controlled by the input design. The arrangement of messages as well as placement of data, headings and titles on display screens or source document is also a part of input design. The design of input also includes specifying the means by which end user and system operators direct the system what action to take. The input design is the link between the information system and the user. It comprises the developing specification and procedures for data preparation and those steps that are necessary to put transaction data into a usable form for processing data entry. In this project all the necessary text boxes are validated. The input forms are designed in Microsoft Visual Studio 2005 using GUI Controls like textboxes, listbox, checkbox, frames, radio button and other controls. If any non-empty fields are not filled, it will display error message and will wait until user types the necessary and correct input. The combo boxes are used to reduce the user inputs. The user can select one of the items from combo boxes. Initially to access the services of this software, the user has to log on with a login name and password which are validated. Once logged on, he can access the various services, navigate to different profiles. Once the data are entered through the input forms, they are stored in the database. In this application the user can select the options using mouse. The user is also allowed to choose priority using predefined set of values.
Page 14
E-Tendering
Determine what information to present. Decide whether to display, print the information and select the output medium. Arrange the presentation of information in an acceptable format. Decide how to distribute the output to intended recipients.
The output design is specified on layout forms, sheets that describe the location characteristics, and format of the column headings and pagination. In my project, the output forms are designed in ASP.Net. Each form has a heading or caption which specifies what services is been given to the users making the software user-friendly. All requests given by the user is sent to the server which is validated and accordingly the corresponding pages are given to the client users. All information is stored in the database and when the user logs on and requests for a service, the corresponding page is fetched from the server after validation and is rendered.
Page 15
E-Tendering
Page 16
E-Tendering
Table Design
ApprovedTender Field Name TenderID UIDofSupplier ApprovedDate Data Type Numeric Numeric Datetime Size 9 9 8 Description Stores Tender ID Supplier ID Store Date
AppliedTender Field Name Amount Remarks UIDofSupplier TenderID AppliedTenderID Data Type Numeric Text Numeric Numeric Numeric Size 9 16 9 9 9 Description Amount quoted Remarks from supplier Supplier ID Stores Tender ID Applied Tender ID
SubmittedTender Field Name TenderTitle CatID AddLine1 AddLine2 AddLine3 Town SID DID StartDate DeadLine TenderInformation Data Type Varchar Numeric Varchar Varchar Varchar Varchar Numeric Numeric Datetime Datetime Ntext Size 256 9 256 256 256 256 9 9 8 8 16 16 16 256 9 8 9 Description Title of tender Category ID Address line 1 Address line 2 Address line 3 Town State ID District ID Start date of work Deadline of tender Tender information Supporting documentation Information required for tender File uploaded User ID Date of tender issue Tender ID (System Generated)
SupportingDocumentation Ntext IncludedInformation UploadedFile UID IssuedDate TenderID Ntext Varchar Numeric Datetime Numeric
Page 17
E-Tendering
SuppCategory Field Name CatID UID Data Type Numeric Numeric Size 9 9 Description Category ID User ID
SuppTypeofProjects Field Name TID UID Data Type Numeric Numeric Size 9 9 ProjectType Field Name TypesofProject TID Data Type Varchar Numeric Size 50 9 SupplierRegInfo Field Name Name PID Phone URL UID Data Type Varchar Int Varchar Varchar Numeric Size 50 4 50 50 9 Description Name of Company Professional Association ID Company phone URL of company website User ID Description Type of Project Tender type ID (System Generated) Description Type of tender User ID
ProfessionalAssociation Field Name ProfAssociation PID Data Type Varchar Int Size 100 4 Description Professional Association Professional association ID (System Generated)
Page 18
E-Tendering
UserRegInfo Field Name UserName Password First Name LastName Email AddressL1 AddressL2 AddressL3 Town SID DID Phone Reason UID Data Type Varchar Varchar Varchar Varchar Varchar Varchar Varchar Varchar Varchar Int Int Varchar Varchar Numeric Size 50 50 50 50 50 50 50 50 50 4 4 50 50 9 Description User Name Password First Name Last Name E-Mail Address line 1 Address line 2 Address line 3 Town State ID District ID Phone Reason for registration User ID (System generated)
TenderSubCategory Field Name SubCategory SubCatID CatID Data Type Nvarchar Int Int Size 100 4 4 Book_ID Field Name Start Current Long Long Data Type 4 4 TenderCategory Field Name CategoryName CatID Data Type Nvarchar Numeric Size 50 4 States Field Name State SID Data Type Nvarchar Int Size 50 4 Description State Name State ID (System generated) Description Category Name Category ID Size Description Start of system generated ID Current system generated ID Description Sub category of tender Sub category ID Category ID
Page 19
E-Tendering
Districts Field Name District DID SID Data Type Nvarchar Int Int Size 50 4 4 Description District Name District ID (System generated) State ID
Page 20
E-Tendering
Hom e
E-Tenders
Awards
Account s
Search
Site Map
FAQ
About
View Tenders
Post Tenders
Tender Requests
Awarded Tenders
Expired Tenders
Login
Forget Password
New User
Page 21
E-Tendering
3.6.1 Process
Process shows the work of the system. Each process has one or more data inputs and produce one or more data outputs. Processes are represented by round rectangles in Data Flow Diagram. Each process has a unique name and number. This name and number appears inside the rectangle that represents the process in a Data Flow Diagram. Process name should be unambiguous and should convey as much meaning as possible without being too long.
Page 22
E-Tendering
Entities
External entities represent the sources of data that enter the system or the recipients of data that leave the system.
Process
Processes represent activities in which data is manipulated by being stored or retrieved or transformed in some way. A circle represents it. The process will show the data transformation or change.
Database
Data flow
A data flow shows the flow of information from its source to its destination. A line represents a data flow, with arrowheads showing the direction of flow.
Page 23
E-Tendering
3.6.6 DFD
3.6.6.1 Context Diagram (Level 0)
User
E-Tendering
Supplier
Accounts
Users
UserRegInfo
Login
Page 24
E-Tendering
Users
Login
Request a tender
Post Tenders
AppliedTender SubmittedTender
Approve Tenders
ApprovedTender
Page 25
E-Tendering
Users
Login
Post Tenders
Tender Titles
SubmittedTender TenderCategory
Approve Tenders Specification Detail Specification Districts View Awarded Tenders States ApprovedTender
Page 26
E-Tendering
SYSTEM IMPLEMENTATION
System Implementation is the stage of project when the theoretical design is turned into a working system. If the implementation stage is not carefully planned and controlled, it can cause chaos. The implementation stage is a system project in its own. Implementation is the stage of the project where the theoretical design turns into a working system. Thus, it can be considered to be the most crucial stage in achieving a successful new system and giving the users the confidence that the new system will work efficiently and accurately. It is less creative than system design. It is primarily concerned with user training and site preparation. Depending on the nature of the system, extensive user training may be required. Implementation simply means converting a new system design into operation. An important aspect of the system analyst job is to make sure that the new design is implemented to establish standards. Implementation means the process of converting a new raised system design into an operational one. The three type of implementation are: Implementation of a new computer system to replace an existing one. Implementation of a modified application to replace an existing one. Implementation of a computer system to replace a manual system. The implemented system has the following features: Reduced data redundancy Easy to use Controlled flow. The tasks involved in the normal implementation process are:
Page 27
E-Tendering
CPU Clock Speed:800 MHz or higher Hard Disk Disk Drives Monitor Keyboard Mouse : 5 GB Free Spaces : CD/DVD Drive : Color monitor with minimum 1024x768x24 resolution. : Microsoft standard keyboard : PS/2 Mouse
Page 28
E-Tendering
Page 29
E-Tendering
called the Common Language Infrastructure (CLI), a specification; Microsoft's implementation of the CLI is known as the Common Language Runtime (CLR). 4.3.1.3 Language Independence The .NET Framework introduces a Common Type System, or CTS. The CTS specification defines all possible datatypes and programming constructs supported by the CLR and how they may or may not interact with each other. Because of this feature, the .NET Framework supports development in multiple programming languages. 4.3.1.4 Base Class Library The Base Class Library (BCL), sometimes referred to as the Framework Class Library (FCL), is a library of types available to all languages using the .NET Framework. The BCL provides classes which encapsulate a number of common functions, including file reading and writing, graphic rendering, database interaction and XML document manipulation. 4.3.1.5 Simplified Deployment Installation of computer software must be carefully managed to ensure that it does not interfere with previously installed software, and that it conforms to increasingly stringent security requirements. The .NET framework includes design features and tools that help address these requirements. 4.3.1.6 Security .NET allows for code to be run with different trust levels without the use of a separate sandbox. The Microsoft .Net Architecture comprises of: 4.3.1.7 Common Language Infrastructure (CLI) The most important component of the .NET Framework lies within the Common Language Infrastructure, or CLI. The purpose of the CLI is to provide a languageagnostic platform for application development and execution, including, but not limited to, components for exception handling, garbage collection, security, and interoperability. Microsoft's implementation of the CLI is called the Common Language Runtime, or CLR. The CLR is composed of four primary parts: 1. Common Type System (CTS). 2. Common Language Specification (CLS). 3. Just-In-Time Compiler (JIT).
Page 30
E-Tendering
4.3.1.8 Assemblies The intermediate CIL code is housed in .NET assemblies, which for the Windows implementation means a Portable Executable (PE) file (EXE or DLL). Assemblies are the .NET unit of deployment, versioning and security. The assembly consists of one or more files, but one of these must contain the manifest, which has the metadata for the assembly. The complete name of an assembly contains its simple text name, version number, culture and public key token; it must contain the name, but the others are optional. The public key token is generated when the assembly is created, and is a value that uniquely represents the name and contents of all the assembly files, and a private key known only to the creator of the assembly. Two assemblies with the same public key token are guaranteed to be identical. If an assembly is tampered with (for example, by hackers), the public key can be used to detect the tampering. 4.3.1.9 Metadata All CIL is self-describing through .NET metadata. The CLR checks on metadata to ensure that the correct method is called. Metadata is usually generated by language compilers but developers can create their own metadata through custom attributes. Metadata also contain all the information about assembly. 4.3.1.10 Base Class Library (BCL) The Base Class Library (BCL), sometimes incorrectly referred to as the Framework Class Library (FCL) (which is a superset including the Microsoft.* namespaces), is a library of classes available to all languages using the .NET Framework. The BCL provides classes which encapsulate a number of common functions such as file reading and writing, graphic rendering, database interaction, XML document manipulation, and so forth. The BCL is much larger than other libraries, but has much more functionality in one package. 4.3.1.11 Security: .NET has its own security mechanism, with two general features: Code Access Security (CAS), and validation and verification. Code Access Security is based on evidence that is associated with a specific assembly. Code Access Security uses evidence to determine the permissions granted to the code. Other code can demand that calling code is granted a specified permission. The demand causes the CLR to perform a call stack walk. Every assembly of each method in the call stack is checked for the required permission and if any assembly is not granted the permission then a security exception is thrown.When an assembly is loaded the CLR performs various
Page 31
E-Tendering
tests. Two such tests are validation and verification. During validation the CLR checks that the assembly contains valid metadata and CIL, and it checks that the internal tables are correct. The verification mechanism checks to see if the code does anything that is 'unsafe'. The algorithm used is quite conservative and hence sometimes code that is 'safe' is not verified. Unsafe code will only be executed if the assembly has the 'skip verification' permission.
.Net Applications Visual Basic .Net Visual C#.Net Visual J#.Net Other .Net Languages
.Net Framework
.Net Framework Class Library, Windows Form Classes Common Language Runtime Managed Applications CTS Intermediate
.Net Framework
Page 32
E-Tendering
ASP.NET. Express editions of Visual Studio have been released by Microsoft for lightweight streamlined development and novice developers. The Express editions include: Visual Basic (.NET) 2005 Express Edition. Visual C# 2005 Express Edition. Visual C++ 2005 Express Edition. Visual J# 2005 Express Edition. Visual Web Developer 2005 Express Edition.
Visual Studio 2005, codenamed Whidbey, was released online in October 2005 and hit the stores a couple of weeks later. Microsoft removed the ".NET" moniker from Visual Studio 2005 (as well as every other product with .NET in its name), but it still primarily targets the .NET Framework, which was upgraded to version 2.0. Visual Studio 2005's internal version number is 8.0 while the file format version is 9.0. Visual Studio 2005 was upgraded to support all the new features introduced in .NET Framework 2.0, including generics and ASP.NET 2.0. The IntelliSense feature in Visual Studio was upgraded for generics and new project types were added to support ASP.NET web services. Visual Studio 2005 also includes a local web server, separate from IIS, which can be used to host ASP.NET applications during development and testing. It also supports all SQL Server 2005 databases. Database designers were upgraded to support the ADO.NET 2.0, which is included with .NET Framework 2.0. C++ also got a similar upgrade with the addition of C++/CLI which is slated to replace the use of Managed C++. Other new features of Visual Studio 2005 include the Deployment Designer", which allows application designs to be validated before
Page 33
E-Tendering
deployments, an improved environment for web publishing when combined with ASP.NET 2.0 and load testing to see application performance under various sorts of user loads. Visual Studio 2005 also added extensive 64-bit support. While the development environment itself is only available as a 32 bit application, Visual C++ 2005 supports compiling for x86-64 (AMD64 and Intel 64) as well as IA-64 (Itanium).The Platform SDK included 64-bit compilers and 64-bit versions of the libraries. Visual Studio 2005 is available in several editions, which are significantly different from previous versions: Express, Standard, Professional, Tools for Office, and a set of five Visual Studio Team System Editions. The latter are provided in conjunction with MSDN Premium subscriptions, covering four major roles of software development: Architects, Software Developers, Testers, and Database Professionals. The combined functionality of the four Team System Editions is provided in a Team Suite Edition. Express Editions were introduced for amateurs, hobbyists, and small businesses, and are available as a free download from Microsoft's web site. 4.3.2.1 MICROSOFT VISUAL C#.NET By design, C# is the programming language that most directly reflects the underlying Common Language Infrastructure (CLI). Most of C#'s intrinsic types correspond to value-types implemented by the CLI framework. C# was created as an object-oriented programming (OOP) language. Other programming languages include object-oriented features, but very few are fully object-oriented. C# differs from C and C++ in many ways, including: There are no global variables or functions. All methods and members must be declared within classes. Local variables cannot shadow variables of the enclosing block, unlike C and C++. Variable shadowing is often considered confusing by C++ texts. C# supports a strict boolean type, bool. Statements that take conditions, such as while and if, require an expression of a boolean type. While C and C++ also have a boolean type, it can be freely converted to and from integers, and expressions such as if (a) require only that a is convertible to bool, allowing a to be an int, or a pointer. C# disallows this 'integer meaning true or false' approach on the grounds that forcing programmers to use expressions that return exactly bool prevents certain types of programming mistakes. In C#, pointers can only be used within blocks specifically marked as unsafe, and programs with unsafe code need appropriate permissions to run. Most object access is done through safe references, which cannot be made invalid. An unsafe pointer can point to an instance of a value-type, array, string, or a
Page 34
E-Tendering
block of memory allocated on a stack. Code that is not marked as unsafe can still store and manipulate pointers through the System.IntPtr type, but cannot dereference them. Managed memory cannot be explicitly freed, but is automatically garbage collected. Garbage collection addresses memory leaks. C# also provides direct support for deterministic finalization with the using statement. Multiple inheritances are not supported, although a class can implement any number of interfaces. C# is more typesafe than C++. The only implicit conversions by default are safe conversions, such as widening of integers and conversion from a derived type to a base type. This is enforced at compile-time, during JIT, and, in some cases, at runtime. There are no implicit conversions between booleans and integers and between enumeration members and integers (except 0, which can be implicitly converted to an enumerated type), and any user-defined conversion must be explicitly marked as explicit or implicit, unlike C++ copy constructors and conversion operators Enumeration members are placed in their own namespace. Accessors called properties can be used to modify an object with syntax that resembles C++ member field access. In C++, declaring a member public enables both reading and writing to that member, and accessor methods must be used if more fine-grained control is needed. In C#, properties allow control over member access and data validation. Full type reflection and discovery is available.
Features of C#: C# is simple. C# is modern. C# is object-oriented. C# is powerful and flexible. C# is a language of few words. C# is modular. 4.3.2.2 Microsoft asp.net ASP.NET is a web application framework marketed by Microsoft that programmers can use to build dynamic web sites, web applications and XML web services. It is part of Microsoft's .NET platform and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime, meaning programmers can write ASP.NET code using any Microsoft .NET language.
Page 35
E-Tendering
ASPX file format ASPX is a text file format used to create Webform pages. The ASPX file typically contains static HTML or XHTML markup, as well as markup defining Web Controls and Web User Controls where the developers place all the required static and dynamic content for the web page. Additionally, dynamic code which runs on the server can be placed in a page within a block <% --dynamic code -- %> which is similar to other web development technologies such as PHP, JSP, and ASP, but this practice is generally frowned upon by Microsoft except for the purposes of data binding. The method recommended by Microsoft for dealing with dynamic program code is to use the code-behind model, which places this code in a separate file or in a specially designated script tag.When using this style of programming, the developer writes code to respond to different events, like the page being loaded, or a control being clicked, rather than a procedural walk through the document. ASP.NET uses a visited composites rendering technique. During compilation the template (.aspx) file is compiled into initialization code which will build a control tree (the composite) representing the original (static) template. Literal text goes into instances of the Literal control class, server controls are represented by instances of a specific control class. The initialization code is combined with user-written code and results in a class specific for the page. The page doubles as the root of the control tree. Actual requests for the page are processed through a number of steps. First, during the initialization steps, an instance of the page class is created and the initialization code is executed. This produces the initial control tree which is now typically manipulated by the methods of the page in the following steps. As each node in the tree is a control represented as an instance of a class, the code may change the tree structure as well as manipulate the properties/methods of the individual nodes. Finally, during the rendering step a visitor is used to visit every node in the tree, asking each node to render itself using the methods of the visitor. After the request has been processed, the instance of the page class is discarded and with it the entire control tree. Other file extensions associated with different versions of ASP.NET include: asax: Global.asax, used for application-level logic and event handling ascx: Web UserControls: custom controls to be placed onto web pages. ashx: custom HTTP handlers asmx: web service pages. axd: when enabled in web.config requesting trace.axd outputs application-level tracing. Also used for the special webresource axd handler which allows control/component developers to package a component/control complete with images, script, css etc. for deployment in a single file (an 'assembly').
Page 36
E-Tendering
browser: browser capabilities files stored in XML format; introduced in version 3.0. ASP.NET 2 includes many of these by default, to support common web browsers. These specify which browsers have which capabilities, so that ASP.NET 2 can automatically customize and optimize its output accordingly. config: web.config is the only file in a specific Web application to use this extension by default , however ASP.NET provides facilities to create and consume other config files. These are stored in XML format, so as to allow configuration changes to be made with simplicity. cs/vb: In ASP.NET 2 any cs/vb files placed inside the App_Code folder are dynamically compiled and available to the whole application. master: Master Pages introduced in version 2.0 sitemap: sitemap configuration files skin: theme skin files. resx: resource files for internationalization and localization. Resource files can be global or local which means specific for a single aspx or ascx file. In general the ASP.NET developer is free to create his/her own directory structure. Apart from a few reserved directory names the site can span any number of directories. The structure is typically reflected directly in the urls. Although ASP.NET provides means for intercepting the request at any point during processing, the developer is not forced to funnel requests through a central application or front controller. The special directory names are: App_Browsers: holds site-specific browser definition files. App_Code: This is the "raw code" directory. The ASP.NET server will automatically compile files (and subdirectories) in this folder into an assembly which is accessible in the code of every page of the site. App_Code will typically be used for data access abstraction code, model code and business code. As an alternative to using App_Code the developer may opt to provide a separate assembly with precompiled code. App_Data: default directory for databases, such as Access mdb files and SQL Server mdf files. App_LocalResources: Contains localized resource files for individual pages of the site. App_GlobalResources: Holds resx files with localized resources available to every page of the site. App_Themes: holds alternative themes of the site. App_WebReferences: holds discovery files and WSDL files for references to web services to be consumed in the site.
Page 37
E-Tendering
ASP.NET aims for performance benefits over other script-based technologies by compiling the server-side code to one or more DLL files on the web server. This compilation happens automatically the first time a page is requested. This feature provides the ease of development offered by scripting languages with the performance benefits of a compiled binary. However, the compilation might cause a noticeable delay to the web user when the newly-edited page is first requested from the web server. The ASPX and other resource files are placed in a virtual host on an Internet Information Services. The first time a client requests a page, the .NET framework parses and compiles the files into a .NET assembly and sends the response; subsequent requests are served from the dll files. Developers can also choose to precompile their code before deployment, eliminating the need for just-in-time compilation in a production environment.
Page 38
E-Tendering
Security: Ensure you applications are secure in any networked environment, with role-based security and file and network encryption. Distributed Partitioned Views: Partition your workload among multiple servers for additional scalability. Data Transformation Services: Automate routines that extract, transform, and load data from heterogeneous sources. Simplified Database Administration: Automatic tuning and maintenance features enable administrators to focus on other critical tasks. Improved Developer Productivity: User-defined functions, cascading referential integrity and the integrated Transact-SQL debugger allow us to reuse code to simplify the development process. Application Hosting: With multi-instance support, SQL Server enables us to take full advantage of your hardware investments so that multiple applications can be run on a single server. SQL is the set of statements that all programs and user must use to access data within database. Application programs in turn must use SQL when executing the users request. The benefits of SQL are: SQL is a non-procedural language. It provides automatic navigation to the data. It provides statements for a variety of tasks. SQL is a query and is not without any structure. It is more than English or any other language. It has rules for grammar and syntax but they are basically the normal rules and can be readily understood. The SQL stands for Structured Query Language. The SQL statements can be classified as:
1. Queries: It always begins with the keyword SELECT and is used to retrieve the
data from the database in any combination or in any order. 2. Data Manipulation Language (DML): The purpose of DML is to change the data in database. Basically a data in the database can be changed or manipulated in 3 ways. They are: i. INSERT: inserting new rows in the database. ii. UPDATE: updating an existing row in the database. iii. DELETE: Deleting existing rows from the database.
3. Data Definition Language (DDL): The main purpose of DDL is to create,
modify and drop the database objects namely relation, index, view, trigger etc. 4. Data Control Language (DCL): This is used to provide privacy and security to the database. The DCL statements allow the user to give and take privileges, which are needed for guaranteed controlled data sharing.
Page 39
E-Tendering
Page 40
E-Tendering
SYSTEM CODING
5.1 Approvetender.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public partial class Approvetender : System.Web.UI.Page { SqlDataReader DR; SQLConnectionETender Con = new SQLConnectionETender(); protected void Page_Load(object sender, EventArgs e) { string Login_Status = (string)Session["Login_Status"]; if (Login_Status == "true") { if (!IsPostBack) Load_TenderTitles(); } else { Session["Redirect_URI"] = "Approvetender.aspx"; Response.Redirect("Login.aspx"); } } protected bool Load_TenderTitles() { bool status = false; DropDownListTenderTitles.Items.Add(" ");
Page 41
E-Tendering
DR = Con.OpenSqlCommand(string.Format("Select TenderTitle from SubmittedTender Where SubmittedTender.UID={0} AND DeadLine<='{1}'", (string)Session["Login_UID"], DateTime.Now.ToString())); while (DR.Read()) { DropDownListTenderTitles.Items.Add(DR["TenderTitle"].ToString()); status = true; } DR.Close(); return status; } protected void DropDownListTenderTitles_SelectedIndexChanged(object sender, EventArgs e) { DropDownListRequestList.Items.Clear(); DropDownListRequestList.Items.Add(" "); Load_SelectedTenderRequests(DropDownListTenderTitles.Text); DropDownListRequestList.Enabled = true; } protected bool Load_SelectedTenderRequests(string __Title) { bool status = false; DR = Con.OpenSqlCommand(string.Format("Select UserName from UserRegInfo Where UID IN (Select UIDofSupplier from AppliedTender Where TenderID IN(Select TenderID from SubmittedTender Where TenderTitle='{0}' AND UID={1}))", __Title, (string)Session["Login_UID"])); while (DR.Read()) { DropDownListRequestList.Items.Add(DR["UserName"].ToString()); status = true; } DR.Close(); return status; } protected void DropDownListRequestList_SelectedIndexChanged(object sender, EventArgs e)
Page 42
E-Tendering
{ Load_SupplierInformation(DropDownListRequestList.Text); } protected bool Load_SupplierInformation(string __username) { bool status = false; DR = Con.OpenSqlCommand(string.Format("Select *, State, District, Amount, Remarks, AppliedDate, DeadLine from UserRegInfo, States, Districts, AppliedTender, SubmittedTender Where UserName='{0}' AND States.SID IN (Select UserRegInfo.SID from UserRegInfo Where UserName='{0}') AND Districts.DID IN (Select UserRegInfo.DID from UserRegInfo Where UserName='{0}') AND UIDofSupplier IN (Select UserRegInfo.UID from UserRegInfo Where UserName='{0}') AND SubmittedTender.UID IN (Select UserRegInfo.UID from UserRegInfo Where UserName='{0}')", __username)); if (DR.Read()) { LabelName.Text = DR["FirstName"].ToString() + " " + DR["LastName"].ToString(); LabelEmail.Text = DR["EMail"].ToString(); LabelAdd1.Text = DR["AddressL1"].ToString(); LabelAdd2.Text = DR["AddressL2"].ToString(); LabelAdd3.Text = DR["AddressL3"].ToString(); LabelTown.Text = DR["Town"].ToString(); LabelState.Text = DR["State"].ToString(); LabelDistrict.Text = DR["District"].ToString(); LabelPhone.Text = DR["Phone"].ToString(); LabelAmount.Text = DR["Amount"].ToString(); LabelSubmittedDate.Text = DR["AppliedDate"].ToString(); TextBoxRemarks.Text = DR["Remarks"].ToString(); if (DateTime.Parse(DR["DeadLine"].ToString()) <= DateTime.Now) ImageButtonApply.Enabled = true; status = true; } DR.Close(); return status; } protected void ImageButtonApply_Click(object sender, ImageClickEventArgs e)
Page 43
E-Tendering
{ bool status = false; status = Con.WriteSQLQuerry(string.Format("Insert Into ApprovedTender (TenderID, UIDofSupplier, ApprovedDate) Select TenderID, UserRegInfo.UID, getdate() from SubmittedTender, UserRegInfo Where TenderID IN(Select TenderID from SubmittedTender Where TenderTitle='{0}' AND SubmittedTender.UID={1}) AND UserRegInfo.UID IN(Select UID from UserRegInfo Where UserName='{2}')", DropDownListTenderTitles.SelectedItem, (string)Session["Login_UID"], DropDownListRequestList.SelectedItem)); if (status == true) { Session["MessageStatus"] = "true"; Session["MessageType"] = "success"; Session["MessageTitle"] = "Congratulations"; Session["MessageMainHead"] = string.Format("Tender is approved"); Session["MessageMainBody"] = string.Format("You are approved the tender titled {0}", DropDownListTenderTitles.SelectedItem); Response.Redirect("Message.aspx"); } } }
5.2 Default.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e)
Page 44
E-Tendering
{ Response.Redirect("Home.aspx"); } }
5.3 ExpiredTenders.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class ExpiredTenders : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Session["ExpiredTender"] = "true"; Response.Redirect("TenderTitles.aspx"); } }
Page 45
E-Tendering
5.4 Login.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public partial class Login : System.Web.UI.Page { SqlDataReader DR; SQLConnectionETender Con = new SQLConnectionETender(); protected void Page_Load(object sender, EventArgs e) { string Login_Status = (string)Session["Login_Status"]; if (Login_Status == "true") Response.Redirect("Home.aspx"); } protected void ImageButtonLogin_Click(object sender, ImageClickEventArgs e) { DR = Con.OpenSqlCommand("Select UID, FirstName, LastName from UserRegInfo Where UserName='" + TextBoxUName.Text + "' AND Password='" + TextBoxPassword.Text + "'"); bool Login_Status = false; while (DR.Read()) { Login_Status = true; Session["Login_Status"] = "true"; Session["Login_UID"] = DR[0].ToString(); Session["Login_UName"] = TextBoxUName.Text; Session["FirstName"] = DR[1].ToString(); Session["LastName"] = DR[2].ToString(); }
Page 46
E-Tendering
DR.Close(); if (Login_Status == true) { string URI=(string)Session["Redirect_URI"]; if (URI == "" || URI == null) Response.Redirect("Home.aspx"); else { Session["Redirect_URI"] = ""; Response.Redirect((URI)); } } else Response.Write("<script>alert('Invalid login credentials')</script>"); } }
5.5 MasterPage_Main.master.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public partial class MasterPage_Main : System.Web.UI.MasterPage { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) if ((string)Session["Login_Status"] == "true") {
Page 47
E-Tendering
LabelWelcomeUser.Text = "Welcome " + (string)Session["FirstName"] + " " + (string)Session["LastName"]; ButtonLogin.Text = "Logout"; } else LabelWelcomeUser.Text = "Welcome guest"; } protected void ButtonLogin_Click1(object sender, EventArgs e) { if (ButtonLogin.Text == "Logout") { Session["Login_Status"] = "false"; Session["Redirect_URI"] = "Home.aspx"; Server.Transfer("Login.aspx"); } else Server.Transfer("Login.aspx"); } protected void htmlButtonSearch_ServerClick(object sender, ImageClickEventArgs e) { string ThisPage = string.Format("http://{0}{1}", Request.ServerVariables["SERVER_NAME"], Request.ServerVariables["URL"]); Response.Redirect(string.Format("http://www.google.com/search?q={0}+site%3A {1}", search.Value, ThisPage)); } }
Page 48
E-Tendering
5.6 Message.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Message : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Title = (string)Session["MessageTitle"]; if (!IsPostBack) { try { if (Session["MessageStatus"].ToString() != "true") Response.Redirect("Home.aspx"); else { Session["MessageStatus"] = "false"; if ((string)Session["MessageType"] == "error") { LabelMainHead.ForeColor = System.Drawing.Color.Red; LabelMessageBody.ForeColor = System.Drawing.Color.Red; ImageSign.ImageUrl = "./Images/Icons/Sign-Erroricon.png"; } else if ((string)Session["MessageType"] == "warning") { LabelMainHead.ForeColor = System.Drawing.Color.Goldenrod; LabelMessageBody.ForeColor = System.Drawing.Color.Goldenrod;
Page 49
E-Tendering
ImageSign.ImageUrl = "./Images/Icons/warning_icon.png"; } else { //No code needed here. } LabelMessageTitle.Text = (string)Session["MessageTitle"]; LabelMainHead.Text = (string)Session["MessageMainHead"]; LabelMessageBody.Text = (string)Session["MessageMainBody"]; } } catch (Exception E) { Response.Redirect("Home.aspx"); } } } }
5.6 PostTenderStep1.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public partial class PostTenderStep1 : System.Web.UI.Page { SqlDataReader DR; SQLConnectionETender Con = new SQLConnectionETender();
Page 50
E-Tendering
protected void Page_Load(object sender, EventArgs e) { string Login_Status = (string)Session["Login_Status"]; if (Login_Status != "true") { Session["Redirect_URI"] = "PostTenderStep1.aspx"; Response.Redirect("Login.aspx"); } else NewSQLCommand(); } protected void ImageButtonNext1_Click(object sender, ImageClickEventArgs e) { if (TextBoxTenderTitle1.Text == "") Response.Write("<script>alert('Please specify the tender title')</script>"); else { if (CheckTitleDuplication()) Response.Write("<script>alert('This tender title is already registered with your account')</script>"); else { DR = Con.OpenSqlCommand(string.Format("Select CatID from TenderCategory Where CategoryName='{0}'", DropDownListCategory.SelectedItem)); while (DR.Read()) { Session["CatID"] = DR[0].ToString(); } DR.Close(); Session["TenderTitle"] = TextBoxTenderTitle1.Text; Response.Redirect("PostTenderStep2.aspx"); } } } public bool CheckTitleDuplication() {
Page 51
E-Tendering
DR = Con.OpenSqlCommand(string.Format("Select TenderTitle from SubmittedTender Where UID={0} AND TenderTitle='{1}'", (string)Session["Login_UID"], TextBoxTenderTitle1.Text)); if (DR.Read()) return true; return false; } public void NewSQLCommand() { DR = Con.OpenSqlCommand("Select CategoryName from TenderCategory"); while (DR.Read()) { DropDownListCategory.Items.Add(DR[0].ToString()); } DR.Close(); } }
5.7 PostTenderStep2.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public partial class PostTenderStep2 : System.Web.UI.Page { SqlDataReader DR; SQLConnectionETender Con = new SQLConnectionETender(); protected void Page_Load(object sender, EventArgs e) {
Page 52
E-Tendering
string Login_Status = (string)Session["Login_Status"]; if (Login_Status != "true") { Session["Redirect_URI"] = "PostTenderStep1.aspx"; Response.Redirect("Login.aspx"); } else { ImageButtonBack2.Attributes.Add("onClick", "javascript:history.back(); return false;"); if (!IsPostBack) { LoadStates(); LoadTypes_of_Development(); } } } protected void ImageButtonNext2_Click(object sender, ImageClickEventArgs e) { bool status = true; if (TextBoxAdd1.Text == "") status = false; if (status == true) { DataBaseFunctions DBF = new DataBaseFunctions(); Session["AddLine1"] = TextBoxAdd1.Text; Session["AddLine2"] = TextBoxAdd2.Text; Session["AddLine3"] = TextBoxAdd3.Text; Session["DID"] = DBF.Get_DID(DropDownListDistrict2.Text).ToString(); Session["Town"] = TextBoxTown.Text; Session["TID"] = Convert.ToString(DBF.Get_TID(DropDownListTypesofDevelopment.Text)); Session["StartDate"] = DateTime.Parse(string.Format("{0}/{1}/{2} {3}", DropDownListMonth.SelectedValue, DropDownListDay.SelectedItem, DropDownListYear.SelectedItem, DateTime.Now.TimeOfDay)).ToString();
Page 53
E-Tendering
Session["DeadLine"] = DateTime.Parse(string.Format("{0}/{1}/{2} {3}", DropDownListMonthD.SelectedValue, DropDownListDayD.SelectedItem, DropDownListYearD.SelectedItem, DateTime.Now.TimeOfDay)).ToString(); Response.Redirect("PostTenderStep3.aspx"); } else Response.Write("<script>alert('Please fill all required fields')</script>"); } protected void LoadStates() { DR = Con.OpenSqlCommand("Select State from States"); DropDownListState2.Items.Add(""); while (DR.Read()) { DropDownListState2.Items.Add(DR[0].ToString()); } DR.Close(); } protected void LoadDistricts() { DR = Con.OpenSqlCommand(string.Format("Select District, States.SID from Districts, States Where Districts.SID IN (Select SID from States Where State='{0}') AND States.SID IN (Select SID from States Where State='{0}')", DropDownListState2.SelectedItem)); DropDownListDistrict2.Items.Clear(); while (DR.Read()) { DropDownListDistrict2.Items.Add(DR[0].ToString()); Session["SID"] = DR["SID"].ToString(); } DR.Close(); } protected void LoadTypes_of_Development() { DR = Con.OpenSqlCommand("Select SubCategory from TenderSubCategory Where CatID=" + (string)Session["CatID"]); while (DR.Read())
Page 54
E-Tendering
5.7 PostTenderStep3.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.IO; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public partial class PostTenderStep3 : System.Web.UI.Page { SQLConnectionETender Con = new SQLConnectionETender(); protected void Page_Load(object sender, EventArgs e) { string Login_Status = (string)Session["Login_Status"]; if (Login_Status != "true") { Session["Redirect_URI"] = "PostTenderStep1.aspx"; Response.Redirect("Login.aspx"); } else
Page 55
E-Tendering
ImageButtonBack3.Attributes.Add("onClick", "javascript:history.back(); return false;"); the previous page } protected void Upload_Click(object sender, EventArgs e) { Upload_File(); } protected void ImageButtonFinish_Click(object sender, ImageClickEventArgs e) { if ((string)Session["Upload_Status"] != "true") { Upload_File(); Finish_All(); } else Finish_All(); } protected void Finish_All() { Session["TenderInformation"] = TextBoxTenderInformation.Text; Session["SupportingDocumentation"] = TextBoxSupportingDocumentation.Text; Session["IncludedInformation"] = TextBoxIncludedInformation.Text; if (WritetoTable()) { Session["MessageStatus"] = "true"; Session["MessageType"] = "success"; Session["MessageTitle"] = "Congratulations"; Session["MessageMainHead"] = "Your tender is successfully posted"; Session["MessageMainBody"] = "Your tender is successfully posted. Keep watching your mail to receive request for your tender"; Response.Redirect("Message.aspx"); } } //The code is used to go
Page 56
E-Tendering
private bool WritetoTable() { bool status = false; status = Con.WriteSQLQuerry(string.Format("Insert Into SubmittedTender Values ('{0}', {1}, '{2}', '{3}', '{4}', '{5}', {6}, {7}, {8}, '{9}', '{10}', '{11}', '{12}', '{13}', '{14}', {15}, '{16}')", (string)Session["TenderTitle"], (string)Session["CatID"], (string)Session["AddLine1"], (string)Session["AddLine2"], (string)Session["AddLine3"], (string)Session["Town"], (string)Session["SID"], (string)Session["DID"], (string)Session["TID"], (string)Session["StartDate"], (string)Session["DeadLine"], (string)Session["TenderInformation"], (string)Session["SupportingDocumentation"], (string)Session["IncludedInformation"], (string)Session["UploadedFile"], (string)Session["Login_UID"], Convert.ToString(DateTime.Now))); return status; } private void Upload_File() { string pth = Server.MapPath("./Uploads/User/" + (string)Session["Login_UID"]); Directory.CreateDirectory(pth); pth = pth + "\\"; string FileName = Path.GetFileName(FileUploadUser.FileName); string Extension = Path.GetExtension(FileUploadUser.FileName); string NoExtFileName = Path.GetFileNameWithoutExtension(FileUploadUser.FileName); FileName = string.Format("{0}-{1:yyyy-MM-dd_hh-mm-ss-tt}{2}", NoExtFileName, DateTime.Now, Extension); Response.Write("<script>alert('Pth " + pth + "')</script>"); if (FileUploadUser.HasFile) { try {
Page 57
E-Tendering
FileUploadUser.SaveAs(pth + FileName); Session["UploadedFile"] = "./Uploads/User/" + (string)Session["Login_UID"] + "/" + FileName; LabelUploadedFiles.Text = ResolveClientUrl((string)Session["UploadedFile"]); LabelUploadedFiles.Visible = true; Session["Upload_Status"] = "true"; } catch (Exception Ex) { Response.Write("<script>alert('A server error occurred during this operation, please try again later" + Ex.ToString() + "')</script>"); } } else Response.Write("<script>alert('No files were selected') </script>"); } }
5.8 RecoverPassword.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Net.Mail; using System.Data.SqlClient; public partial class RecoverPassword : System.Web.UI.Page { SqlDataReader DR; SQLConnectionETender Con = new SQLConnectionETender(); string __MailAddress, __Password;
Page 58
E-Tendering
bool __unameStatus = false; protected void Page_Load(object sender, EventArgs e) { string Login_Status = (string)Session["Login_Status"]; if (Login_Status == "true") Response.Redirect("Home.aspx"); } protected string Get_EMail(string __user_name) { DR = Con.OpenSqlCommand(string.Format("Select EMail, Password from UserRegInfo Where UserName='{0}'", __user_name)); __MailAddress = string.Empty; if (DR.Read()) { __unameStatus = true; __MailAddress = DR["EMail"].ToString(); __Password = DR["Password"].ToString(); } DR.Close(); return __MailAddress; } protected void ImageButtonSubmit_Click(object sender, ImageClickEventArgs e) { Get_EMail(TextBoxPassword.Text); if (__unameStatus) { string errorMessage = string.Empty; MailMessage mail = new MailMessage(); E_TenderMail email = new E_TenderMail(); mail.To.Add(__MailAddress); string RecoverPasswordMailBody = string.Format("User Name: {0}\nE-Mail: {1}\nYour Password: {2}\n\n\nDon't forward this mail to anyone. This mail is strictly confidential",
Page 59
E-Tendering
"Noreply - This is your password recovery mail", RecoverPasswordMailBody, ref errorMessage)); if (status) { Session["MessageStatus"] = "true"; Session["MessageType"] = "success"; Session["MessageTitle"] = "Password is sent"; Session["MessageMainHead"] = "Check your account"; Session["MessageMainBody"] = "Password recovery steps are sent to your mail. } else { Session["MessageType"] = "warning"; Session["MessageStatus"] = "true"; Session["MessageTitle"] = "Sorry!"; Session["MessageMainHead"] = "Your password can't send to your mail"; Session["MessageMainBody"] = string.Format("We can't reach your mail. Actual error reported: {0}", errorMessage); Response.Redirect("Message.aspx"); } } else Response.Write("<script>alert('This user name is not exist on our database. Please check your username')</script>"); } } Check your mail that you registered with this account"; Response.Redirect("Message.aspx");
Page 60
E-Tendering
5.8 RegisterSupplierInfo.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public partial class TempRegSuppInfo : System.Web.UI.Page { SqlDataReader DR; SQLConnectionETender Con = new SQLConnectionETender(); int UserID; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if ((string)Session["Login_Status"] == "true") Response.Redirect("Home.aspx"); else { Load_TenderCategory(); Load_TypesofProject(); Load_ProfessionalAssociation(); } } } protected void Load_TenderCategory() { CheckBoxListCategory.Items.Clear(); DR = Con.OpenSqlCommand("Select CategoryName from TenderCategory"); while (DR.Read()) {
Page 61
E-Tendering
CheckBoxListCategory.Items.Add(DR[0].ToString()); } DR.Close(); } protected void Load_TypesofProject() { CheckBoxListProjectType.Items.Clear(); DR = Con.OpenSqlCommand("Select TypesofProject from ProjectType"); while (DR.Read()) { CheckBoxListProjectType.Items.Add(DR[0].ToString()); } DR.Close(); } protected void Load_ProfessionalAssociation() { DR = Con.OpenSqlCommand("Select ProfAssociation from ProfessionalAssociation"); DropDownListProfessionalAssociation.Items.Add(""); while (DR.Read()) { DropDownListProfessionalAssociation.Items.Add(DR[0].ToString()); } DR.Close(); } protected bool Validate_Controls() { bool Validation = false; int CategoryCount; CategoryCount = CheckBoxListCategory.Items.Count; if (TextBoxCName.Text == "") { Validation = true; TextBoxCName.Focus(); } else {
Page 62
E-Tendering
for (int i = 0; i < CategoryCount; i++) if (CheckBoxListCategory.Items[i].Selected == true) { Validation = false; break; } } return Validation; } protected void ImageButtonSubmit_Click(object sender, ImageClickEventArgs e) { if (CheckBoxTerms.Checked == true) { if (Validate_Controls() == false) { if (WritetoTableUser() == true) { UserID = Get_UserID(); if (UserID >= 1000) { bool WriteStatus = false; WriteStatus = WritetoTableSupplier(Get_PID(), UserID); if (WriteStatus == true) { Response.Write("<script>alert('Account is successfully created')</script>"); Response.Redirect("Login.aspx"); } else Response.Write("<script>alert('Some error occured during account creation. again later')</script>"); } else Response.Write("<script>alert('Some error occured during account creation of user. Please try again later')</script>"); } else (After user account creation) Please try
Page 63
E-Tendering
Response.Write("<script>alert('Some error occured during account creation. Please try again later')</script>"); else Response.Write("<script>alert('Required fields cannot left as empty')</script>"); } else Response.Write("<script>alert('In order to continue, you must agree the terms and conditions')</script>"); } protected bool WritetoTableUser() { bool status = false; DataBaseFunctions DBFs = new DataBaseFunctions(); if (DBFs.CheckUserNameDuplication() == true) Response.Write("<script>alert('This username is already registered')</script>"); else if (DBFs.CheckEmailDuplication() == true) Response.Write("<script>alert('This E-Mail is already registered')</script>"); else status = Con.WriteSQLQuerry(string.Format("Insert Into UserRegInfo Values ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', {9}, {10}, '{11}', '{12}')", (string)Session["UserName"], (string)Session["Password"], (string)Session["FirstName"], (string)Session["LastName"], (string)Session["EMail"], (string)Session["AddLine1"], (string)Session["AddLine2"], (string)Session["AddLine3"], (string)Session["Town"], (string)Session["SID"], (string)Session["DID"], (string)Session["Phone"], (string)Session["UserType"])); return status; } protected bool WritetoTableSupplier(int PID, int UID) { bool status = false, status1 = false, status2 = false, status3 = false; status1 = Con.WriteSQLQuerry("Insert Into SupplierRegInfo Values ('" + TextBoxCName.Text + "'," + PID.ToString() + ",'" + }
Page 64
E-Tendering
TextBoxCompanyPhone.Text + "','" + TextBoxURL.Text + "'," + UID.ToString() + ")"); status2 = WritetoTable_TypesofProject(); status3 = WritetoTable_Categories(); if (status1 == true && status2 == true && status3 == true) status = true; return status; } protected bool WritetoTable_TypesofProject() { bool status = false; int ProjectTypeCount = CheckBoxListProjectType.Items.Count; for (int i = 0; i < ProjectTypeCount; i++) { if (CheckBoxListProjectType.Items[i].Selected) { int TID = Get_TID(CheckBoxListProjectType.Items[i].Value); status = Con.WriteSQLQuerry("Insert Into SuppTypeofProjects Values (" + TID.ToString() + "," + UserID.ToString() + ")"); } } return status; } protected bool WritetoTable_Categories() { bool status = false; int CategoriesCount = CheckBoxListCategory.Items.Count; for (int i = 0; i < CategoriesCount; i++) { if (CheckBoxListCategory.Items[i].Selected) { int CatID = Get_CatID(CheckBoxListCategory.Items[i].Value); status = Con.WriteSQLQuerry("Insert Into SuppCategory Values (" + CatID.ToString() + "," + UserID.ToString() + ")"); } } return status; }
Page 65
E-Tendering
protected int Get_CatID(string CName) { int CatID = 0; DR = Con.OpenSqlCommand("Select CatID from TenderCategory Where CategoryName='" + CName + "'"); while (DR.Read()) { CatID = Int32.Parse(DR[0].ToString()); } DR.Close(); return CatID; } protected int Get_TID(string TName) { int TID = 0; DR = Con.OpenSqlCommand("Select TID from ProjectType Where TypesofProject='" + TName + "'"); while (DR.Read()) { TID = Int32.Parse(DR[0].ToString()); } DR.Close(); return TID; } protected int Get_PID() { int PID = 0; DR = Con.OpenSqlCommand("Select PID from ProfessionalAssociation Where ProfAssociation='" + DropDownListProfessionalAssociation.Text + "'"); while (DR.Read()) { PID = Int32.Parse(DR[0].ToString()); } DR.Close(); return PID; } protected int Get_UserID() {
Page 66
E-Tendering
int UserID = 0; DR = Con.OpenSqlCommand(string.Format("Select UID from UserRegInfo Where UserName='{0}'", (string)Session["UserName"])); while (DR.Read()) { UserID = Int32.Parse(DR[0].ToString()); } DR.Close(); return UserID; } }
5.9 RegisterUser.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public partial class RegisterUser : System.Web.UI.Page { SqlDataReader DR; SQLConnectionETender Con = new SQLConnectionETender(); protected void Page_Load(object sender, EventArgs e) { if ((string)Session["Login_Status"] == "true") { Server.Transfer("Home.aspx"); } else { LoadStates(); TextBoxUName.Focus();
Page 67
E-Tendering
} } private void LoadStates() { DR = Con.OpenSqlCommand("Select State from States"); DropDownListStatesU.Items.Add(""); while (DR.Read()) { DropDownListStatesU.Items.Add(DR[0].ToString()); } DR.Close(); } protected void LoadDistricts() { DropDownListDistrictU.Items.Clear(); DR = Con.OpenSqlCommand("Select District from Districts Where Districts.SID=" + DataBaseLinkAcrossWebPages.SID.ToString()); DropDownListDistrictU.Items.Add(""); while (DR.Read()) { DropDownListDistrictU.Items.Add(DR[0].ToString()); } DR.Close(); } protected void DropDownListStates_SelectedIndexChanged(object sender, EventArgs e) { DR = Con.OpenSqlCommand("Select States.SID from States Where States.State='" + DropDownListStatesU.SelectedItem + "'"); while (DR.Read()) { Session["SID"] = DR[0].ToString(); } LoadDistricts(); } protected bool Validate_Controls() {
Page 68
E-Tendering
bool Validation; Validation = false; if (TextBoxUName.Text == "") { Validation = true; TextBoxUName.Focus(); } else if (TextBoxPassword.Text == "") { Validation = true; TextBoxPassword.Focus(); } else if (TextBoxPasswordConfirm.Text == "") { Validation = true; TextBoxPasswordConfirm.Focus(); } else if (TextBoxFirstName.Text == "") { Validation = true; TextBoxFirstName.Focus(); } else if (TextBoxEMail.Text == "") { Validation = true; TextBoxEMail.Focus(); } else if (TextBoxAdd1.Text == "") { Validation = true; TextBoxAdd1.Focus(); } else if (DropDownListStatesU.Text == "") { Validation = true; LoadStates(); DropDownListStatesU.Focus(); } else if (DropDownListDistrictU.Text == "") { Validation = true;
Page 69
E-Tendering
LoadDistricts(); DropDownListDistrictU.Focus(); } else if (TextBoxPhone.Text == "") { Validation = true; TextBoxPhone.Focus(); } else if (RadioButtonApply.Checked == false && RadioButtonBoth.Checked == false && RadioButtonSubmit.Checked == false) Validation = true; return Validation; } protected void ImageButtonNextU_Click(object sender, ImageClickEventArgs e) { if (CheckBoxCondition.Checked == true) { if (Validate_Controls() == true) Response.Write("<script>alert('Required fields cannot left as empty')</script>"); else { if (TextBoxPassword.Text == TextBoxPasswordConfirm.Text) { if (RadioButtonApply.Checked == true || RadioButtonBoth.Checked == true) { SavetoStaticVariables(); DataBaseFunctions DBFs = new DataBaseFunctions(); if (DBFs.CheckUserNameDuplication((string)Session["UserName"]) == true) Response.Write("<script>alert('This username is already registered')</script>"); else if (DBFs.CheckEmailDuplication((string)Session["EMail"]) == true) Response.Write("<script>alert('This E-Mail is already registered')</script>"); else Response.Redirect("RegisterSupplierInfo.aspx");
Page 70
E-Tendering
} else if (RadioButtonSubmit.Checked == true) { SavetoStaticVariables(); if (WritetoTable() == true) { Response.Write("<script>alert('Account is successfully created')</script>"); Server.Transfer("Login.aspx"); } } else Response.Write("<script>alert('Please choose the reason for using this service')</script>"); } else Response.Write("<script>alert('Password confirmation is missmatch')</script>"); } } else Response.Write("<script>alert('In order to continue, you must agree the terms and conditions')</script>"); } protected void SavetoStaticVariables() { Session["UserName"] = TextBoxUName.Text; Session["Password"] = TextBoxPasswordConfirm.Text; Session["FirstName"] = TextBoxFirstName.Text; Session["LastName"] = TextBoxLastName.Text; Session["EMail"] = TextBoxEMail.Text; Session["AddLine1"] = TextBoxAdd1.Text; Session["AddLine2"] = TextBoxAdd2.Text; Session["AddLine3"] = TextBoxAdd3.Text; Session["Town"] = TextBoxTown.Text; Session["State"] = DropDownListStatesU.Text; Session["District"] = DropDownListDistrictU.Text; Session["Phone"] = TextBoxPhone.Text; if (RadioButtonSubmit.Checked == true) Session["UserType"] = "SubmitOnly";
Page 71
E-Tendering
else if (RadioButtonApply.Checked == true) Session["UserType"] = "ApplyOnly"; else Session["UserType"] = "Both"; } private bool WritetoTable() { bool status = false; DataBaseFunctions DBFs = new DataBaseFunctions(); if (DBFs.CheckUserNameDuplication() == true) Response.Write("<script>alert('This username is already registered')</script>"); else if (DBFs.CheckEmailDuplication() == true) Response.Write("<script>alert('This E-Mail is already registered')</script>"); else status = Con.WriteSQLQuerry(string.Format("Insert Into UserRegInfo Values ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', {9}, {10}, '{11}', '{12}')", (string)Session["UserName"], (string)Session["Password"], (string)Session["FirstName"], (string)Session["LastName"], (string)Session["EMail"], (string)Session["AddLine1"], (string)Session["AddLine2"], (string)Session["AddLine3"], (string)Session["Town"], (string)Session["SID"], (string)Session["DID"], (string)Session["Phone"], (string)Session["UserType"])); return status; } protected void DropDownListDistrictU_SelectedIndexChanged(object sender, EventArgs e) { DR = Con.OpenSqlCommand("Select Districts.DID from Districts Where Districts.District='" + DropDownListDistrictU.SelectedItem + "'"); while (DR.Read()) { Session["DID"] = DR[0].ToString(); } } }
Page 72
E-Tendering
5.9 Search.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Search : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void ButtonSearch_Click(object sender, EventArgs e) { string ThisPage = string.Format("http://{0}{1}", Request.ServerVariables["SERVER_NAME"], Request.ServerVariables["URL"]); Response.Redirect(string.Format("http://www.google.com/search?q={0}+site%3A {1}", TextBoxSearch.Text, ThisPage)); } }
Page 73
E-Tendering
5.10 TenderTitles.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public partial class TenderTitles : System.Web.UI.Page { SqlDataReader DR; SQLConnectionETender Con = new SQLConnectionETender(); protected void Page_Load(object sender, EventArgs e) { string Login_Status = (string)Session["Login_Status"]; if (Login_Status == "true") { string AwardedTender = Request.QueryString["AT"]; if ((string)Session["ExpiredTender"] == "true") { Session["ExpiredTender"] = "false"; Load_ExpiredTenders(); } else if (AwardedTender == "true") Load_AwardedTenders(); else if (!Load_TenderTitles()) { Session["MessageType"] = "error"; Session["MessageStatus"] = "true"; Session["MessageTitle"] = "Sorry!"; Session["MessageMainHead"] = "No qualified tenders found on database"; Session["MessageMainBody"] = string.Format("Please try again later");
Page 74
E-Tendering
Response.Redirect("Message.aspx"); } } else { Session["Redirect_URI"] = "TenderTitles.aspx"; Response.Redirect("Login.aspx"); } } protected bool Load_TenderTitles() { int i = 0; bool status = false; DR = Con.OpenSqlCommand(string.Format("Select TenderTitle, TenderID, DeadLine from SubmittedTender Where DeadLine >='{0}'", DateTime.Today.Date.ToString())); while (DR.Read()) { Session["ReadOnly"] = "false"; BulletedListTenderTitle.Items.Add(DR["TenderTitle"].ToString() + " - Tender will expired on " + DR["DeadLine"].ToString()); BulletedListTenderTitle.Items[i].Value = string.Format("ViewTender.aspx?TenderID={0}", DR["TenderID"].ToString()); i++; status = true; } DR.Close(); return status; } protected bool Load_ExpiredTenders() { int i = 0; bool status = false; DR = Con.OpenSqlCommand(string.Format("Select TenderTitle, TenderID, DeadLine from SubmittedTender Where DeadLine <='{0}'", DateTime.Now.ToString())); while (DR.Read()) { Session["ReadOnly"] = "true";
Page 75
E-Tendering
BulletedListTenderTitle.Items.Add(DR["TenderTitle"].ToString() + " - Tender was expired at " + DR["DeadLine"].ToString()); BulletedListTenderTitle.Items[i].Value = string.Format("ViewTender.aspx?TenderID={0}", DR["TenderID"].ToString()); i++; status = true; } DR.Close(); return status; } protected bool Load_AwardedTenders() { int i = 0; bool status = false; DR = Con.OpenSqlCommand(string.Format("Select TenderTitle, TenderID, DeadLine from SubmittedTender Where TenderID IN(Select TenderID from ApprovedTender)")); while (DR.Read()) { Session["ReadOnly"] = "true"; BulletedListTenderTitle.Items.Add(DR["TenderTitle"].ToString() + " - Tender was expired at " + DR["DeadLine"].ToString()); BulletedListTenderTitle.Items[i].Value = string.Format("ViewTender.aspx?TenderID={0}", DR["TenderID"].ToString()); i++; status = true; } DR.Close(); return status; } }
Page 76
E-Tendering
5.10 ViewTender.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; using System.IO; using System.Net.Mail; public partial class ViewTenders : System.Web.UI.Page { SqlDataReader DR; SQLConnectionETender Con = new SQLConnectionETender(); string EMail_Address, First_Name, Last_Name, TenderID; Exception Exce; string errorMessage; protected void Page_Load(object sender, EventArgs e) { string Login_Status = (string)Session["Login_Status"]; if (Login_Status == "true") { string ReadOnly = string.Empty; TenderID = Request.QueryString["TenderID"]; try { ReadOnly = Session["ReadOnly"].ToString(); } catch (Exception E) { // } if (ReadOnly == "true") {
Page 77
E-Tendering
Show_DetailsofApprovedTender(); HyperLinkUploadedFile.Enabled = false; TextBoxAmount.ReadOnly = true; TextBoxRemarks.ReadOnly = true; ImageButtonSubmit.Visible = false; } else { HyperLinkUploadedFile.Enabled = true; TextBoxAmount.ReadOnly = false; TextBoxRemarks.ReadOnly = false; ImageButtonSubmit.Visible = true; } Show_Details(); } else { Session["Redirect_URI"] = "ViewTender.aspx"; Response.Redirect("Login.aspx"); } } protected void Show_Details() { DR = Con.OpenSqlCommand(string.Format("Select * from SubmittedTender Where TenderID ={0}", TenderID)); if (DR.Read()) { LabelTenderTitleV.Text = DR["TenderTitle"].ToString(); LabelTendercategoryV.Text = Get_Name("TenderCategory", "CategoryName", DR["CatID"].ToString(), "CatID"); LabelAdd1V.Text = DR["AddLine1"].ToString(); LabelAdd2V.Text = DR["AddLine2"].ToString(); LabelAdd3V.Text = DR["AddLine3"].ToString(); LabelTownV.Text = DR["Town"].ToString(); LabelDistrictV.Text = Get_Name("Districts", "District", DR["DID"].ToString(), "Districts.DID"); LabelStateV.Text = Get_Name("States", "State", DR["SID"].ToString(), "States.SID"); LabelTypesofDevelopmentV.Text = Get_Name("ProjectType", "TypesofProject", DR["TID"].ToString(),"ProjectType.TID");
Page 78
E-Tendering
LabelTenderDeadLineV.Text = DR["DeadLine"].ToString(); LabelApproxStartDateV.Text = DR["StartDate"].ToString(); TextBoxTenderInformationV.Text = DR["TenderInformation"].ToString(); TextBoxQuotationInformationV.Text = DR["IncludedInformation"].ToString(); HyperLinkUploadedFile.Text = Path.GetFileName(DR["UploadedFile"].ToString()); HyperLinkUploadedFile.NavigateUrl = DR["UploadedFile"].ToString(); } DR.Close(); } protected void Show_DetailsofApprovedTender() { DR = Con.OpenSqlCommand(string.Format("Select Amount, Remarks from AppliedTender Where TenderID ={0}", TenderID)); if (DR.Read()) { TextBoxAmount.Text = DR["Amount"].ToString(); TextBoxRemarks.Text = DR["Remarks"].ToString(); } DR.Close(); } protected string Get_Name(string __TableName, string __Item, string __ID, string __Where) { SqlDataReader DR2; DR2 = Con.OpenSqlCommand(string.Format("Select {0} from {1} Where {2}={3}", __Item, __TableName, __Where, __ID)); string __result = "-NA-"; while (DR2.Read()) { __result = DR2[0].ToString(); } DR2.Close(); return __result; }
Page 79
E-Tendering
protected void ImageButtonSubmit_Click(object sender, ImageClickEventArgs e) { if (WriteToTable() == true) { LoadInformationofSupplier(); if (SendEmail() == true) { Session["MessageStatus"] = "true"; Session["MessageType"] = "success"; Session["MessageTitle"] = "Congratulations"; Session["MessageMainHead"] = "Your request is registered"; Session["MessageMainBody"] = "Your request for tender is transfered to the user. The user can approve or reject your request. Please wait for deadline"; Response.Redirect("Message.aspx"); } else { Session["MessageType"] = "warning"; Session["MessageStatus"] = "true"; Session["MessageTitle"] = "Sorry!"; Session["MessageMainHead"] = "Your request is not registered"; Session["MessageMainBody"] = string.Format("Your request for tender is failed to process. This may be a problem with server. error reported: {0}", errorMessage); Response.Redirect("Message.aspx"); } } else { Session["MessageType"] = "error"; Session["MessageStatus"] = "true"; Session["MessageTitle"] = "Sorry!"; Session["MessageMainHead"] = "Your request is not registered (error:db)"; Session["MessageMainBody"] = "Your request for tender is failed to process. \nThis may be a problem with server"; Actual
Page 80
E-Tendering
Response.Redirect("Message.aspx"); } } protected bool WriteToTable() { bool status = false; status = Con.WriteSQLQuerry(string.Format("Insert Into AppliedTender Values ({0}, '{1}', {2}, '{3}', {4})", TextBoxAmount.Text, TextBoxRemarks.Text, (string)Session["Login_UID"], DateTime.Now, TenderID)); return status; } protected bool SendEmail() { MailMessage mail = new MailMessage(); mail.To.Add(EMail_Address); E_TenderMail email = new E_TenderMail(); string DetailsofRegisteredTender = string.Format("\t\t\tDetails about this tender\n\n\nTender Title: {0}\nTender Category: {1}\nAddress: {2}\n\t\t{3}\n\t\t{4}\nTown: {5}\nDistrict: {6}\nState: {7}\nTypes of Development: {8}\nTender DeadLine: {9}\nApproximate start date: {10}\nTender Information: {11}\nInformation about Quotation: {12}\nFiles included in this quotation : {13}\nAmount you quoted: {14}\nRemarks you entered: {15}\n\n\nThis is an auto generated mail. Do not reply", LabelTenderTitleV.Text, LabelTendercategoryV.Text, LabelAdd1V.Text, LabelAdd2V.Text, LabelAdd3V.Text, LabelTownV.Text, LabelDistrictV.Text, LabelStateV.Text, LabelTypesofDevelopmentV.Text, LabelTenderDeadLineV.Text, LabelApproxStartDateV.Text, TextBoxTenderInformationV.Text, TextBoxQuotationInformationV.Text, HyperLinkUploadedFile.Target, TextBoxAmount.Text, TextBoxRemarks.Text); return (email.Send_ETenderMail(mail, "No Reply - E-Tendering", "Noreply - Your request for tender is successfully registstered", DetailsofRegisteredTender, ref errorMessage)); } protected void LoadInformationofSupplier() {
Page 81
E-Tendering
DR = Con.OpenSqlCommand(string.Format("Select FirstName, LastName, EMail from UserRegInfo Where UserRegInfo.UID= {0}", (string)Session["Login_UID"])); while (DR.Read()) { EMail_Address = DR["EMail"].ToString(); First_Name = DR["FirstName"].ToString(); Last_Name = DR["LastName"].ToString(); } DR.Close(); } }
Page 82
E-Tendering
Page 83
E-Tendering
DR = Con.OpenSqlCommand(string.Format("Select UserName from UserRegInfo Where UserRegInfo.UserName='{0}'", ___UserName)); while (DR.Read()) { duplicate = true; } DR.Close(); return duplicate; } public int Get_TID(string __TName) { int TID = 0; DR = Con.OpenSqlCommand("Select TID from ProjectType Where TypesofProject='" + __TName + "'"); while (DR.Read()) { TID = Int32.Parse(DR[0].ToString()); } DR.Close(); return TID; } public int Get_DID(string __TName) { int DID = 0; DR = Con.OpenSqlCommand("Select DID from Districts Where District='" + __TName + "'"); while (DR.Read()) { DID = Int32.Parse(DR[0].ToString()); } DR.Close(); return DID; } }
Page 84
E-Tendering
5.11.2 E-TenderMail.cs
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Net.Mail; public class E_TenderMail { public E_TenderMail() { } public const string From = "noreply.e.tender@gmail.com"; private const string Password = "8bxd3VvbPP&8xe3"; public bool Send_ETenderMail(MailMessage mail, string __TextwithFrom_Email, string __Subject, string __Body, ref string __Error) { string errorMessage; mail.From = new MailAddress(From, __TextwithFrom_Email, System.Text.Encoding.UTF8); mail.Subject = __Subject; mail.SubjectEncoding = System.Text.Encoding.UTF8; mail.Body = __Body; mail.BodyEncoding = System.Text.Encoding.UTF8; mail.IsBodyHtml = false; mail.Priority = MailPriority.High; SmtpClient client = new SmtpClient(); client.Credentials = new System.Net.NetworkCredential(From, Password); client.Port = 587; client.Host = "smtp.gmail.com"; client.EnableSsl = true;
Page 85
E-Tendering
try { client.Send(mail); return true; } catch (Exception ex) { Exception ex2 = ex; errorMessage = string.Empty; while (ex2 != null) { errorMessage += ex2.ToString(); ex2 = ex2.InnerException; } __Error = errorMessage; return false; } return false; } }
5.11.2 SQLConnectionETender.cs
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public class SQLConnectionETender { public SQLConnectionETender() { } public SqlConnection OpenConnection() {
Page 86
E-Tendering
SqlConnection __Connection__ = new SqlConnection("server =localhost; database=E_TenderDB; uid=sa; pwd=multi"); __Connection__.Open(); return __Connection__; } public SqlDataReader OpenSqlCommand(String __SQLCommandString) { SqlDataReader __DataReader; SqlCommand __Command = new SqlCommand(__SQLCommandString, OpenConnection()); __DataReader = __Command.ExecuteReader(); return __DataReader; } public bool WriteSQLQuerry(String __SQLCommandString) { SqlCommand __WriteSQLCommand = new SqlCommand(__SQLCommandString, OpenConnection()); if (__WriteSQLCommand.ExecuteNonQuery() == 1) return true; return false; } }
Page 87
E-Tendering
5.12 Web.sitemap
<?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url="Default.aspx" title="E-Tendering" home page"> <siteMapNode url="Home.aspx" title="Home" /> <siteMapNode url="" title="E-Tender" items"> <siteMapNode url="ViewTender.aspx" title="View Tenders" description="Supplier can view list of tenders" /> <siteMapNode url="PostTenderStep1.aspx" title="Post a tender" description="User can post tender" /> <siteMapNode url="Approvetender.aspx" title="Approve Tender" description="User can approve tender" /> <siteMapNode url="ExpiredTenders.aspx" title="Expired tenders" description="View expired tenders" /> </siteMapNode> <siteMapNode url="TenderTitles.aspx?AT=true" title="Awards" description="User approved tenders"/> <siteMapNode url="" title="Accounts" items"> <siteMapNode url="Login.aspx" title="Login" for all type of user" /> <siteMapNode url="RecoverPassword.aspx" title="Recover Password" description="Password recovery page" /> <siteMapNode url="RegisterUser.aspx" title="Register new user" description="Password recovery page" /> </siteMapNode> <siteMapNode url="Search.aspx" title="Search" sitemap"/> <siteMapNode url="About.aspx" title ="About" description="About ETendering"/> <siteMapNode url="FAQ.aspx" title="FAQ" description="Know more about ETendering"/> </siteMapNode> </siteMap> description="Search"/> description="View <siteMapNode url="SiteMap.aspx" title="Site Map" description="Login page description="Account related description="E-Tender related description="View home page" description="View
Page 88
E-Tendering
SYSTEM TESTING
System Testing is the stage of implementation, which is aimed at ensuring that the system works accurately and efficiently as expected before live operation commences. It certifies that the whole set of program hang together. System testing requires a test plan that consists of several keys, activities and steps to run program, string, system and user acceptance testing. The implementation of newly designed package is important in adopting a successful new system.
Page 89
E-Tendering
After validation test has been conducted one of the two possible conditions exists. 1. The function or performance characteristics confirm to specification and are accepted. 2. A deviation from specification is uncovered and a deficiency list is created After performing the validation testing, the next step is output testing of the proposed system since no system could be useful if it doesnt produce the required data in the specific format. The output displayed or generated by the system under consideration is tested by, asking the user about the format displayed. The output format on the screen is found to be correct as the format was designed in the system according to the user needs. Hence the output testing doesnt result in any correction of the system. 6.1.5 User Acceptance User acceptance of the system is the key factor for the success of the system. The system under consideration is tested for user acceptance by constantly keeping in touch with prospective system at the time of developing and making change wherever required. This is done with regard to the following points: Output Screen design. Input Screen design. Menu driven system. 6.1.6 White box testing White box testing is a testing case design method that uses the control structure of the procedural design to derive the test cases. The entire independent path in a module is exercised at least once. All the logical decisions are exercised at least once. Executing all the loops at boundaries and within their operational bounds exercise internal data structure to ensure their validity. In my project Frenz4Ever testing was conducted at every step. Initially each module was tested separately to check whether they gave the desired output for the given input. The forms used to enter data by user were validated and appropriate error messages were displayed if incorrect data was entered. Once the data was entered correctly, the processing was done and testing was done to check whether the correct output was obtained. Once the test cases were conducted successfully for each module, the modules were integrated together as a single system. After integration, the test cases were again applied to check whether the entire system as a whole produced the desired output. At times, the test cases failed and the shortcomings were noted down and appropriate corrections were done. Once the integration testing was performed correctly, output testing was done and it did not result in any change or correction in the system. Black box testing and white box testing was also conducted successfully. All the loops, decisions, relations were executed at least once before giving it to the users for testing. In black box testing, it was checked whether the data in the proper format was stored in the database or not. Also, it was checked whether the interfaces were working properly or not. On successful completion of these tests,
Page 90
E-Tendering
the system was then given to undergo user acceptance testing where the users entered test data to check whether the correct output was obtained. The users were satisfied with the output and thus the testing phase was completed successfully.
Page 91
E-Tendering
SCREEN SHOTS
7.1 Home
Page 92
E-Tendering
7.2 Login
Page 93
E-Tendering
Page 94
E-Tendering
Page 95
E-Tendering
Page 96
E-Tendering
Page 97
E-Tendering
Page 98
E-Tendering
7.11 Message
Page 99
E-Tendering
Page 100
E-Tendering
Page 101
E-Tendering
Page 102
E-Tendering
Page 103
E-Tendering
Page 104
E-Tendering
7.18 FAQ
Page 105
E-Tendering
7.19 About
Page 106
E-Tendering
Page 107
E-Tendering
CONCLUSION
The e-tendering system proved to be beneficial to both users and suppliers. The automation dramatically reduced flow of paper files and follow up, while online payment transactions accelerated the tender process, thereby reducing the lead time for procurement. The most important aspect is that suppliers are no more required to come to the office for tender purchasing, submission and opening, thereby reducing the cost of tendering. The online system has offered fast and more transparent tendering process. The implementation of e-tendering system requires involvement of users from all levels in the organisation hierarchy and commitment from the top management. ETendering has shown a way to boost internal savings and enabled corporations to cut down the final cost of their products. The uses of e-tendering system do not require sophistication in computer knowledge, and vendors and officers with different background can successfully participate in the process.
Page 108
E-Tendering
REFERENCES
9.1 BIBLIOGRAPHY
1. Beginning ASP.NET 3.5 in C# 2008 second edition Matthew MacDonald 2. Build your own ASP.Net 2.0 Web Site using C# & VB By Critian Darie & Zak Ruvalcaba 3. ASP.Net 3.5 in C# 2008 Matthew MacDonald and Mario Szpuszta 4. Begining ASP.Net 2.0 With C# Chris Hart, John Kauffman, David SussMan, Chris Ullman 5. Software Engineering-Roger S Pressman. 6. System Analysis and Design- James A. Senn.
9.2 Websites
1. 2. 3. 4. www.msdn.microsoft.com. http://en.wikipedia.org/wiki/Internet_Information_Services. http://en.wikipedia.org/wiki/C_Sharp. http://en.wikipedia.org/wiki/Windows_Server_2003. 5. http://en.wikipedia.org/wiki/Microsoft_Visual_Studio.
Page 109