Friday, May 15, 2020

Transport Management System

Transport Management System


ONLINE TRANSPORT MANAGEMENT SYSTEM PROJECT REPORT | ONLINE TRANSPORT MANAGEMENT SYSTEM


Project Overview


INTRODUCTION

 

In this modern era, where every thing greatly relies on technology there is a possibility to develop unique application which can justify the problems faced by ordinary methodology to achieve a desired functionality in a real time system. Our project belongs to that half.

 

            This project is a real time application that is being developed for one of the reputed transport companies in the state of Andhra Pradesh. The project takes dotnet as development platform and C# is the language used for development.

 

COMPANY PROFILE


3. SYSTEM ANALYSIS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SYSTEM ANALYSIS

 

‘The Transport Management System’ is designed in a simplest manner, very much user friendly so that the people using it should not struggle with the operational features of the system. An analysis is carried out in achieving this. A wide variety of transport firms have been analysed and came to a conclusion that transport firms related to shipping the goods from one place to another and logistics involves more clerical work , difficult maintanance issues.

 

  1. EXISTING SYSTEM - ITS DRAWBACKS:

                   The ordinary methodology of maintaining a transport firm involves the following drawbacks:

 

§  Time consumption in maintanace is high.

§  Less Security.

§  Involves extra-clerical work.

§  Involves more man power.

§  Irregularities in maintaining the record

§  Very much dependent on user intelligence.

 

                    These are the problems faced during the real time execution of the existing system and this awakened the idea of making a tool which negotiates the above drawbacks in a sophisticated yet in a simple manner. The idea is nonetheless The Transport Management System.

 

  1.  PROPOSED SYSTEM - ITS ADVANTAGES:

 

                    The proposed system involves software developed in higher end program development environments which take all operational and security issues in to consideration to a great extent.

 

 

The following are the advantages we can feel with this project: 

                  

ü  Tranport maintanace will be easy which takes less time for maintance.

ü  Every thing is automised and the system totally transperant.

ü  Minimal Clerical work involved.

ü  Less man power required.

ü  Very much user friendly with good look and feel.

ü  Minmal dependancy on User Intelligence.

 

FUNCTIONAL COMPONENTS OF THE SYSTEM:

 

Following is a list of functionalities of the system. More functionalities as deemed appropriate can be added to the list in near future. And, in places where the description of functionality is not adequate, appropriate assumptions are made.

                  

1.      Administrator Login

2.      Customer Registration

3.      Transport Info Entry

4.      Expenses Entry

5.      Reports

 

  1. Administrator Login:

 

                First to enter this system the users has to login to this system. Basically this is a single user application.

 

  • The system comes with a predefined administrator (comes with default login credentials and whose password can be changed later) whose first task after immediate successful login is to register the customers for whom the firm going to serve.

 

  •  First a login screen will be displayed to get the user’s login details. The user has to enter the user-id and the password. The password has to be masked with character ‘*’

 

  • The user details will be verified against the details in the user tables and if he / she are valid user, they should be entered into the system. Once entered, based on the user type access to the different modules to be enabled / disabled.

 

  • If user enters wrong password for continuously 5 times, the account should be locked. The information about the login and logout details will be stored in a separate table.

 

  1. Customer Registration:

 

  • Customer Registration is used to create a new a new customer, modify the details of existing user or remove the existing user.  Only the administrator can  have access to this part. Normal user won’t have access to this has to login as admin to do this.

 

  • Customers are registered by the admin and each customer will be identified distinctly by using the primary key in the back end.

 

  • Functionality is provided to change password by the admisnistrator. It is recommended that the administrator changes his password as soon as he logins for the very first time.

 

 

  1. Transport Info Entry:

 

This is the core part of the application which every other thing revolves around.

 

  • This will take the details of the unique slip number, the vehicle number, the metal info that is being transported, the cost incurred for the metal and trasport, the place to where it is getting transported to, the customer who ordered the transport and the amount paid by the customer.

 

  • When ever the transport information is provided the system automatically caluclates the due or advance paid against a particular customer for a particular trip and preserves the customers current due or advance amount depending upon the amount paid by the customer is in low or excess of the current transport amount respectively.

 

  • The same form also allows the user to edit the particular transport info including the amounts and system recaluclates automatically and saves the particular transport information.

 

  1. Expenses Entry:

 

·         This window is used to enter the expenses incurred on a vehicle used for transport   on a particular day.

 

·         The expenses that include may be diesel charges, driver allowances, puncture and

repairs, road tokens etc,

 

  1. Reports:

 

           This module is used to display and print various reports.

 

  • Customer Report –This report is used to print the details of customers such as name, address and corresponding balance of a customer.

 

  • Transport Report – This report gives the overall summary of the transport from a start date to a end date. It shows the overall transport amount the firm as got and the expenses incurred on the vehicle between these dates and hence able to caluclate income for a particular period.

 

 

 

             

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4.REQUIREMENT SPECIFICATION

 

 

 

 

 

 

 

 

 

 

 

 

 

 

REQUIREMENT SPECIFICATION

 

SOFTWARE REQUIREMENT SPECIFICATION (SRS):

 

              The following are the software requirement specification which are required to complete this project

        

->Operating System         :  Microsoft Windows XP

 

->Runtime Framework     : .NET Frame Work V 3.5

 

->Front end (GUI)            :  MS Visual Studio 2008

 

->Back end (Data Base)   :  MS Server 2005

 

->Web Server                   :  IIS

 

->Internet Browser           :  Internet Explorer 6 or more

 

 

HARDWARE REQUIREMENT SPECIFICATION (HRS):

 

The following are the hardware requirement specification which are required to complete this project

        

->Processor                      :  Any processor with a speed of 600 MHz or more

 

->RAM                             :  Minimum of 256 MB but 1 GB preferred

 

->Hard Disk                     :   20 GB or more

 

->Printer                           :  132 Column dot matrix printers.

 

->Peripherals                    :  Preferably color monitor, Key board, Mouse.

 

 

 

 

 

 

 

 

TECHNICAL SKILLS:

 

 

->Front end technology                    :  ASP.Net 3.5 with VS 2008

 

->Programming language                 :  C# (C – Sharp).

 

->Back end technology                     :   SQL Server 2005.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5.Dot Net Application Development

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DOT NET APPLICATION DEVELOPMENT

 

ABOUT .NET

 

What is Microsoft.NET?       

       Microsoft.NET is the Microsoft strategy for connecting system, information, and devices through Web services so people can collaborate and communicate more effectively.  .NET technology is integrated thought Microsoft products, providing the capability to quickly build, deploy, manage, and use connected, security -enhanced solution through the use of Web services.

 

     .NET technologies use Web services to help enhance the computing experience with highly integrated communication and information.  Because .NET includes the core technologies for building Web services, it benefits every one:  individual   users, organization, and developers. 

 

     .NET is the Microsoft Web services strategy to connect information, people, systems, and devices through software.   Integrated across the Microsoft software, .Net technology provides the ability to quickly build, deploy, manage, and use connected, security-enhance solutions with Web services.   .NET-connected solutions enable businesses to integrate their systems more rapidly and in more agile manner and help then realize the promise of information any time, any where, on any device.

 

Benefits of .NET

 

Ø  .NET technologies and Web services can be used for integrate even the most disparate computing environments. .NET frees organizations from the confines of proprietary technology, providing the flexibility and scalability that can help organizations connect their existing IT systems and build a foundation for the next wave of computer technology. .NET and web services can help organizations lower operating costs by helping connect systems.

Ø  .NET-enabled computing is centered on the user-not on the features of the software or hardware. The user's experience becomes very customizable and provides integrated data and customized interactions that work well with a wide range of computing hardware.

 

Ø  .NET benefits developers by providing a tightly integrated set of tools for building   and integrating web services. Visual Studio .NET and the .NET Framework provide comprehensive development platforms the offer the best, fastest, and most cost-effective way to build Web services.

 

Ø  .NET also provides a foundation for building Service Oriented Architectures (SOA).

 

 ABOUT ASP.NET

 

 What is ASP?

 

       ASP.NET is the next generation ASP, but it's not an upgraded version of ASP. ASP.NET is an entirely new paradigm for server-side ASP scripting.

 

      ASP is a server side scripting technology that enables scripts to be executed by an Internet server.  

 

Ø  ASP is a Microsoft Technology

Ø  ASP stands for Active Server Pages

Ø  ASP is a program that runs inside IIS.

Ø  IIS stands for Internet Information Services.

Ø  IIS comes as a free component with windows 2000

Ø  IIS is also a part of the Windows NT 4.0 Option pack

Ø  The option packs can be downloaded from Microsoft

How does it work???

 

Ø  When a browser requests an HTML file, the server returns the file

Ø  When a browser requests an ASP file, IS passes the request to the ASP engine on the server

Ø  The ASP engine reads each file and executes the scripts in the file

Ø   Finally, the ASP file is written to the browser as plain   HTML.

Ø  ASP.NET is the new offering for Web developers from the Microsoft.   It is a completely re-engineered and enhanced technology that offers much, much more than traditional ASP and can increase productivity significantly.  ASP.NET provides services to allow the creation, deployment, and execution of Web Application and Web Services.

Ø  Web Applications are built using Web Forms.  ASP.NET comes with built-in Web Forms controls, which are responsible for generating the user interface. They mirror typical HTML wedged like textboxes or buttons. ASP.NET is based on a fundamental architecture of .NET Framework. Visual studio provides a uniform way to combine the various features of   this Architecture. Some times in ASP.NET very familiar, and they remain us ASP. But concepts like Web Forms, Web Services, are Server Controls gives ASP.NET the power to build real Web applications.

            

   Advantages of ASP.NET

 

   Separation of code from HTML

      To make a clean sweep, with ASP.NET we have the ability to completely separate layout and business logic. This makes it much easier for teams of programmers and designers to collaborate efficiently.

 

  Support for compiled language

       Developer can use VB.NET and access features such as strong typing and object-oriented programming. 

       Using compiled languages also means that ASP.NET pages do not suffer the performance penalties associated with interpreted code.ASP.NET pages are precompiled to byte-code and Just In Time (JIT) compiled when first requested. Subsequent requests are directed to the fully compiled code, which is catched until the source changes.

 

 Update files while the server is running

        Components of your application can be updated while the server is online and clients are connected. The Framework will use the new files as soon as they are copied to the application. Removed or old files that are still in use are kept in memory until the clients have finished. 

 

 

  Benefits of ASP.NET controls

 

  Using ASP.NET controls provided four important benefits:

 

Ø  ASP.NET controls expose the HTML elements of a page in an intuitive object model.

Ø  ASP.NET controls automatically retain the values of properties by participating in view state.

Ø   ASP.NET controls enable you to cleanly separate the design content of a page from the application logic.

Ø  ASP.NET controls enable you to maintain browser compatibility, while still supporting advanced browsers features such as JavaScript.

 

 

 

 

 

 

 

ABOUT ADO.NET:

 

ADO.NET is the .NET platform's new database technology, and it builds on ADO (Active Data Objects). ADO.NET defines Dataset and Data Table objects that are optimized for moving disconnected sets of data across intranets and Internets, including through firewalls. At the same time, ADO.NET includes the traditional Connection and Command objects, as well as an object called a Data Reader that resembles a forward-only, read-only ADO record set. Together these objects provide the very best performance and throughput for retrieving data from a database.

 

What is ADO.NET?

 

Ø  ADO.NET is a part of the .NET Framework

Ø  ADO.NET consists of a set of classes used to handle data access

Ø  ADO.NET is entirely based on XML

Ø  ADO.NET has, unlike ADO, no Record set object

 

 ADO.NET is an object-oriented set of libraries that allows you to interact with data sources.  Commonly, the data source is a database, but it could also be a text file, an Excel spread sheet, or an XML file

 

Data Providers:

 

ADO.NET provides a relatively common way to interact with data sources, but comes in different sets of libraries for each way you can talk to a data source.  These libraries are called Data Providers and are usually named for the protocol.

 

We know that ADO.NET allows us to interact with different types of data sources and different types of databases.  However, there is not a single set of classes that allow you to accomplish this universally.  Since different data sources expose different protocols, we need a way to communicate with the right data source using the right protocol.  Some older data. Sources use the ODBC protocol, many newer data sources use the OLEDB protocol, and there are more data sources every day that allow you to communicate with them directly through .NET ADO.NET class libraries.

    

ABOUT SQL

 

What is SQL?

Ø  SQL stands for Structured Query Language.

 

Ø  SQL allows you to access a database.

 

Ø  SQL is an ANSI   standard computer language.

 

Ø  SQL can execute queries against a database.

 

Ø  SQL can retrieve data from a database.

 

Ø  SQL can insert new records in a database.

 

Ø  SQL can delete records from a database.

 

Ø   SQL can update records in a database.

 

Ø   SQL is easy to learn.

        

     SQL language allows us to pose complex questions of a database. It also provides a means of creating databases. SQL very widely use. Many database products supports SQL, this means that if learn how to use SQL you can apply this knowledge to MS Access or SQL Server or to Oracle or Ingress and countless other database.

 

     SQL works with relational database. A relational database stores data in tables. A table consists a list of records.

      SQL also as commands to create tables to add records, to delete records and to change the values of fields of existing records; you can commit roll back transaction; you can add and delete fields from existing tables, specify indexes and create views.

 

       SQL allows user to access data in relational database management systems. It also allows user to define the data in a database and manipulate that data. The Structured Query Language (SQL) comprises one of the fundamental building blocks of modern database architecture.

 

       SQL commands can be divided into two main sub languages. The Data Definition Language (DDL) that contains the commands uses to create and destroy databases and database objects. After the database structure is defined with DDL, database administrators and users can utilize can the Data Manipulation Language to insert, retrieve and modify the data contained within it. Database normalization can save storage space and insure the consistency of your data.

 

ABOUT C#:

 

         The c# language is disarmingly simple, with only about 80 keywords and a dozen built-in data types, but c# is highly expressive when it comes to implementing modern programming concepts c# includes all the support for structure, component-based, object-oriented programming that one expects of a modern language built on the shoulders of C++ and Java.  

 

          C# language supports for defining and working with classes. Classes define new types, allowing you to extend the language to better model the problem you are trying to solve c# contains key words for declaring new classes and their methods and properties, and for implementing encapsulation, inheritance ,and polymorphism  the three pillars of object-oriented programming.     

       

 

           In C# everything pertaining to a class declaration is found in the declaration itself. C# class definition does not require separate header files or Interface Definition Language (IDL) files. Moreover, C# supports a new XML style of inline documentation that greatly simplifies that creation of online and print reference documentation for an application.         

 

          C# also supports Interfaces, a means of making a contract with a class for services that the Interface stipulates. In C#, a class can inherit from only a single parent, but a class can implement multiple interfaces. When it implements an interface, a C# class in effect promises to provide the functionally interface specifies.

 

           C# also provides support for struct, a concept whose meaning has changed significantly from C++. In C#, struct is restricted, lightweight type that, when instantiated, makes fewer your demands on the operating system and on memory then a conventional class does. A struct can't inherit from a class or be inheriting from, but a struct can implement an interface.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6.SYSTEM DESIGN

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SYSTEM DESIGN

 

 

DATA FLOW DIAGRAM

 

 

 

Zero level DFD:

 

 

 

 

UML DIAGRAM:

Oval: Shares

 

 

 

 

 

DESIGN MODEL

 

DATABASE DESIGN:

 

 

 

MstLoginInfo Table:

 

 

 

 

 

Customer details Table:

 

 

 

 

 

 

Transport Info Table:

 

 

 

Login Details table:

 

 

DATABASE DIAGRAM:

 

 

 

 

 

 

 

 

 

 

 

 

7.CODE SAMPLE

 

 

 

 

 

 

 

 

 

 

 

CODE SAMPLE

 

TRANSPORT INFO

 

 

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using System.Data.SqlClient;

namespace Project_BMU1

{

    public partial class frmTransport : Form

    {

        static int selected_custid;

        static string selected_custname;

        SqlConnection cn = new SqlConnection();

        SqlDataAdapter ad;

        DataSet ds;

        public frmTransport()

        {

            InitializeComponent();

        }

 

        private void frmCustomers_Load(object sender, EventArgs e)

        {

            cn.ConnectionString = "Data Source=.;Initial Catalog=BMU;Integrated Security=True";

            loadcustomer();

            loaddetails();

            btnDelete.Enabled = false;

           

        }

 

        void loadcustomer()

        {

            ds = new DataSet();

            ad = new SqlDataAdapter("Select CustomerID,Customer_Name from MStrCustomer", cn);

            ad.Fill(ds);

            for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)

            {

                cmbCustomerName.Items.Add(ds.Tables[0].Rows[i][0].ToString() + "-" + ds.Tables[0].Rows[i][1].ToString());

            }

 

        }

 

        

 

        private void btnNew_Click(object sender, EventArgs e)

        {

            fnclear();

        }

 

        private void btnSave_Click(object sender, EventArgs e)

        {

           

            if (txtSlipNo.Text.Trim()  == "")

            {

                MessageBox.Show("Please Enter Slip Number");

                txtSlipNo.Focus();

            }

            else if (cmbFactory.Text == "---Select/Enter---" || cmbFactory.Text.Trim ()== "")

            {

                MessageBox.Show("Please Select/Enter a Factory");

                cmbFactory.Focus();

            }

           

            else if (cmbVehicleNo.Text.Trim() == "---Select/Enter---"||cmbVehicleNo.Text.Trim() == "")

            {

                MessageBox.Show("Please Select/Enter Vehicle Number");

                cmbVehicleNo.Focus();

            }

            else if (cmbTypeOfMaterial .Text  == "---Select/Enter---" || cmbTypeOfMaterial .Text.Trim ()  == "")

            {

                MessageBox.Show("Please Enter or Select Type of Material");

               cmbTypeOfMaterial .Focus ();

            }          

            else if (cmbMetalSize.Text == "---Select/Enter---" || cmbMetalSize.Text.Trim () == "")

            {

                MessageBox.Show("Please Select/Enter Metal Size");

                cmbMetalSize.Focus();

            }

            else if (txtUnits.Text.Trim() == "")

            {

                MessageBox.Show("Please Enter Units");

               txtUnits.Focus();

            }

            else if (cmbCustomerName.SelectedIndex  == -1 && btnSave .Text =="Save")

            {

               MessageBox.Show("Please Select a Customer");

               cmbCustomerName.Focus();

            }

            else if (txtMetalAmount.Text.Trim() == "")

            {

                MessageBox.Show("Please Enter Metal Amount");

                txtTransportAmount.Focus();

            }

           

            else if (txtTransportAmount.Text.Trim() == "")

            {

                MessageBox.Show("Please Enter Transport Amount");

                 txtTransportAmount.Focus();

            }

           

            else if (txtAmountPaid.Text.Trim() == "")

            {

                MessageBox.Show("Please Enter Amount Paid");

                txtAmountPaid.Focus();

            }

            else if (float.Parse(txtAmountPaid.Text) < float.Parse(txtMetalAmount.Text))

            {

                MessageBox.Show("Amount paid should be greater than Metal Amount.");

                txtAmountPaid.Focus();

            }

            else

            {

                float amtDue_or_Adv;

                amtDue_or_Adv = float.Parse(txtAmounttobePaid.Text) - float.Parse(txtAmountPaid.Text);

                if (btnSave.Text == "Save")

                {

                   

                    ds = new DataSet();

                    ad = new SqlDataAdapter("select * from tblmetalMstr", cn);

                    ad.Fill(ds);

                    DataRow r = ds.Tables[0].NewRow();

                    r[0] = txtSlipNo.Text;

                    r[1] = cmbFactory.Text;

                    r[2] = cmbVehicleNo.Text;

                    r[3] = cmbTypeOfMaterial.Text;

                    r[4] = cmbMetalSize.Text;

                    r[5] = txtUnits.Text;

                    r[6] = selected_custname;

                    r[7] = txtCustomerCity.Text;

                    r[8] = float.Parse(txtMetalAmount.Text);

                    r[9] = float.Parse(txtTransportAmount.Text);

                    r[10] = float.Parse(txtAmountPaid.Text);

                    r[11] = amtDue_or_Adv;

                    r[12] = dtpDate.Value;

                    r[14]=txtDriverName .Text;

                    r[15]=txtstartread .Text;

                    r[16]=txtendread .Text;

                    ds.Tables[0].Rows.Add(r);

                    SqlCommandBuilder cmdb = new SqlCommandBuilder(ad);

                    ad.Update(ds);

                    ds = new DataSet();

                    ad = new SqlDataAdapter("Update MstrCustomer set Amount_Due_Bal=" + amtDue_or_Adv + " where CustomerID=" + selected_custid + "", cn);

                    ad.Fill(ds);

                    MessageBox.Show("Details Successfully Saved");

                    fnclear();

                }

                else

                {

                    ds = new DataSet();

                    ad = new SqlDataAdapter("select * from tblmetalMstr where slip_no="+ int.Parse (txtSlipNo .Text )+"", cn);

                    ad.Fill(ds);

                    if (ds.Tables[0].Rows.Count > 0)

                    {

                        ds.Tables[0].Rows[0].BeginEdit();

                        ds.Tables[0].Rows[0][1] = cmbFactory.Text;

                        ds.Tables[0].Rows[0][2] = cmbVehicleNo.Text;

                        ds.Tables[0].Rows[0][3] = cmbTypeOfMaterial.Text;

                        ds.Tables[0].Rows[0][4] = cmbMetalSize.Text;

                        ds.Tables[0].Rows[0][5] = txtUnits.Text;                       

                        ds.Tables[0].Rows[0][8] = float.Parse(txtMetalAmount.Text);

                        ds.Tables[0].Rows[0][9] = float.Parse(txtTransportAmount.Text);

                        ds.Tables[0].Rows[0][10] = float.Parse(txtAmountPaid.Text);

                        ds.Tables[0].Rows[0][11] = amtDue_or_Adv;

                        ds.Tables[0].Rows[0][12] = dtpDate.Value;

                        ds.Tables[0].Rows[0][14]=txtDriverName .Text;

                        ds.Tables[0].Rows[0][15]=txtstartread .Text;

                        ds.Tables[0].Rows[0][16]=txtendread .Text;

                        ds.Tables[0].Rows[0].EndEdit();

                        SqlCommandBuilder cmdb = new SqlCommandBuilder(ad);

                        ad.Update(ds);

                        ds = new DataSet();

                        ad = new SqlDataAdapter("Update MstrCustomer set Amount_Due_Bal=" + amtDue_or_Adv + " where CustomerID=" + selected_custid + "", cn);

                        ad.Fill(ds);

                        MessageBox.Show("Details Successfully Saved");

                        fnclear();

                    }

                }

            }

 

           

        }

 

        private void txtMetalAmount_TextChanged(object sender, EventArgs e)

        {

            float payamount;

            if (txtMetalAmount.Text != "")

            {

                if (txtTransportAmount.Text != "")

                {

                    payamount = float.Parse(txtMetalAmount.Text) + float.Parse(txtTransportAmount.Text) + float.Parse(txtamtDueorAdv.Text);

                    txtAmounttobePaid.Text = payamount.ToString ();

                }

                else

                {

                    payamount = float.Parse(txtMetalAmount.Text) + float.Parse(txtamtDueorAdv.Text);

                    txtAmounttobePaid.Text = payamount.ToString();

                }

               

            }

            else

            {

                if (txtTransportAmount.Text != "")

                {

                    payamount =  float.Parse(txtTransportAmount.Text) + float.Parse(txtamtDueorAdv.Text);

                    txtAmounttobePaid.Text = payamount.ToString();

                }

                else

                {

                    payamount =  float.Parse(txtamtDueorAdv.Text);

                    txtAmounttobePaid.Text = payamount.ToString();

                }

            }

        }

 

        private void txtTransportAmount_TextChanged(object sender, EventArgs e)

        {

            float payamount;

            if (txtTransportAmount.Text != "")

            {

                if (txtMetalAmount.Text != "")

                {

                    payamount = float.Parse(txtMetalAmount.Text) + float.Parse(txtTransportAmount.Text) + float.Parse(txtamtDueorAdv.Text);

                    txtAmounttobePaid.Text = payamount.ToString();

                }

                else

                {

                    payamount = float.Parse(txtTransportAmount.Text) + float.Parse(txtamtDueorAdv.Text);

                    txtAmounttobePaid.Text = payamount.ToString();

                }

            }

            else

            {

                if (txtMetalAmount.Text != "")

                {

                    payamount = float.Parse(txtMetalAmount.Text) + float.Parse(txtamtDueorAdv.Text);

                    txtAmounttobePaid.Text = payamount.ToString();

                }

                else

                {

                    payamount = float.Parse(txtamtDueorAdv.Text);

                    txtAmounttobePaid.Text = payamount.ToString();

                }

            }

 

        }

 

        private void cmbCustomerName_SelectedIndexChanged(object sender, EventArgs e)

        {

            if (cmbCustomerName.SelectedIndex != -1)

            {

                selected_custid = int.Parse(cmbCustomerName.SelectedItem.ToString().Substring(0, cmbCustomerName.SelectedItem.ToString().IndexOf("-")));

                selected_custname = cmbCustomerName.SelectedItem.ToString().Substring(cmbCustomerName.SelectedItem.ToString().IndexOf("-") + 1);

                ds = new DataSet();

                ad = new SqlDataAdapter("Select Amount_Due_Bal,Address from MStrCustomer where customerid=" + selected_custid + "", cn);

                ad.Fill(ds);

                txtamtDueorAdv.Text = ds.Tables[0].Rows[0][0].ToString();

                txtCustomerCity.Text = ds.Tables[0].Rows[0][1].ToString();

            }

        }

 

        private void txtMetalAmount_KeyPress(object sender, KeyPressEventArgs e)

        {

            if (((int)e.KeyChar > 47 && (int)e.KeyChar < 58) || (int)e.KeyChar == 46 || (int)e.KeyChar == 8)

            {

            }

            else

            {

                e.Handled = true;

            }

        }

 

        private void txtTransportAmount_KeyPress(object sender, KeyPressEventArgs e)

        {

            if (((int)e.KeyChar > 47 && (int)e.KeyChar < 58) || (int)e.KeyChar == 46 || (int)e.KeyChar == 8)

            {

            }

            else

            {

                e.Handled = true;

            }

        }

 

        private void txtAmountPaid_KeyPress(object sender, KeyPressEventArgs e)

        {

            if (((int)e.KeyChar > 47 && (int)e.KeyChar < 58) || (int)e.KeyChar == 46 || (int)e.KeyChar == 8)

            {

            }

            else

            {

                e.Handled = true;

            }

        }

        void fnclear()

        {

            loadgrid();

            txtSlipNo.Text = "";

            cmbFactory.Text = "---Select/Enter---";

            cmbVehicleNo.Text = "---Select/Enter---";

            cmbTypeOfMaterial.Text = "---Select/Enter---";

            cmbMetalSize.Text = "---Select/Enter---";

            txtUnits.Text = "";

            cmbCustomerName.SelectedIndex = -1 ;

            cmbCustomerName.Text = "---Select---";

            txtCustomerCity.Text = "";

            txtMetalAmount.Text = "";

            txtTransportAmount.Text = "";

            txtamtDueorAdv.Text = "0";

            txtAmounttobePaid.Text = "";

            txtAmountPaid.Text = "";

            cmbCustomerName.Enabled = true;

            txtSlipNo.Enabled = true;

            btnSave.Text = "Save";

            btnDelete.Enabled = false;

            txtDriverName.Text = "";

            txtstartread.Text = "";

            txtendread.Text = "";

        }

 

        void loaddetails()

        {

 

            ds = new DataSet();

            ad = new SqlDataAdapter("Select * from tblMetalMstr order by date desc", cn);

            ad.Fill(ds);

 

            dataGridView1.DataSource = ds.Tables[0];

            dataGridView1.ReadOnly = true;

 

 

            cmbFactory.Items.Clear();

            for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)

            {

                if (!cmbFactory.Items.Contains(ds.Tables[0].Rows[i][1].ToString()))

                {

                    cmbFactory.Items.Add(ds.Tables[0].Rows[i][1].ToString());

                }

            }

            cmbVehicleNo.Items.Clear();

            for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)

            {

                if (!cmbVehicleNo.Items.Contains(ds.Tables[0].Rows[i][2].ToString()))

                {

                    cmbVehicleNo.Items.Add(ds.Tables[0].Rows[i][2].ToString());

                }

            }

            cmbTypeOfMaterial.Items.Clear();

            for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)

            {

                if (!cmbTypeOfMaterial.Items.Contains(ds.Tables[0].Rows[i][3].ToString()))

                {

                    cmbTypeOfMaterial.Items.Add(ds.Tables[0].Rows[i][3].ToString());

                }

            }

 

            cmbMetalSize.Items.Clear();

            for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)

            {

                if (!cmbMetalSize.Items.Contains(ds.Tables[0].Rows[i][4].ToString()))

                {

                    cmbMetalSize.Items.Add(ds.Tables[0].Rows[i][4].ToString());

                }

            }

           

 

        }

 

        void loadgrid()

        {

            ds = new DataSet();

            ad = new SqlDataAdapter("select * from tblMetalMstr order by date desc", cn);

            ad.Fill(ds);

            dataGridView1.DataSource = ds.Tables [0];

 

        }

 

        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)

        {

          

           selected_custid  = GetCustomerid(dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[6].Value.ToString());

            txtSlipNo.Text = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[0].Value.ToString();

            txtSlipNo.Enabled = false;

            dtpDate.Value = DateTime.Parse(dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[12].Value.ToString() );

            cmbFactory.SelectedItem = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[1].Value.ToString();

            cmbVehicleNo.SelectedItem  = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[2].Value.ToString();

            cmbTypeOfMaterial.SelectedItem = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[3].Value.ToString();

            cmbMetalSize.SelectedItem = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[4].Value.ToString();

            txtUnits.Text = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[5].Value.ToString();

            cmbCustomerName.SelectedItem = selected_custid.ToString() + "-" + dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[6].Value.ToString();

            cmbCustomerName.Enabled = false;

            txtCustomerCity.Text = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[7].Value.ToString();

            txtMetalAmount.Text = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[8].Value.ToString();

            txtTransportAmount.Text = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[9].Value.ToString();

            txtAmountPaid.Text = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[10].Value.ToString();

            txtAmounttobePaid .Text =(float.Parse (txtAmountPaid .Text )+float.Parse (dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[11].Value.ToString())).ToString() ;

            txtamtDueorAdv.Text = (float.Parse(txtAmounttobePaid.Text) - (float.Parse(txtMetalAmount.Text) + float.Parse(txtTransportAmount.Text))).ToString();

            txtDriverName.Text = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[14].Value.ToString();

            txtstartread.Text = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[15].Value.ToString();

            txtendread.Text = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[16].Value.ToString();

            btnSave.Text = "Update";

            btnDelete.Enabled = true;

               

        }

 

        int GetCustomerid(string cusname)

        {

            ds = new DataSet();

            ad = new SqlDataAdapter("select CustomerID from MstrCustomer where Customer_Name='" + cusname + "'", cn);

            ad.Fill(ds);          

            return int.Parse(ds.Tables[0].Rows[0][0].ToString());          

 

        }

 

        private void btnNext_Click(object sender, EventArgs e)

        {

            if (MessageBox.Show("Are you sure to delete this trip information", "BMU", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == System.Windows.Forms.DialogResult.Yes)

            {

                ds = new DataSet();

                ad = new SqlDataAdapter("Update MstrCustomer set Amount_Due_Bal=" + float.Parse (txtamtDueorAdv .Text )+ " where CustomerID=" + selected_custid + "", cn);

                ad.Fill(ds);

                ds = new DataSet();

                ad = new SqlDataAdapter("delete from tblMetalMstr where slip_No=" + int.Parse(txtSlipNo.Text) + "", cn);

                ad.Fill(ds);

                fnclear();

                MessageBox.Show("Record Deleted Successfully");

            }

           

        }

 

        private void txtSlipNo_KeyPress(object sender, KeyPressEventArgs e)

        {

            if (((int)e.KeyChar > 47 && (int)e.KeyChar < 58) || (int)e.KeyChar == 46 || (int)e.KeyChar == 8)

            {

            }

            else

            {

                e.Handled = true;

            }

        }

 

        private void cmbCustomerName_KeyPress(object sender, KeyPressEventArgs e)

        {

            e.Handled = true;

        }

       

 

      

    }

}

  

 

  

 

 

 

 

 

 

 

 

8.SYSTEM TESTING

 

 

 

 

 

 

 

 

 

 

 

 

SYSTEM TESTING

 

Before the system goes live, it must be tested thoroughly. Testing reveals the presence of bugs in the system. Testing has two parts:

 

Verification – Does it implement a specific function correctly?

Validation – Does it confirm to the user requirements?

 

System testing can be grouped as:

Unit Testing:-

 

This is first level of testing in which different modules are tested against design specification. Unit testing is done for the verification of the code produced during the coding phase and to test the internal logic of the modules. After coding, each module were tested and run individually. All the GUIs where data entry is required were tested found no errors.

 

Integrated Testing:-

 

Integrated testing is a systematic technique for constructing the program structure while conducting test to uncover errors associated with interfacing. Many tested modules are integrated into a subsystem, which is then tested. The different modules were linked together and tested. Correctness and accuracy were confirmed.

 

Validation Testing:-

 

Validation testing provides the final assurance that the software meets all functional, behavioral and performance requirements. The software is completely assembled as a package, interfacing errors have been uncovered and collected, and a final series of software test – validation test may begin. Validation succeeds when the software works as per the user requirement. Validation phase usually produces minor modifications in the software to deal with errors and failures that are uncovered. A test case is a dummy set of data used to input a system and test it.

 


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

SQL Server Unique Constraint

SQL Server Unique Constraint Whats is Unique Constraint in SQL | How to create Unique Constraint in SQL | Unique Constraint with Example in ...